]> granicus.if.org Git - llvm/commitdiff
The AsmPrinter has a Mangler. Use it.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 29 Oct 2013 16:18:15 +0000 (16:18 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 29 Oct 2013 16:18:15 +0000 (16:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193617 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SystemZ/SystemZAsmPrinter.cpp
lib/Target/SystemZ/SystemZMCInstLower.cpp
lib/Target/SystemZ/SystemZMCInstLower.h

index d81180cd345bc3157b1e1cad931033caef6c9e5f..568c44b30b7313182566c829b22b8c41bcf26fba 100644 (file)
@@ -57,7 +57,7 @@ static MCInst lowerRIEfLow(const MachineInstr *MI, unsigned Opcode) {
 }
 
 void SystemZAsmPrinter::EmitInstruction(const MachineInstr *MI) {
-  SystemZMCInstLower Lower(Mang, MF->getContext(), *this);
+  SystemZMCInstLower Lower(MF->getContext(), *this);
   MCInst LoweredMI;
   switch (MI->getOpcode()) {
   case SystemZ::Return:
@@ -178,7 +178,7 @@ bool SystemZAsmPrinter::PrintAsmOperand(const MachineInstr *MI,
       return true;
     OS << -int64_t(MI->getOperand(OpNo).getImm());
   } else {
-    SystemZMCInstLower Lower(Mang, MF->getContext(), *this);
+    SystemZMCInstLower Lower(MF->getContext(), *this);
     MCOperand MO(Lower.lowerOperand(MI->getOperand(OpNo)));
     SystemZInstPrinter::printOperand(MO, OS);
   }
index ebf043e007d7e811cf48a1921642c78afe2abd82..0f46ad290362cd6fbcc7f3041b3b9848840c29bb 100644 (file)
@@ -26,9 +26,9 @@ static MCSymbolRefExpr::VariantKind getVariantKind(unsigned Flags) {
   llvm_unreachable("Unrecognised MO_ACCESS_MODEL");
 }
 
-SystemZMCInstLower::SystemZMCInstLower(Mangler *mang, MCContext &ctx,
+SystemZMCInstLower::SystemZMCInstLower(MCContext &ctx,
                                        SystemZAsmPrinter &asmprinter)
-  : Mang(mang), Ctx(ctx), AsmPrinter(asmprinter) {}
+  : Ctx(ctx), AsmPrinter(asmprinter) {}
 
 const MCExpr *
 SystemZMCInstLower::getExpr(const MachineOperand &MO,
@@ -42,7 +42,7 @@ SystemZMCInstLower::getExpr(const MachineOperand &MO,
     break;
 
   case MachineOperand::MO_GlobalAddress:
-    Symbol = Mang->getSymbol(MO.getGlobal());
+    Symbol = AsmPrinter.Mang->getSymbol(MO.getGlobal());
     break;
 
   case MachineOperand::MO_ExternalSymbol:
index 33a849d6c77e0715f356e5eb6feb6897fbb76f26..f6d5ac8c285d22d816d87d144bc7939fb5a178a9 100644 (file)
@@ -23,13 +23,11 @@ class Mangler;
 class SystemZAsmPrinter;
 
 class LLVM_LIBRARY_VISIBILITY SystemZMCInstLower {
-  Mangler *Mang;
   MCContext &Ctx;
   SystemZAsmPrinter &AsmPrinter;
 
 public:
-  SystemZMCInstLower(Mangler *mang, MCContext &ctx,
-                     SystemZAsmPrinter &asmPrinter);
+  SystemZMCInstLower(MCContext &ctx, SystemZAsmPrinter &asmPrinter);
 
   // Lower MachineInstr MI to MCInst OutMI.
   void lower(const MachineInstr *MI, MCInst &OutMI) const;