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
This commit is contained in:
Scott Michel 2008-06-03 15:39:51 +00:00
parent a8c63f0fc9
commit eefc845b5f

View File

@ -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";
}