[PATCH] D77080: [NFC][XCOFF][AIX] Refactor get/setContainingCsect

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 12:30:18 PDT 2020


jasonliu created this revision.
jasonliu added reviewers: hubert.reinterpretcast, DiggerLin, daltenty, sfertile.
jasonliu added a project: LLVM.
Herald added subscribers: kbarton, hiraditya, mgorny, nemanjai.

For current architect, we always require setContainingCsect to be called on every MCSymbol got used in XCOFF context.
This is very hard to achieve because symbols gets created everywhere and other MCSymbol types(ELF, COFF) do not have similar rules. 
It's very easy to miss setting the containing csect, and we would need to add a lot of XCOFF specialized code around some common code area.

This patch intendeds to do

1. Rely on getFragment().getParent() to get csect from labels.
2. Only use get/setCsectMCSymbolXCOFF(was get/setContainingCsect) if the symbol is a qualname symbol (in other words, symbol itself represents a csect).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77080

Files:
  llvm/include/llvm/MC/MCSectionXCOFF.h
  llvm/include/llvm/MC/MCSymbolXCOFF.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/MachineModuleInfo.cpp
  llvm/lib/MC/CMakeLists.txt
  llvm/lib/MC/MCSymbolXCOFF.cpp
  llvm/lib/MC/XCOFFObjectWriter.cpp
  llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77080.253659.patch
Type: text/x-patch
Size: 9158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200330/5f207d27/attachment-0001.bin>


More information about the llvm-commits mailing list