Make MCRegisterInfo available to the the MCInstPrinter.
authorJim Grosbach <grosbach@apple.com>
Mon, 5 Mar 2012 19:33:20 +0000 (19:33 +0000)
committerJim Grosbach <grosbach@apple.com>
Mon, 5 Mar 2012 19:33:20 +0000 (19:33 +0000)
Used to allow context sensitive printing of super-register or sub-register
references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152043 91177308-0d34-0410-b5e6-96231b3b80d8

27 files changed:
include/llvm/MC/MCInstPrinter.h
include/llvm/Support/TargetRegistry.h
lib/CodeGen/LLVMTargetMachine.cpp
lib/MC/MCDisassembler/Disassembler.cpp
lib/MC/MCDisassembler/EDDisassembler.cpp
lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
lib/Target/ARM/InstPrinter/ARMInstPrinter.h
lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.h
lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.cpp
lib/Target/MSP430/InstPrinter/MSP430InstPrinter.h
lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp
lib/Target/Mips/InstPrinter/MipsInstPrinter.h
lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
lib/Target/PTX/InstPrinter/PTXInstPrinter.cpp
lib/Target/PTX/InstPrinter/PTXInstPrinter.h
lib/Target/PTX/MCTargetDesc/PTXMCTargetDesc.cpp
lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h
lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
tools/llvm-mc/Disassembler.cpp
tools/llvm-mc/llvm-mc.cpp
tools/llvm-objdump/MachODump.cpp
tools/llvm-objdump/llvm-objdump.cpp

