[PATCH] D78045: [XCOFF][AIX] Fix getSymbol to return the correct qualname when necessary

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 10:35:28 PDT 2020


DiggerLin added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1614
       OutStreamer->emitXCOFFLocalCommonSymbol(
-          GVSym, Size, Csect->getQualNameSymbol(), Align);
+          OutContext.getOrCreateSymbol(GVSym->getUnqualifiedName()), Size,
+          GVSym, Align);
----------------
jasonliu wrote:
> hubert.reinterpretcast wrote:
> > DiggerLin wrote:
> > > since we have a qualname symbol, I do not think we need to create and unnecessary  UnqualifiedName symbol.
> > > maybe we change change the interface of emitXCOFFLocalCommonSymbol. I do not think we need to pass two Symbols(MCSymbol *LabelSym,  and  MCSymbol *CsectSym) in the emitXCOFFLocalCommonSymbol.
> > The label does not have to be given linkage, but it is not optional in the assembly syntax.
> `.lcomm  a[BS],4,a[BS],2` does not work. First expression must be a label.  
we can  change 

LabelSym->print(OS, MAI);

to 

OS << CsectSym->getUnqualifiedName();

in the function void MCAsmStreamer::emitXCOFFLocalCommonSymbol


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78045/new/

https://reviews.llvm.org/D78045





More information about the llvm-commits mailing list