Just print integer constants as signed values. The actual signedness
authorReid Spencer <rspencer@reidspencer.com>
Thu, 21 Dec 2006 19:04:23 +0000 (19:04 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Thu, 21 Dec 2006 19:04:23 +0000 (19:04 +0000)
doesn't matter as it is determined in the way the constant is used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32733 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter.cpp

index 82e110a27536ac9de5342b33b6d6c8b5796d63d6..5bbcaee339bc24d93fb7dd4ad6b4de59b7118e28 100644 (file)
@@ -392,13 +392,7 @@ void AsmPrinter::EmitConstantValueOnly(const Constant *CV) {
     assert(CB->getValue());
     O << "1";
   } else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
-    if (CI->getType()->isSigned()) {
-      if (((CI->getSExtValue() << 32) >> 32) == CI->getSExtValue())
-        O << CI->getSExtValue();
-      else
-        O << (uint64_t)CI->getSExtValue();
-    } else 
-      O << CI->getZExtValue();
+    O << CI->getSExtValue();
   } else if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV)) {
     // This is a constant address for a global variable or function. Use the
     // name of the variable or function as the address value, possibly