From d65557d15d40e541c10691996125d7a0310c42ab Mon Sep 17 00:00:00 2001 From: jasonliu Date: Fri, 3 Apr 2020 13:13:13 +0000 Subject: [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 --- llvm/lib/CodeGen/MachineModuleInfo.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp') 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 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(FnEntryPointSym)->getContainingCsect(); - cast(Sym)->setContainingCsect(Csect); - } Entry.Symbols.push_back(Sym); return Entry.Symbols; } -- cgit v1.1