[PATCH] D76932: [AIX] emit .extern  and .weak directive linkage
    Jason Liu via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Tue Mar 31 10:33:42 PDT 2020
    
    
  
jasonliu added inline comments.
================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1492
+
+    if (MAI->hasDotExternDirective()) {
+      MCSymbol *Name = getSymbol(&F);
----------------
This query asked if the target supports .extern. However, .extern is not the only directive that could get emitted here. We could also emit .weak.
================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1498
+      }
+      emitLinkage(&F, Name);
+      continue;
----------------
I'm surprised we do not enter here for `foo_ext_weak()`. The result of that is we need to do something in `lowerConstant()`, which I would want to avoid if possible. 
Should we look into why `isDeclarationForLinker()` returns false for `foo_ext_weak()` here?
My guess is we returned false for `!F->isMaterializable()`. And I'm not sure if `foo_ext_weak` is materializable is the correct answer here. 
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76932/new/
https://reviews.llvm.org/D76932
    
    
More information about the cfe-commits
mailing list