[PATCH] D80642: [AIX] Emit AvailableExternally Linkage on AIX

Xiangling Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 19:39:31 PDT 2020


Xiangling_L marked 2 inline comments as done.
Xiangling_L added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:442
   case GlobalValue::AvailableExternallyLinkage:
+    if (TM.getTargetTriple().isOSBinFormatXCOFF()) {
+      OutStreamer->emitSymbolAttribute(GVSym, MCSA_Extern);
----------------
DiggerLin wrote:
> Xiangling_L wrote:
> > DiggerLin wrote:
> > > DiggerLin wrote:
> > > > I think we look AvailableExternallyLinkage as AvailableExternallyLinkage
> > > > 
> > > > you can change as  
> > > > ```
> > > > case GlobalValue::ExternalLinkage:
> > > > case GlobalValue::AvailableExternallyLinkage:
> > > >     if (MAI->hasDotExternDirective() && GV->isDeclarationForLinker()) {
> > > > }
> > > > ```
> > > > and we do not need code 
> > > > ````
> > > > case GlobalValue::AvailableExternallyLinkage:
> > > >     if (TM.getTargetTriple().isOSBinFormatXCOFF()) {
> > > >    ....
> > > > }
> > > > ````
> > > > here.
> > > sorry it should be "I think we look AvailableExternallyLinkage as ExternalLinkage"
> > Thank you for your suggestion. I agree that it would give the query  more semantic meaning. But since if a GV falls under the `AvailableExternallyLinkage` category, then `GV->isDeclarationForLinker()`is always true. So it seems we only need `MAI->hasDotExternDirective()` here?
> but for ExternalLinkage, it need GV->isDeclarationForLinker(). otherwise it will emit .globl symbolName.
Sorry, I don't make it clear. But I don't think we should combine `ExternalLinkage` and `AvailableExternallyLinkage`. Because for other targets, we still want to fall throught to `llvm_unreachable`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80642





More information about the llvm-commits mailing list