diff options
author | jasonliu <jasonliu.development@gmail.com> | 2020-04-03 13:13:13 +0000 |
---|---|---|
committer | jasonliu <jasonliu.development@gmail.com> | 2020-04-03 13:33:12 +0000 |
commit | d65557d15d40e541c10691996125d7a0310c42ab (patch) | |
tree | 6fd65aeee6a12df4f6684b606ecfb3795ce6eaab /llvm/lib/CodeGen/MachineModuleInfo.cpp | |
parent | f22445bf57606ffc9914777c228936d4b3f8140d (diff) | |
download | llvm-d65557d15d40e541c10691996125d7a0310c42ab.zip llvm-d65557d15d40e541c10691996125d7a0310c42ab.tar.gz llvm-d65557d15d40e541c10691996125d7a0310c42ab.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index ce5961a..a55943aff 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -105,15 +105,6 @@ ArrayRef<MCSymbol *> MMIAddrLabelMap::getAddrLabelSymbolToEmit(BasicBlock *BB) { Entry.Index = BBCallbacks.size() - 1; Entry.Fn = BB->getParent(); MCSymbol *Sym = Context.createTempSymbol(!BB->hasAddressTaken()); - if (Context.getObjectFileInfo()->getTargetTriple().isOSBinFormatXCOFF()) { - MCSymbol *FnEntryPointSym = - Context.lookupSymbol("." + Entry.Fn->getName()); - assert(FnEntryPointSym && "The function entry pointer symbol should have" - " already been initialized."); - MCSectionXCOFF *Csect = - cast<MCSymbolXCOFF>(FnEntryPointSym)->getContainingCsect(); - cast<MCSymbolXCOFF>(Sym)->setContainingCsect(Csect); - } Entry.Symbols.push_back(Sym); return Entry.Symbols; } |