llvm.org GIT mirror llvm / d964ea8
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 Eric Christopher 3 years ago
8 changed file(s) with 7 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
8888 /// This is a pointer to the current MachineModuleInfo.
8989 MachineModuleInfo *MMI;
9090
91 /// Name-mangler for global names.
92 ///
93 Mangler *Mang;
94
9591 /// The symbol for the current function. This is recalculated at the beginning
9692 /// of each call to runOnMachineFunction().
9793 ///
150150 assert((MI->getOpcode() == Lanai::CALL || MI->getOpcode() == Lanai::CALLR) &&
151151 "Unsupported call function");
152152
153 LanaiMCInstLower MCInstLowering(OutContext, *Mang, *this);
153 LanaiMCInstLower MCInstLowering(OutContext, *this);
154154 MCSubtargetInfo STI = getSubtargetInfo();
155155 // Insert save rca instruction immediately before the call.
156156 // TODO: We should generate a pc-relative mov instruction here instead
187187 }
188188
189189 void LanaiAsmPrinter::customEmitInstruction(const MachineInstr *MI) {
190 LanaiMCInstLower MCInstLowering(OutContext, *Mang, *this);
190 LanaiMCInstLower MCInstLowering(OutContext, *this);
191191 MCSubtargetInfo STI = getSubtargetInfo();
192192 MCInst TmpInst;
193193 MCInstLowering.Lower(MI, TmpInst);
2020 #include "llvm/CodeGen/MachineBasicBlock.h"
2121 #include "llvm/CodeGen/MachineInstr.h"
2222 #include "llvm/IR/Constants.h"
23 #include "llvm/IR/Mangler.h"
2423 #include "llvm/MC/MCAsmInfo.h"
2524 #include "llvm/MC/MCContext.h"
2625 #include "llvm/MC/MCExpr.h"
3030 AsmPrinter &Printer;
3131
3232 public:
33 LanaiMCInstLower(MCContext &CTX, Mangler & /*Mang*/, AsmPrinter &AP)
34 : Ctx(CTX), Printer(AP) {}
33 LanaiMCInstLower(MCContext &CTX, AsmPrinter &AP) : Ctx(CTX), Printer(AP) {}
3534 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
3635
3736 MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
846846 // Initialize TargetLoweringObjectFile.
847847 const_cast(getObjFileLowering())
848848 .Initialize(OutContext, TM);
849
850 Mang = new Mangler();
851849
852850 // Emit header before any dwarf directives are emitted below.
853851 emitHeader(M, OS1, STI);
170170 }
171171
172172 void XCoreAsmPrinter::EmitFunctionBodyStart() {
173 MCInstLowering.Initialize(Mang, &MF->getContext());
173 MCInstLowering.Initialize(&MF->getContext());
174174 }
175175
176176 /// EmitFunctionBodyEnd - Targets can override this to emit stuff after
2424 using namespace llvm;
2525
2626 XCoreMCInstLower::XCoreMCInstLower(class AsmPrinter &asmprinter)
27 : Printer(asmprinter) {}
27 : Printer(asmprinter) {}
2828
29 void XCoreMCInstLower::Initialize(Mangler *M, MCContext *C) {
30 Mang = M;
31 Ctx = C;
32 }
29 void XCoreMCInstLower::Initialize(MCContext *C) { Ctx = C; }
3330
3431 MCOperand XCoreMCInstLower::LowerSymbolOperand(const MachineOperand &MO,
3532 MachineOperandType MOTy,
2424 class LLVM_LIBRARY_VISIBILITY XCoreMCInstLower {
2525 typedef MachineOperand::MachineOperandType MachineOperandType;
2626 MCContext *Ctx;
27 Mangler *Mang;
2827 AsmPrinter &Printer;
2928 public:
3029 XCoreMCInstLower(class AsmPrinter &asmprinter);
31 void Initialize(Mangler *mang, MCContext *C);
30 void Initialize(MCContext *C);
3231 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
3332 MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;
3433