aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commite067c3c23b3994597b6e43e32ae36d681387f9e7 (patch)
tree8debe153041908bd3e63d08e5e870b0ec2748597 /lib
parent543e04d0418336a8eebceaa9ccc242be48457a40 (diff)
downloadexternal_llvm-e067c3c23b3994597b6e43e32ae36d681387f9e7.zip
external_llvm-e067c3c23b3994597b6e43e32ae36d681387f9e7.tar.gz
external_llvm-e067c3c23b3994597b6e43e32ae36d681387f9e7.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')
-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";
}