Skip to content

Commit

Permalink
[AIX][AsmPrinter] Print Global Variable in comments
Browse files Browse the repository at this point in the history
The default AsmPrinter print GV in comments,
AIX should do so too.

This also fix LLVM :: CodeGen/Generic/inline-asm-mem-clobber.ll.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D102534
  • Loading branch information
Jinsong Ji committed May 16, 2021
1 parent 9ae529d commit 4b91f96
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2183,6 +2183,15 @@ void PPCAIXAsmPrinter::emitGlobalVariableHelper(const GlobalVariable *GV) {
report_fatal_error("Encountered a global variable kind that is "
"not supported yet.");

// Print GV in verbose mode
if (isVerbose()) {
if (GV->hasInitializer()) {
GV->printAsOperand(OutStreamer->GetCommentOS(),
/*PrintType=*/false, GV->getParent());
OutStreamer->GetCommentOS() << '\n';
}
}

MCSectionXCOFF *Csect = cast<MCSectionXCOFF>(
getObjFileLowering().SectionForGlobal(GV, GVKind, TM));

Expand Down

0 comments on commit 4b91f96

Please sign in to comment.