index 01ad2d3f8088247d2f6f3653513073057fd5f8eb..4d2adfa475c55492bcc40e195e681d34e82e47ec 100644 (file)
@@ -14,6 +14,7 @@ namespace llvm {
 class MCInst;
 class raw_ostream;
 class MCAsmInfo;
+class MCRegisterInfo;
 class StringRef;
 
 /// MCInstPrinter - This is an instance of a target assembly language printer
@@ -25,6 +26,7 @@ protected:
   /// assembly emission is disable.
   raw_ostream *CommentStream;
   const MCAsmInfo &MAI;
+  const MCRegisterInfo &MRI;
 
   /// The current set of available features.
   unsigned AvailableFeatures;
@@ -32,8 +34,8 @@ protected:
   /// Utility function for printing annotations.
   void printAnnotation(raw_ostream &OS, StringRef Annot);
 public:
-  MCInstPrinter(const MCAsmInfo &mai)
-    : CommentStream(0), MAI(mai), AvailableFeatures(0) {}
+  MCInstPrinter(const MCAsmInfo &mai, const MCRegisterInfo &mri)
+    : CommentStream(0), MAI(mai), MRI(mri), AvailableFeatures(0) {}
 
   virtual ~MCInstPrinter();
 
index aef43b15c89c408c3bb7cfbbf9d4ba15f7ef7af1..93bdbcafeeab76e818dcba6f92967d7ba6a0046f 100644 (file)
@@ -104,6 +104,7 @@ namespace llvm {
     typedef MCInstPrinter *(*MCInstPrinterCtorTy)(const Target &T,
                                                   unsigned SyntaxVariant,
                                                   const MCAsmInfo &MAI,
+                                                  const MCRegisterInfo &MRI,
                                                   const MCSubtargetInfo &STI);
     typedef MCCodeEmitter *(*MCCodeEmitterCtorTy)(const MCInstrInfo &II,
                                                   const MCSubtargetInfo &STI,
@@ -392,10 +393,11 @@ namespace llvm {
 
     MCInstPrinter *createMCInstPrinter(unsigned SyntaxVariant,
                                        const MCAsmInfo &MAI,
+                                       const MCRegisterInfo &MRI,
                                        const MCSubtargetInfo &STI) const {
       if (!MCInstPrinterCtorFn)
         return 0;
-      return MCInstPrinterCtorFn(*this, SyntaxVariant, MAI, STI);
+      return MCInstPrinterCtorFn(*this, SyntaxVariant, MAI, MRI, STI);
     }
 
 
index f10bdb5c5c9632f3c2f85d7dafc399efa00eaa74..17633e2114dcc59646960623d817d8786bba33fd 100644 (file)
@@ -171,7 +171,8 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
   switch (FileType) {
   case CGFT_AssemblyFile: {
     MCInstPrinter *InstPrinter =
-      getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI, STI);
+      getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI,
+                                      Context->getRegisterInfo(), STI);
 
     // Create a code emitter if asked to show the encoding.
     MCCodeEmitter *MCE = 0;
index 605cf88ff2d5dbadc8ee01fbb9138f35fd4afd52..572a5a57c6767d9723edee678e64025a11835cea 100644 (file)
@@ -80,7 +80,7 @@ LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo,
   // Set up the instruction printer.
   int AsmPrinterVariant = MAI->getAssemblerDialect();
   MCInstPrinter *IP = TheTarget->createMCInstPrinter(AsmPrinterVariant,
-                                                     *MAI, *STI);
+                                                     *MAI, *MRI, *STI);
   assert(IP && "Unable to create instruction printer!");
 
   LLVMDisasmContext *DC = new LLVMDisasmContext(TripleName, DisInfo, TagType,
index b1f0e5bc03f52d3223563b47887381505809274d..4c2dae840ae718f4c162e1d4d56d2b7721653a18 100644 (file)
@@ -168,7 +168,8 @@ EDDisassembler::EDDisassembler(CPUKey &key) :
   
   InstString.reset(new std::string);
   InstStream.reset(new raw_string_ostream(*InstString));
-  InstPrinter.reset(Tgt->createMCInstPrinter(LLVMSyntaxVariant, *AsmInfo, *STI));
+  InstPrinter.reset(Tgt->createMCInstPrinter(LLVMSyntaxVariant, *AsmInfo,
+                                             *MRI, *STI));
   
   if (!InstPrinter)
     return;
index b0b1dbbefa90df02f8a17ea5e98f149fc5987a4e..cfb5b92d0c0f5907630f92647d3b78d49606ca80 100644 (file)
@@ -35,8 +35,9 @@ static unsigned translateShiftImm(unsigned imm) {
 
 
 ARMInstPrinter::ARMInstPrinter(const MCAsmInfo &MAI,
+                               const MCRegisterInfo &MRI,
                                const MCSubtargetInfo &STI) :
-  MCInstPrinter(MAI) {
+  MCInstPrinter(MAI, MRI) {
   // Initialize the set of available features.
   setAvailableFeatures(STI.getFeatureBits());
 }
index c943c9c2a3243abf474e3ef826f914e38a5c2351..3c8b6cf3051d5f4f7c68bc299972f2b335af5438 100644 (file)
@@ -23,7 +23,8 @@ class MCOperand;
 
 class ARMInstPrinter : public MCInstPrinter {
 public:
-    ARMInstPrinter(const MCAsmInfo &MAI, const MCSubtargetInfo &STI);
+  ARMInstPrinter(const MCAsmInfo &MAI, const MCRegisterInfo &MRI,
+                 const MCSubtargetInfo &STI);
 
   virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
   virtual StringRef getOpcodeName(unsigned Opcode) const;
index 32bf18cfae6aad98f582a6c7e7c6349a5771f9a0..1606b92bea2a64efe1d6c7470bf26c7dea6eab89 100644 (file)
@@ -163,9 +163,10 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
 static MCInstPrinter *createARMMCInstPrinter(const Target &T,
                                              unsigned SyntaxVariant,
                                              const MCAsmInfo &MAI,
+                                             const MCRegisterInfo &MRI,
                                              const MCSubtargetInfo &STI) {
   if (SyntaxVariant == 0)
-    return new ARMInstPrinter(MAI, STI);
+    return new ARMInstPrinter(MAI, MRI, STI);
   return 0;
 }
 
index c6f30036bc87a9921bf982ea57b16388c7dcf32a..236583a0a752eb46aa3736018c9a2b3b73e7dd5e 100644 (file)
@@ -21,8 +21,8 @@ namespace llvm {
 
   class MBlazeInstPrinter : public MCInstPrinter {
   public:
-    MBlazeInstPrinter(const MCAsmInfo &MAI)
-      : MCInstPrinter(MAI) {}
+    MBlazeInstPrinter(const MCAsmInfo &MAI, const MCRegisterInfo &MRI)
+      : MCInstPrinter(MAI, MRI) {}
 
     virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
 
index f83e8ab1859bde5c6a29133c911b3fd6e31e308e..5da0aa77a2444cef7336149c146236758d8e9bb6 100644 (file)
@@ -95,9 +95,10 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
 static MCInstPrinter *createMBlazeMCInstPrinter(const Target &T,
                                                 unsigned SyntaxVariant,
                                                 const MCAsmInfo &MAI,
+                                                const MCRegisterInfo &MRI,
                                                 const MCSubtargetInfo &STI) {
   if (SyntaxVariant == 0)
-    return new MBlazeInstPrinter(MAI);
+    return new MBlazeInstPrinter(MAI, MRI);
   return 0;
 }
 
index 6f95ca35faeb70d9f80b64e0225a37f0d4f019b1..3fd7ce0164f1ef53f5ec6f98ccd9b11e2103f027 100644 (file)
@@ -21,8 +21,8 @@ namespace llvm {
 
   class MSP430InstPrinter : public MCInstPrinter {
   public:
-    MSP430InstPrinter(const MCAsmInfo &MAI)
-        : MCInstPrinter(MAI) {}
+    MSP430InstPrinter(const MCAsmInfo &MAI, const MCRegisterInfo &MRI)
+        : MCInstPrinter(MAI, MRI) {}
 
     virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
 
index 22cc33ab66162ad47e074577f46e8701625d5ff4..85450552d37a208b6fe3b42fa1da5b2df6bc538e 100644 (file)
@@ -61,9 +61,10 @@ static MCCodeGenInfo *createMSP430MCCodeGenInfo(StringRef TT, Reloc::Model RM,
 static MCInstPrinter *createMSP430MCInstPrinter(const Target &T,
                                                 unsigned SyntaxVariant,
                                                 const MCAsmInfo &MAI,
+                                                const MCRegisterInfo &MRI,
                                                 const MCSubtargetInfo &STI) {
   if (SyntaxVariant == 0)
-    return new MSP430InstPrinter(MAI);
+    return new MSP430InstPrinter(MAI, MRI);
   return 0;
 }
 
index 931c44bc5f5512ea200cc654d9a43e5de8dcc796..acd761d8c0f270d90c11d380acf06663409e1dd4 100644 (file)
@@ -77,7 +77,8 @@ class TargetMachine;
 
 class MipsInstPrinter : public MCInstPrinter {
 public:
-  MipsInstPrinter(const MCAsmInfo &MAI) : MCInstPrinter(MAI) {}
+  MipsInstPrinter(const MCAsmInfo &MAI, const MCRegisterInfo &MRI) :
+    MCInstPrinter(MAI, MRI) {}
 
   // Autogenerated by tblgen.
   void printInstruction(const MCInst *MI, raw_ostream &O);
index 0a2dadd69e7b69acad5482e62bfdb36fc123babd..76526754be7d2a1a272e8026594ff2e258d81320 100644 (file)
@@ -76,8 +76,9 @@ static MCCodeGenInfo *createMipsMCCodeGenInfo(StringRef TT, Reloc::Model RM,
 static MCInstPrinter *createMipsMCInstPrinter(const Target &T,
                                               unsigned SyntaxVariant,
                                               const MCAsmInfo &MAI,
+                                              const MCRegisterInfo &MRI,
                                               const MCSubtargetInfo &STI) {
-  return new MipsInstPrinter(MAI);
+  return new MipsInstPrinter(MAI, MRI);
 }
 
 static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
index 815c503efb9ecfdf5da7ae296c7ba01db78792e0..ec7e2a75eaa46b9f2747890bdf41904a1bcf6dd4 100644 (file)
@@ -27,8 +27,9 @@ using namespace llvm;
 #include "PTXGenAsmWriter.inc"
 
 PTXInstPrinter::PTXInstPrinter(const MCAsmInfo &MAI,
+                               const MCRegisterInfo &MRI,
                                const MCSubtargetInfo &STI) :
-  MCInstPrinter(MAI) {
+  MCInstPrinter(MAI, MRI) {
   // Initialize the set of available features.
   setAvailableFeatures(STI.getFeatureBits());
 }
index 8c74097d145cd6eedef3da4ec85f39369ebbcd35..eef61010bced522b61eace86f0baf35a7745f574 100644 (file)
@@ -23,7 +23,8 @@ class MCOperand;
 
 class PTXInstPrinter : public MCInstPrinter {
 public:
-  PTXInstPrinter(const MCAsmInfo &MAI, const MCSubtargetInfo &STI);
+  PTXInstPrinter(const MCAsmInfo &MAI, const MCRegisterInfo &MRI,
+                 const MCSubtargetInfo &STI);
 
   virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
   virtual StringRef getOpcodeName(unsigned Opcode) const;
index 035952eab3441ae0abc55c08d7eddf3ccaeb75a9..7671b11a0958306bb21f4460f2a9ee3fdd0d761e 100644 (file)
@@ -62,9 +62,10 @@ static MCCodeGenInfo *createPTXMCCodeGenInfo(StringRef TT, Reloc::Model RM,
 static MCInstPrinter *createPTXMCInstPrinter(const Target &T,
                                              unsigned SyntaxVariant,
                                              const MCAsmInfo &MAI,
+                                             const MCRegisterInfo &MRI,
                                              const MCSubtargetInfo &STI) {
   assert(SyntaxVariant == 0 && "We only have one syntax variant");
-  return new PTXInstPrinter(MAI, STI);
+  return new PTXInstPrinter(MAI, MRI, STI);
 }
 
 extern "C" void LLVMInitializePTXTargetMC() {
index 6863183075cc3928668d313153d02f73df8f7fc6..21fc73310aae2ba829176ad54b7f5ec47e8f33d6 100644 (file)
@@ -24,8 +24,9 @@ class PPCInstPrinter : public MCInstPrinter {
   // 0 -> AIX, 1 -> Darwin.
   unsigned SyntaxVariant;
 public:
-  PPCInstPrinter(const MCAsmInfo &MAI, unsigned syntaxVariant)
-    : MCInstPrinter(MAI), SyntaxVariant(syntaxVariant) {}
+  PPCInstPrinter(const MCAsmInfo &MAI, const MCRegisterInfo &MRI,
+                 unsigned syntaxVariant)
+    : MCInstPrinter(MAI, MRI), SyntaxVariant(syntaxVariant) {}
   
   bool isDarwinSyntax() const {
     return SyntaxVariant == 1;
index a46069f2d8d1e6ee544bbe69658ee8a024d99fbc..226fbfe4000466ce7cc8ad36793706089c980b2e 100644 (file)
@@ -108,8 +108,9 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
 static MCInstPrinter *createPPCMCInstPrinter(const Target &T,
                                              unsigned SyntaxVariant,
                                              const MCAsmInfo &MAI,
+                                             const MCRegisterInfo &MRI,
                                              const MCSubtargetInfo &STI) {
-  return new PPCInstPrinter(MAI, SyntaxVariant);
+  return new PPCInstPrinter(MAI, MRI, SyntaxVariant);
 }
 
 extern "C" void LLVMInitializePowerPCTargetMC() {
index 2edabf84b6f5f18b4059a4c286fde1648cc1ed95..b7ccb4c09b2dc0502ac45778ee2b59322c0d55b4 100644 (file)
@@ -30,10 +30,6 @@ using namespace llvm;
 #define PRINT_ALIAS_INSTR
 #include "X86GenAsmWriter.inc"
 
-X86ATTInstPrinter::X86ATTInstPrinter(const MCAsmInfo &MAI)
-  : MCInstPrinter(MAI) {
-}
-
 void X86ATTInstPrinter::printRegName(raw_ostream &OS,
                                      unsigned RegNo) const {
   OS << '%' << getRegisterName(RegNo);
index 3d56bb3a9d9831bef5769a49e1f6513a295cc701..ff94301a242e3e84400a726f9f58bc00e4f2575e 100644 (file)
@@ -22,8 +22,9 @@ class MCOperand;
   
 class X86ATTInstPrinter : public MCInstPrinter {
 public:
-  X86ATTInstPrinter(const MCAsmInfo &MAI);
-  
+  X86ATTInstPrinter(const MCAsmInfo &MAI, const MCRegisterInfo &MRI)
+    : MCInstPrinter(MAI, MRI) {}
+
   virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
   virtual void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot);
   virtual StringRef getOpcodeName(unsigned Opcode) const;
index 82839a28eee39256c2e1e46e027969e0bb44161a..ea1d38a1f40748560d9f909c0ee96509949d160a 100644 (file)
@@ -23,8 +23,8 @@ class MCOperand;
   
 class X86IntelInstPrinter : public MCInstPrinter {
 public:
-  X86IntelInstPrinter(const MCAsmInfo &MAI)
-    : MCInstPrinter(MAI) {}
+  X86IntelInstPrinter(const MCAsmInfo &MAI, const MCRegisterInfo &MRI)
+    : MCInstPrinter(MAI, MRI) {}
 
   virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
   virtual void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot);
index 38c3401c73ceb8cfecc88bea2518cc2fba5005ba..efd18c7eefeb5b6c94da3afa94b1bfe4a95821aa 100644 (file)
@@ -474,11 +474,12 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
 static MCInstPrinter *createX86MCInstPrinter(const Target &T,
                                              unsigned SyntaxVariant,
                                              const MCAsmInfo &MAI,
+                                             const MCRegisterInfo &MRI,
                                              const MCSubtargetInfo &STI) {
   if (SyntaxVariant == 0)
-    return new X86ATTInstPrinter(MAI);
+    return new X86ATTInstPrinter(MAI, MRI);
   if (SyntaxVariant == 1)
-    return new X86IntelInstPrinter(MAI);
+    return new X86IntelInstPrinter(MAI, MRI);
   return 0;
 }
 
index 8114580cb94456180c901f9716a2b2a4783d64d8..6793d7ef856f5b14f2b536e693556591863e0dc8 100644 (file)
@@ -21,6 +21,7 @@
 #include "llvm/MC/MCDisassembler.h"
 #include "llvm/MC/MCInst.h"
 #include "llvm/MC/MCInstPrinter.h"
+#include "llvm/MC/MCRegisterInfo.h"
 #include "llvm/MC/MCSubtargetInfo.h"
 #include "llvm/ADT/OwningPtr.h"
 #include "llvm/ADT/Triple.h"
@@ -160,16 +161,22 @@ int Disassembler::disassemble(const Target &T,
     errs() << "error: no subtarget info for target " << Triple << "\n";
     return -1;
   }
-  
+
   OwningPtr<const MCDisassembler> DisAsm(T.createMCDisassembler(*STI));
   if (!DisAsm) {
     errs() << "error: no disassembler for target " << Triple << "\n";
     return -1;
   }
 
+  OwningPtr<const MCRegisterInfo> MRI(T.createMCRegInfo(Triple));
+  if (!MRI) {
+    errs() << "error: no register info for target " << Triple << "\n";
+    return -1;
+  }
+
   int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
   OwningPtr<MCInstPrinter> IP(T.createMCInstPrinter(AsmPrinterVariant,
-                                                    *AsmInfo, *STI));
+                                                    *AsmInfo, *MRI, *STI));
   if (!IP) {
     errs() << "error: no instruction printer for target " << Triple << '\n';
     return -1;
index f2365c67611466daab3931156452c2feeb9f8085..dc7297412d65d3b572126f5c16245e1556661b4a 100644 (file)
@@ -416,7 +416,7 @@ static int AssembleInput(const char *ProgName) {
   // FIXME: There is a bit of code duplication with addPassesToEmitFile.
   if (FileType == OFT_AssemblyFile) {
     MCInstPrinter *IP =
-      TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *STI);
+      TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *MRI, *STI);
     MCCodeEmitter *CE = 0;
     MCAsmBackend *MAB = 0;
     if (ShowEncoding) {
index 272dedf3ef44b95d18c721f89d581c9cb82c9273..b9ea041aa3f4f1f20968230f72359876ced86873 100644 (file)
@@ -26,6 +26,7 @@
 #include "llvm/MC/MCInstrAnalysis.h"
 #include "llvm/MC/MCInstrDesc.h"
 #include "llvm/MC/MCInstrInfo.h"
+#include "llvm/MC/MCRegisterInfo.h"
 #include "llvm/MC/MCSubtargetInfo.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
@@ -257,9 +258,10 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
   OwningPtr<const MCSubtargetInfo>
     STI(TheTarget->createMCSubtargetInfo(TripleName, "", ""));
   OwningPtr<const MCDisassembler> DisAsm(TheTarget->createMCDisassembler(*STI));
+  OwningPtr<const MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
   int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
   OwningPtr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
-                              AsmPrinterVariant, *AsmInfo, *STI));
+                              AsmPrinterVariant, *AsmInfo, *MRI, *STI));
 
   if (!InstrAnalysis || !AsmInfo || !STI || !DisAsm || !IP) {
     errs() << "error: couldn't initialize disassembler for target "
index e848d6b5b389adf1c5b46c33f47a32345bce1c5d..deb4dd1fcbcf37e71af35cbd7dd438f80734e178 100644 (file)
@@ -26,6 +26,7 @@
 #include "llvm/MC/MCDisassembler.h"
 #include "llvm/MC/MCInst.h"
 #include "llvm/MC/MCInstPrinter.h"
+#include "llvm/MC/MCRegisterInfo.h"
 #include "llvm/MC/MCSubtargetInfo.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/CommandLine.h"
@@ -246,9 +247,15 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
       return;
     }
 
+    OwningPtr<const MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
+    if (!MRI) {
+      errs() << "error: no register info for target " << TripleName << "\n";
+      return;
+    }
+
     int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
     OwningPtr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
-                                AsmPrinterVariant, *AsmInfo, *STI));
+                                AsmPrinterVariant, *AsmInfo, *MRI, *STI));
     if (!IP) {
       errs() << "error: no instruction printer for target " << TripleName
              << '\n';