diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index d225dbce9fe..3265a99c05d 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(CV)) { + O << "\t\t\t" + << TAI->getCommentString() + << " 0x" << CI->getValue().toStringUnsigned(16); + } O << "\n"; }