diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h --- a/llvm/include/llvm/MC/MCContext.h +++ b/llvm/include/llvm/MC/MCContext.h @@ -156,9 +156,6 @@ /// number of section symbols with the same name). StringMap UsedNames; - /// Keeps track of labels that are used in inline assembly. - SymbolTable InlineAsmUsedLabelNames; - /// The next ID to dole out to an unnamed assembler temporary symbol with /// a given prefix. StringMap NextID; @@ -524,16 +521,6 @@ /// APIs. const SymbolTable &getSymbols() const { return Symbols; } - /// isInlineAsmLabel - Return true if the name is a label referenced in - /// inline assembly. - MCSymbol *getInlineAsmLabel(StringRef Name) const { - return InlineAsmUsedLabelNames.lookup(Name); - } - - /// registerInlineAsmLabel - Records that the name is a label referenced in - /// inline assembly. - void registerInlineAsmLabel(MCSymbol *Sym); - /// @} /// \name Section Management diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp @@ -297,7 +297,6 @@ const BlockAddress *BA = MI->getOperand(OpNo).getBlockAddress(); MCSymbol *Sym = AP->GetBlockAddressSymbol(BA); Sym->print(OS, AP->MAI); - MMI->getContext().registerInlineAsmLabel(Sym); } else if (MI->getOperand(OpNo).isMBB()) { const MCSymbol *Sym = MI->getOperand(OpNo).getMBB()->getSymbol(); Sym->print(OS, AP->MAI); diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -77,7 +77,6 @@ : Swift5ReflectionSegmentName(Swift5ReflSegmentName), TT(TheTriple), SrcMgr(mgr), InlineSrcMgr(nullptr), DiagHandler(defaultDiagHandler), MAI(mai), MRI(mri), MSTI(msti), Symbols(Allocator), UsedNames(Allocator), - InlineAsmUsedLabelNames(Allocator), CurrentDwarfLoc(0, 0, 0, DWARF2_FLAG_IS_STMT, 0, 0), AutoReset(DoAutoReset), TargetOptions(TargetOpts) { SecureLogFile = AsSecureLogFileName; @@ -156,7 +155,6 @@ SPIRVAllocator.DestroyAll(); MCSubtargetAllocator.DestroyAll(); - InlineAsmUsedLabelNames.clear(); UsedNames.clear(); Symbols.clear(); Allocator.Reset(); @@ -375,10 +373,6 @@ Streamer.emitAssignment(Symbol, MCConstantExpr::create(Val, *this)); } -void MCContext::registerInlineAsmLabel(MCSymbol *Sym) { - InlineAsmUsedLabelNames[Sym->getName()] = Sym; -} - MCSymbolXCOFF * MCContext::createXCOFFSymbolImpl(const StringMapEntry *Name, bool IsTemporary) { diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -1245,9 +1245,7 @@ } } - MCSymbol *Sym = getContext().getInlineAsmLabel(SymbolName); - if (!Sym) - Sym = getContext().getOrCreateSymbol( + MCSymbol *Sym = getContext().getOrCreateSymbol( MAI.shouldEmitLabelsInUpperCase() ? SymbolName.upper() : SymbolName); // If this is an absolute variable reference, substitute it now to preserve diff --git a/llvm/lib/MC/MCParser/MasmParser.cpp b/llvm/lib/MC/MCParser/MasmParser.cpp --- a/llvm/lib/MC/MCParser/MasmParser.cpp +++ b/llvm/lib/MC/MCParser/MasmParser.cpp @@ -1681,7 +1681,7 @@ } } - MCSymbol *Sym = getContext().getInlineAsmLabel(SymbolName); + MCSymbol *Sym = getContext().lookupSymbol(SymbolName); if (!Sym) { // If this is a built-in numeric value, treat it as a constant. auto BuiltinIt = BuiltinSymbolMap.find(SymbolName.lower());