From 973221968117c50b141b700350d2e83befff4fce Mon Sep 17 00:00:00 2001 From: ojab Date: Sat, 10 Sep 2011 19:23:20 +0400 Subject: [PATCH] gallivm: fix build with LLVM 3.0svn LLVM 3.0svn refactored instprinter and mcdisassembler to take a SubtargetInfo. See revision 139237 of LLVM. --- src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp index 401e0e2..b8a97da 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp @@ -210,11 +210,20 @@ lp_disassemble(const void* func) return; } +#if HAVE_LLVM >= 0x0300 + const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple.c_str(), "", ""); + if (!STI) { + debug_printf("error: no subtarget info for target %s\n", Triple.c_str()); + return; + } + OwningPtr DisAsm(T->createMCDisassembler(*STI)); +#else OwningPtr DisAsm(T->createMCDisassembler()); if (!DisAsm) { debug_printf("error: no disassembler for target %s\n", Triple.c_str()); return; } +#endif raw_debug_ostream Out; @@ -223,7 +232,10 @@ lp_disassemble(const void* func) #else int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); #endif -#if HAVE_LLVM >= 0x0208 +#if HAVE_LLVM >= 0x0300 + OwningPtr Printer( + T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *STI)); +#elif HAVE_LLVM >= 0x0208 OwningPtr Printer( T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo)); #else -- 1.7.6