aboutsummaryrefslogtreecommitdiff
path: root/test/Scripts/common_dump.py
diff options
context:
space:
mode:
authorNico Rieck <nico.rieck@gmail.com>2013-04-12 04:07:13 +0000
committerNico Rieck <nico.rieck@gmail.com>2013-04-12 04:07:13 +0000
commit7e87373e91afe6a9ed1ead63d9d02448f02213d3 (patch)
treecaad7c2ed5830e4e899e695633a3244ff5e30592 /test/Scripts/common_dump.py
parentf89da7210b09a0a0f7c9ee216cd54dca03c6b64a (diff)
Remove obsolete object file dumpers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Scripts/common_dump.py')
-rw-r--r--test/Scripts/common_dump.py48
1 files changed, 0 insertions, 48 deletions
diff --git a/test/Scripts/common_dump.py b/test/Scripts/common_dump.py
deleted file mode 100644
index fd58993c05..0000000000
--- a/test/Scripts/common_dump.py
+++ /dev/null
@@ -1,48 +0,0 @@
-def dataToHex(d):
- """ Convert the raw data in 'd' to an hex string with a space every 4 bytes.
- """
- bytes = []
- for i,c in enumerate(d):
- byte = ord(c)
- hex_byte = hex(byte)[2:]
- if byte <= 0xf:
- hex_byte = '0' + hex_byte
- if i % 4 == 3:
- hex_byte += ' '
- bytes.append(hex_byte)
- return ''.join(bytes).strip()
-
-def dataToHexUnified(d):
- """ Convert the raw data in 'd' to an hex string with a space every 4 bytes.
- Each 4byte number is prefixed with 0x for easy sed/rx
- Fixme: convert all MC tests to use this routine instead of the above
- """
- bytes = []
- for i,c in enumerate(d):
- byte = ord(c)
- hex_byte = hex(byte)[2:]
- if byte <= 0xf:
- hex_byte = '0' + hex_byte
- if i % 4 == 0:
- hex_byte = '0x' + hex_byte
- if i % 4 == 3:
- hex_byte += ' '
- bytes.append(hex_byte)
- return ''.join(bytes).strip()
-
-
-def HexDump(valPair):
- """
- 1. do not print 'L'
- 2. Handle negatives and large numbers by mod (2^numBits)
- 3. print fixed length, prepend with zeros.
- Length is exactly 2+(numBits/4)
- 4. Do print 0x Why?
- so that they can be easily distinguished using sed/rx
- """
- val, numBits = valPair
- assert 0 <= val < (1 << numBits)
-
- val = val & (( 1 << numBits) - 1)
- newFmt = "0x%0" + "%d" % (numBits / 4) + "x"
- return newFmt % val