aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-23 03:27:05 +0000
committerChris Lattner <sabre@nondot.org>2004-02-23 03:27:05 +0000
commitf7b42259e9901a0f2e7786523080f908ebb918e6 (patch)
tree6329de5f03fb8e422a847fae275cd962fab74cf9
parent311ca2e51f1c9be1b81a73e7acef4e3564b71ad9 (diff)
Work around a gas bug. Print '-9223372036854775808' as unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11729 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/Printer.cpp5
-rw-r--r--lib/Target/X86/X86AsmPrinter.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/Target/X86/Printer.cpp b/lib/Target/X86/Printer.cpp
index be1f34d3bb..d71715aa61 100644
--- a/lib/Target/X86/Printer.cpp
+++ b/lib/Target/X86/Printer.cpp
@@ -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))
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index be1f34d3bb..d71715aa61 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -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))