aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorScott Michel <scottm@aero.org>2008-06-03 15:39:51 +0000
committerScott Michel <scottm@aero.org>2008-06-03 15:39:51 +0000
commiteefc845b5f407adf1992602aaac1142b2d583220 (patch)
tree8debe153041908bd3e63d08e5e870b0ec2748597 /lib/CodeGen
parenta8c63f0fc9feb48f17d702a907f065959c41e337 (diff)
downloadexternal_llvm-eefc845b5f407adf1992602aaac1142b2d583220.zip
external_llvm-eefc845b5f407adf1992602aaac1142b2d583220.tar.gz
external_llvm-eefc845b5f407adf1992602aaac1142b2d583220.tar.bz2
Find a better place to output hex constants corresponding to integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index d225dbc..3265a99 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -1074,6 +1074,11 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, bool Packed) {
const Type *type = CV->getType();
printDataDirective(type);
EmitConstantValueOnly(CV);
+ if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
+ O << "\t\t\t"
+ << TAI->getCommentString()
+ << " 0x" << CI->getValue().toStringUnsigned(16);
+ }
O << "\n";
}