diff options
author | Roland Scheidegger <sroland@vmware.com> | 2014-04-16 03:46:20 +0200 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2014-04-16 19:57:47 +0200 |
commit | f23d1160c24e16ced319d838ed3102b731c2ff03 (patch) | |
tree | eed58dc21bd67f94b290113a06cb130163ab3c1b /src/gallium/auxiliary | |
parent | e3c58cdfd97d390cb4c1a02852ab0417bd68c861 (diff) | |
download | external_mesa3d-f23d1160c24e16ced319d838ed3102b731c2ff03.zip external_mesa3d-f23d1160c24e16ced319d838ed3102b731c2ff03.tar.gz external_mesa3d-f23d1160c24e16ced319d838ed3102b731c2ff03.tar.bz2 |
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 <thomas.stellard@amd.com>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp index 1c886ea..541cf9e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp @@ -60,6 +60,10 @@ #include <llvm/ADT/OwningPtr.h> #endif +#if HAVE_LLVM >= 0x0305 +#include <llvm/MC/MCContext.h> +#endif + #include "util/u_math.h" #include "util/u_debug.h" @@ -226,17 +230,6 @@ disassemble(const void* func, llvm::raw_ostream & Out) } #if HAVE_LLVM >= 0x0300 - const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), ""); - OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler(*STI)); -#else - OwningPtr<const MCDisassembler> 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 int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); @@ -256,6 +249,22 @@ disassemble(const void* func, llvm::raw_ostream & Out) } #endif +#if HAVE_LLVM >= 0x0305 + OwningPtr<const MCSubtargetInfo> STI(T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), "")); + OwningPtr<MCContext> MCCtx(new MCContext(AsmInfo.get(), MRI.get(), 0)); + OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler(*STI, *MCCtx)); +#elif HAVE_LLVM >= 0x0300 + const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), ""); + OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler(*STI)); +#else + OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler()); +#endif + if (!DisAsm) { + Out << "error: no disassembler for target " << Triple << "\n"; + return 0; + } + + #if HAVE_LLVM >= 0x0301 OwningPtr<MCInstPrinter> Printer( T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI)); |