The asm printer has a mangler. Use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193618 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-10-29 16:24:21 +00:00
parent 8eff5d998e
commit a300b1cc29
3 changed files with 4 additions and 7 deletions

View File

@ -284,7 +284,7 @@ void MipsAsmPrinter::EmitFunctionEntryLabel() {
/// EmitFunctionBodyStart - Targets can override this to emit stuff before /// EmitFunctionBodyStart - Targets can override this to emit stuff before
/// the first basic block in the function. /// the first basic block in the function.
void MipsAsmPrinter::EmitFunctionBodyStart() { void MipsAsmPrinter::EmitFunctionBodyStart() {
MCInstLowering.Initialize(Mang, &MF->getContext()); MCInstLowering.Initialize(&MF->getContext());
bool IsNakedFunction = bool IsNakedFunction =
MF->getFunction()-> MF->getFunction()->

View File

@ -28,8 +28,7 @@ using namespace llvm;
MipsMCInstLower::MipsMCInstLower(MipsAsmPrinter &asmprinter) MipsMCInstLower::MipsMCInstLower(MipsAsmPrinter &asmprinter)
: AsmPrinter(asmprinter) {} : AsmPrinter(asmprinter) {}
void MipsMCInstLower::Initialize(Mangler *M, MCContext *C) { void MipsMCInstLower::Initialize(MCContext *C) {
Mang = M;
Ctx = C; Ctx = C;
} }
@ -74,7 +73,7 @@ MCOperand MipsMCInstLower::LowerSymbolOperand(const MachineOperand &MO,
break; break;
case MachineOperand::MO_GlobalAddress: case MachineOperand::MO_GlobalAddress:
Symbol = Mang->getSymbol(MO.getGlobal()); Symbol = AsmPrinter.Mang->getSymbol(MO.getGlobal());
Offset += MO.getOffset(); Offset += MO.getOffset();
break; break;

View File

@ -19,7 +19,6 @@ namespace llvm {
class MCOperand; class MCOperand;
class MachineInstr; class MachineInstr;
class MachineFunction; class MachineFunction;
class Mangler;
class MipsAsmPrinter; class MipsAsmPrinter;
/// MipsMCInstLower - This class is used to lower an MachineInstr into an /// MipsMCInstLower - This class is used to lower an MachineInstr into an
@ -27,11 +26,10 @@ namespace llvm {
class LLVM_LIBRARY_VISIBILITY MipsMCInstLower { class LLVM_LIBRARY_VISIBILITY MipsMCInstLower {
typedef MachineOperand::MachineOperandType MachineOperandType; typedef MachineOperand::MachineOperandType MachineOperandType;
MCContext *Ctx; MCContext *Ctx;
Mangler *Mang;
MipsAsmPrinter &AsmPrinter; MipsAsmPrinter &AsmPrinter;
public: public:
MipsMCInstLower(MipsAsmPrinter &asmprinter); MipsMCInstLower(MipsAsmPrinter &asmprinter);
void Initialize(Mangler *mang, MCContext *C); void Initialize(MCContext *C);
void Lower(const MachineInstr *MI, MCInst &OutMI) const; void Lower(const MachineInstr *MI, MCInst &OutMI) const;
MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const; MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;