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

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 12:26:16 PDT 2020


jasonliu created this revision.
jasonliu added reviewers: hubert.reinterpretcast, daltenty, DiggerLin, sfertile.
jasonliu added a project: LLVM.
Herald added subscribers: llvm-commits, kbarton, hiraditya, nemanjai.
jasonliu retitled this revision from "[XCOFF][AIX] Fix getSymbol to return the correct qualname" to "[XCOFF][AIX] Fix getSymbol to return the correct qualname when necessary".
Herald added a subscriber: wuzish.
jasonliu added a comment.
jasonliu marked an inline comment as done.
jasonliu added inline comments.
jasonliu edited the summary of this revision.
jasonliu marked an inline comment as done.


================
Comment at: llvm/include/llvm/Target/TargetLoweringObjectFile.h:246
+  /// Targets that have special convention for their symbols could use 
+  /// this hook to return a specialied symbol.
+  virtual MCSymbol *getTargetSymbol(const GlobalValue *GV,
----------------
specialied -> specialized.


================
Comment at: llvm/lib/Target/TargetMachine.cpp:263
+  if (getTargetTriple().isOSBinFormatXCOFF()) {
+    return TLOF->getTargetSymbol(GV, *this);
+  }
----------------
**To reviewers**, 
I'm not sure if this is a preferred way to inject target specific behavior. Or we want to override TargetMachine::getSymbol directly instead.
Please let me know if you find the other way is more appealing, or you could think of a better way to inject this target specific behavior.
Thanks.


AIX symbol have qualname and unqualified name. The stock getSymbol could only return unqualified name, which leads us to patch many caller side(lowerConstant, getMCSymbolForTOCPseudoMO). So we should try to address this problem in the callee side(getSymbol) and clean up the caller side instead.

Note: this is a "mostly" NFC patch, with a fix for the original lowerConstant behavior.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78045

Files:
  llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
  llvm/include/llvm/Target/TargetLoweringObjectFile.h
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
  llvm/lib/Target/TargetMachine.cpp
  llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78045.257054.patch
Type: text/x-patch
Size: 15568 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200413/1607354b/attachment.bin>


More information about the llvm-commits mailing list