gallivm: Pass in a MCRegisterInfo to MCInstPrinter on llvm-3.1.
authorVinson Lee <vlee@freedesktop.org>
Tue, 6 Mar 2012 06:00:40 +0000 (22:00 -0800)
committerVinson Lee <vlee@freedesktop.org>
Tue, 6 Mar 2012 18:31:12 +0000 (10:31 -0800)
llvm-3.1svn r152043 changes createMCInstPrinter to take an additional
MCRegisterInfo argument.

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

index 11209da78ef5551456d8b67ad31da795e837a18f..b6849cbdcab393f2e7cb88e2f2b9ef50a9237e51 100644 (file)
@@ -243,7 +243,18 @@ lp_disassemble(const void* func)
    int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
 #endif
 
-#if HAVE_LLVM >= 0x0300
+#if HAVE_LLVM >= 0x0301
+   OwningPtr<const MCRegisterInfo> MRI(T->createMCRegInfo(Triple));
+   if (!MRI) {
+      debug_printf("error: no register info for target %s\n", Triple.c_str());
+      return;
+   }
+#endif
+
+#if HAVE_LLVM >= 0x0301
+   OwningPtr<MCInstPrinter> Printer(
+         T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MRI, *STI));
+#elif HAVE_LLVM == 0x0300
    OwningPtr<MCInstPrinter> Printer(
          T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *STI));
 #elif HAVE_LLVM >= 0x0208