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>
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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<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
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user