gallivm: Pass in a MCInstrInfo to createMCInstPrinter on llvm-3.1.
authorVinson Lee <vlee@freedesktop.org>
Tue, 3 Apr 2012 05:14:15 +0000 (22:14 -0700)
committerVinson Lee <vlee@freedesktop.org>
Tue, 3 Apr 2012 17:55:45 +0000 (10:55 -0700)
llvm-3.1svn r153860 makes MCInstrInfo available to the MCInstPrinter.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_debug.cpp

index c5afff09ae6c5b89645d847ce7bf526c78409270..9cf20943339141abb6ea8770dcb9df12d6bb6bc4 100644 (file)
@@ -251,11 +251,17 @@ lp_disassemble(const void* func)
       debug_printf("error: no register info for target %s\n", Triple.c_str());
       return;
    }
+
+   OwningPtr<const MCInstrInfo> MII(T->createMCInstrInfo());
+   if (!MII) {
+      debug_printf("error: no instruction info for target %s\n", Triple.c_str());
+      return;
+   }
 #endif
 
 #if HAVE_LLVM >= 0x0301
    OwningPtr<MCInstPrinter> Printer(
-         T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MRI, *STI));
+         T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));
 #elif HAVE_LLVM == 0x0300
    OwningPtr<MCInstPrinter> Printer(
          T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *STI));