Work around a gas bug. Print '-9223372036854775808' as unsigned.
authorChris Lattner <sabre@nondot.org>
Mon, 23 Feb 2004 03:27:05 +0000 (03:27 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 23 Feb 2004 03:27:05 +0000 (03:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11729 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/Printer.cpp
lib/Target/X86/X86AsmPrinter.cpp

index be1f34d3bbe79b60fd31b69a1e295fab899c0d6a..d71715aa61693a6785a42fe8b0a99650f3350f82 100644 (file)
@@ -144,7 +144,10 @@ void Printer::emitConstantValueOnly(const Constant *CV) {
     assert(CB == ConstantBool::True);
     O << "1";
   } else if (const ConstantSInt *CI = dyn_cast<ConstantSInt>(CV))
-    O << CI->getValue();
+    if (((CI->getValue() << 32) >> 32) == CI->getValue())
+      O << CI->getValue();
+    else
+      O << (unsigned long long)CI->getValue();
   else if (const ConstantUInt *CI = dyn_cast<ConstantUInt>(CV))
     O << CI->getValue();
   else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CV))
index be1f34d3bbe79b60fd31b69a1e295fab899c0d6a..d71715aa61693a6785a42fe8b0a99650f3350f82 100644 (file)
@@ -144,7 +144,10 @@ void Printer::emitConstantValueOnly(const Constant *CV) {
     assert(CB == ConstantBool::True);
     O << "1";
   } else if (const ConstantSInt *CI = dyn_cast<ConstantSInt>(CV))
-    O << CI->getValue();
+    if (((CI->getValue() << 32) >> 32) == CI->getValue())
+      O << CI->getValue();
+    else
+      O << (unsigned long long)CI->getValue();
   else if (const ConstantUInt *CI = dyn_cast<ConstantUInt>(CV))
     O << CI->getValue();
   else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CV))