From d964ea8fd73fc05d98d281f6c9af2078e020e24f Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 16 Sep 2016 17:07:23 +0000 Subject: [PATCH] Actually remove the Mangler from the AsmPrinter and clean up the places it was "used" but not used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281749 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/AsmPrinter.h | 4 ---- lib/Target/Lanai/LanaiAsmPrinter.cpp | 4 ++-- lib/Target/Lanai/LanaiMCInstLower.cpp | 1 - lib/Target/Lanai/LanaiMCInstLower.h | 3 +-- lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 2 -- lib/Target/XCore/XCoreAsmPrinter.cpp | 2 +- lib/Target/XCore/XCoreMCInstLower.cpp | 7 ++----- lib/Target/XCore/XCoreMCInstLower.h | 3 +-- 8 files changed, 7 insertions(+), 19 deletions(-) diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index de618d17357..e2cf1989b72 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -89,10 +89,6 @@ public: /// This is a pointer to the current MachineModuleInfo. MachineModuleInfo *MMI; - /// Name-mangler for global names. - /// - Mangler *Mang; - /// The symbol for the current function. This is recalculated at the beginning /// of each call to runOnMachineFunction(). /// diff --git a/lib/Target/Lanai/LanaiAsmPrinter.cpp b/lib/Target/Lanai/LanaiAsmPrinter.cpp index 9d39cef9f8e..35bf5144de9 100644 --- a/lib/Target/Lanai/LanaiAsmPrinter.cpp +++ b/lib/Target/Lanai/LanaiAsmPrinter.cpp @@ -151,7 +151,7 @@ void LanaiAsmPrinter::emitCallInstruction(const MachineInstr *MI) { assert((MI->getOpcode() == Lanai::CALL || MI->getOpcode() == Lanai::CALLR) && "Unsupported call function"); - LanaiMCInstLower MCInstLowering(OutContext, *Mang, *this); + LanaiMCInstLower MCInstLowering(OutContext, *this); MCSubtargetInfo STI = getSubtargetInfo(); // Insert save rca instruction immediately before the call. // TODO: We should generate a pc-relative mov instruction here instead @@ -188,7 +188,7 @@ void LanaiAsmPrinter::emitCallInstruction(const MachineInstr *MI) { } void LanaiAsmPrinter::customEmitInstruction(const MachineInstr *MI) { - LanaiMCInstLower MCInstLowering(OutContext, *Mang, *this); + LanaiMCInstLower MCInstLowering(OutContext, *this); MCSubtargetInfo STI = getSubtargetInfo(); MCInst TmpInst; MCInstLowering.Lower(MI, TmpInst); diff --git a/lib/Target/Lanai/LanaiMCInstLower.cpp b/lib/Target/Lanai/LanaiMCInstLower.cpp index 6c809b43f7e..39c633578d4 100644 --- a/lib/Target/Lanai/LanaiMCInstLower.cpp +++ b/lib/Target/Lanai/LanaiMCInstLower.cpp @@ -21,7 +21,6 @@ #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/IR/Constants.h" -#include "llvm/IR/Mangler.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" diff --git a/lib/Target/Lanai/LanaiMCInstLower.h b/lib/Target/Lanai/LanaiMCInstLower.h index 41c0766e86d..6d7818d63d8 100644 --- a/lib/Target/Lanai/LanaiMCInstLower.h +++ b/lib/Target/Lanai/LanaiMCInstLower.h @@ -31,8 +31,7 @@ class LLVM_LIBRARY_VISIBILITY LanaiMCInstLower { AsmPrinter &Printer; public: - LanaiMCInstLower(MCContext &CTX, Mangler & /*Mang*/, AsmPrinter &AP) - : Ctx(CTX), Printer(AP) {} + LanaiMCInstLower(MCContext &CTX, AsmPrinter &AP) : Ctx(CTX), Printer(AP) {} void Lower(const MachineInstr *MI, MCInst &OutMI) const; MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const; diff --git a/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/lib/Target/NVPTX/NVPTXAsmPrinter.cpp index b975f2719d4..c5602d5d45d 100644 --- a/lib/Target/NVPTX/NVPTXAsmPrinter.cpp +++ b/lib/Target/NVPTX/NVPTXAsmPrinter.cpp @@ -848,8 +848,6 @@ bool NVPTXAsmPrinter::doInitialization(Module &M) { const_cast(getObjFileLowering()) .Initialize(OutContext, TM); - Mang = new Mangler(); - // Emit header before any dwarf directives are emitted below. emitHeader(M, OS1, STI); OutStreamer->EmitRawText(OS1.str()); diff --git a/lib/Target/XCore/XCoreAsmPrinter.cpp b/lib/Target/XCore/XCoreAsmPrinter.cpp index 2c1bbeddedf..2c23600b00a 100644 --- a/lib/Target/XCore/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/XCoreAsmPrinter.cpp @@ -171,7 +171,7 @@ void XCoreAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) { } void XCoreAsmPrinter::EmitFunctionBodyStart() { - MCInstLowering.Initialize(Mang, &MF->getContext()); + MCInstLowering.Initialize(&MF->getContext()); } /// EmitFunctionBodyEnd - Targets can override this to emit stuff after diff --git a/lib/Target/XCore/XCoreMCInstLower.cpp b/lib/Target/XCore/XCoreMCInstLower.cpp index 03c5fa2e9c4..7763ccc8f4a 100644 --- a/lib/Target/XCore/XCoreMCInstLower.cpp +++ b/lib/Target/XCore/XCoreMCInstLower.cpp @@ -25,12 +25,9 @@ using namespace llvm; XCoreMCInstLower::XCoreMCInstLower(class AsmPrinter &asmprinter) -: Printer(asmprinter) {} + : Printer(asmprinter) {} -void XCoreMCInstLower::Initialize(Mangler *M, MCContext *C) { - Mang = M; - Ctx = C; -} +void XCoreMCInstLower::Initialize(MCContext *C) { Ctx = C; } MCOperand XCoreMCInstLower::LowerSymbolOperand(const MachineOperand &MO, MachineOperandType MOTy, diff --git a/lib/Target/XCore/XCoreMCInstLower.h b/lib/Target/XCore/XCoreMCInstLower.h index 569147872f2..8fb1593cc6e 100644 --- a/lib/Target/XCore/XCoreMCInstLower.h +++ b/lib/Target/XCore/XCoreMCInstLower.h @@ -25,11 +25,10 @@ namespace llvm { class LLVM_LIBRARY_VISIBILITY XCoreMCInstLower { typedef MachineOperand::MachineOperandType MachineOperandType; MCContext *Ctx; - Mangler *Mang; AsmPrinter &Printer; public: XCoreMCInstLower(class AsmPrinter &asmprinter); - void Initialize(Mangler *mang, MCContext *C); + void Initialize(MCContext *C); void Lower(const MachineInstr *MI, MCInst &OutMI) const; MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const; -- 2.50.1