[all-commits] [llvm/llvm-project] d65557: [NFC][XCOFF][AIX] Refactor get/setContainingCsect

jasonliudev via All-commits all-commits at lists.llvm.org
Fri Apr 3 06:33:31 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d65557d15d40e541c10691996125d7a0310c42ab
      https://github.com/llvm/llvm-project/commit/d65557d15d40e541c10691996125d7a0310c42ab
  Author: jasonliu <jasonliu.development at gmail.com>
  Date:   2020-04-03 (Fri, 03 Apr 2020)

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

  Log Message:
  -----------
  [NFC][XCOFF][AIX] Refactor get/setContainingCsect

Summary:
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/setRepresentedCsect (was get/setContainingCsect)
if symbol itself represents a csect.

Reviewers: DiggerLin, hubert.reinterpretcast, daltenty

Differential Revision: https://reviews.llvm.org/D77080




More information about the All-commits mailing list