Find a better place to output hex constants corresponding to integers.

llvm-svn: 51904
This commit is contained in:
Scott Michel 2008-06-03 15:39:51 +00:00
parent b788d9bd27
commit c0e9ff6e52
1 changed files with 5 additions and 0 deletions

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