From: Roland Scheidegger Date: Wed, 16 Apr 2014 01:46:20 +0000 (+0200) Subject: gallivm: fix compilation with llvm 3.5 r206241+ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f23d1160c24e16ced319d838ed3102b731c2ff03;p=mesa.git gallivm: fix compilation with llvm 3.5 r206241+ Just adjust to the ever-changing API, pass in MCContext when creating the MCDisassembler. Reviewed-by: Tom Stellard --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp index 1c886eaf1da..541cf9ec2d3 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp @@ -60,6 +60,10 @@ #include #endif +#if HAVE_LLVM >= 0x0305 +#include +#endif + #include "util/u_math.h" #include "util/u_debug.h" @@ -225,17 +229,6 @@ disassemble(const void* func, llvm::raw_ostream & Out) return 0; } -#if HAVE_LLVM >= 0x0300 - const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), ""); - OwningPtr DisAsm(T->createMCDisassembler(*STI)); -#else - OwningPtr DisAsm(T->createMCDisassembler()); -#endif - if (!DisAsm) { - Out << "error: no disassembler for target " << Triple << "\n"; - return 0; - } - #if HAVE_LLVM >= 0x0300 unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); #else @@ -256,6 +249,22 @@ disassemble(const void* func, llvm::raw_ostream & Out) } #endif +#if HAVE_LLVM >= 0x0305 + OwningPtr STI(T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), "")); + OwningPtr MCCtx(new MCContext(AsmInfo.get(), MRI.get(), 0)); + OwningPtr DisAsm(T->createMCDisassembler(*STI, *MCCtx)); +#elif HAVE_LLVM >= 0x0300 + const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), ""); + OwningPtr DisAsm(T->createMCDisassembler(*STI)); +#else + OwningPtr DisAsm(T->createMCDisassembler()); +#endif + if (!DisAsm) { + Out << "error: no disassembler for target " << Triple << "\n"; + return 0; + } + + #if HAVE_LLVM >= 0x0301 OwningPtr Printer( T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));