[PATCH] D72347: [NFC][XCOFF] Refactor Csect creation into TargetLoweringObjectFile

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 08:28:08 PST 2020


DiggerLin added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1803
+  // External global variables are already handled.
+  if (!GV->hasInitializer())
+    return;
----------------
If I understand correctly, I do not think we need to change the 
  if (!GV->hasInitializer())  to here .

the reason is  if the extern variable is declared in the source code. but never be used, it the declare extern variable do not to show on the xcoff object file even in the symbol table or in the asm file.

if the extern variable is  declared and be used as  initiator , the MCSection will be created in the PPCAIXAsmPrinter::lowerConstant() 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72347





More information about the llvm-commits mailing list