gallivm: Fix build with llvm-2.9
authorTobias Droste <tdroste@gmx.de>
Sun, 27 Mar 2011 15:11:14 +0000 (08:11 -0700)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 28 Mar 2011 16:23:45 +0000 (17:23 +0100)
In llvm-2.9 Target->createMCInstPrinter() takes different arguments

Signed-off-by: Tobias Droste <tdroste@gmx.de>
src/gallium/auxiliary/gallivm/lp_bld_debug.cpp

index 1f24cb6f572202551c31e098d98ebe874f565c8b..76d63ced2de6dfeb063bfd0104121898c6e2c5b4 100644 (file)
@@ -207,9 +207,17 @@ lp_disassemble(const void* func)
    }
 
    raw_debug_ostream Out;
+   TargetMachine *TM = T->createTargetMachine(Triple, "");
 
+#if HAVE_LLVM >= 0x0209
+   unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
+#else
    int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
-#if HAVE_LLVM >= 0x0208
+#endif
+#if HAVE_LLVM >= 0x0209
+   OwningPtr<MCInstPrinter> Printer(
+         T->createMCInstPrinter(*TM, AsmPrinterVariant, *AsmInfo));
+#elif HAVE_LLVM >= 0x0208
    OwningPtr<MCInstPrinter> Printer(
          T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo));
 #else
@@ -221,8 +229,6 @@ lp_disassemble(const void* func)
       return;
    }
 
-   TargetMachine *TM = T->createTargetMachine(Triple, "");
-
    const TargetInstrInfo *TII = TM->getInstrInfo();
 
    /*