Remove unneeded "TargetMachine.h" #includes.
[oota-llvm.git] / test / Scripts / common_dump.py
index 3d69c3fb27f2576c05cd695be34100fa1651719a..fd58993c058482e9bc7a2fba9a18a6ccc9991ec6 100644 (file)
@@ -31,7 +31,7 @@ def dataToHexUnified(d):
     return ''.join(bytes).strip()
 
 
-def HexDump(val, numBits=32):
+def HexDump(valPair):
     """
     1. do not print 'L'
     2. Handle negatives and large numbers by mod (2^numBits)
@@ -40,7 +40,9 @@ def HexDump(val, numBits=32):
     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
-