From 9cf67e51b06b4b136d03e642b18b4a4e36a1dabb Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 8 May 2014 13:25:28 +0100 Subject: gallivm,draw,llvmpipe: Remove support for versions of LLVM prior to 3.1. Older versions haven't been tested probably don't work anyway. But more importantly, code supporting it is hindering further work. Reviewed-by: Roland Scheidegger --- src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 75 ++------------------------ 1 file changed, 3 insertions(+), 72 deletions(-) (limited to 'src/gallium/auxiliary/gallivm/lp_bld_debug.cpp') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp index 7e43b514b66..85953a225b9 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp @@ -34,28 +34,16 @@ #include #include -#if HAVE_LLVM >= 0x0300 #include #include -#else /* HAVE_LLVM < 0x0300 */ -#include -#endif /* HAVE_LLVM < 0x0300 */ -#if HAVE_LLVM >= 0x0209 #include -#else /* HAVE_LLVM < 0x0209 */ -#include -#endif /* HAVE_LLVM < 0x0209 */ -#if HAVE_LLVM >= 0x0207 #include #include #include #include -#endif /* HAVE_LLVM >= 0x0207 */ -#if HAVE_LLVM >= 0x0301 #include -#endif /* HAVE_LLVM >= 0x0301 */ #if HAVE_LLVM >= 0x0303 #include @@ -104,13 +92,8 @@ public: void write_impl(const char *Ptr, size_t Size); -#if HAVE_LLVM >= 0x207 uint64_t current_pos() const { return pos; } size_t preferred_buffer_size() const { return 512; } -#else - uint64_t current_pos() { return pos; } - size_t preferred_buffer_size() { return 512; } -#endif }; @@ -144,7 +127,6 @@ lp_debug_dump_value(LLVMValueRef value) } -#if HAVE_LLVM >= 0x0207 /* * MemoryObject wrapper around a buffer of memory, to be used by MC * disassembler. @@ -179,7 +161,6 @@ public: return 0; } }; -#endif /* HAVE_LLVM >= 0x0207 */ /* @@ -192,7 +173,6 @@ public: static size_t disassemble(const void* func, llvm::raw_ostream & Out) { -#if HAVE_LLVM >= 0x0207 using namespace llvm; const uint8_t *bytes = (const uint8_t *)func; @@ -208,21 +188,15 @@ disassemble(const void* func, llvm::raw_ostream & Out) * Initialize all used objects. */ -#if HAVE_LLVM >= 0x0301 std::string Triple = sys::getDefaultTargetTriple(); -#else - std::string Triple = sys::getHostTriple(); -#endif std::string Error; const Target *T = TargetRegistry::lookupTarget(Triple, Error); #if HAVE_LLVM >= 0x0304 OwningPtr AsmInfo(T->createMCAsmInfo(*T->createMCRegInfo(Triple), Triple)); -#elif HAVE_LLVM >= 0x0300 - OwningPtr AsmInfo(T->createMCAsmInfo(Triple)); #else - OwningPtr AsmInfo(T->createAsmInfo(Triple)); + OwningPtr AsmInfo(T->createMCAsmInfo(Triple)); #endif if (!AsmInfo) { @@ -230,13 +204,8 @@ disassemble(const void* func, llvm::raw_ostream & Out) return 0; } -#if HAVE_LLVM >= 0x0300 unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); -#else - int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); -#endif -#if HAVE_LLVM >= 0x0301 OwningPtr MRI(T->createMCRegInfo(Triple)); if (!MRI) { Out << "error: no register info for target " << Triple.c_str() << "\n"; @@ -248,17 +217,14 @@ disassemble(const void* func, llvm::raw_ostream & Out) Out << "error: no instruction info for target " << Triple.c_str() << "\n"; return 0; } -#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 +#else OwningPtr 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"; @@ -266,25 +232,13 @@ disassemble(const void* func, llvm::raw_ostream & Out) } -#if HAVE_LLVM >= 0x0301 OwningPtr Printer( T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI)); -#elif HAVE_LLVM == 0x0300 - OwningPtr Printer( - T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *STI)); -#elif HAVE_LLVM >= 0x0208 - OwningPtr Printer( - T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo)); -#else - OwningPtr Printer( - T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, Out)); -#endif if (!Printer) { Out << "error: no instruction printer for target " << Triple.c_str() << "\n"; return 0; } -#if HAVE_LLVM >= 0x0301 TargetOptions options; #if defined(DEBUG) options.JITEmitDebugInfo = true; @@ -296,11 +250,6 @@ disassemble(const void* func, llvm::raw_ostream & Out) options.NoFramePointerElim = true; #endif OwningPtr TM(T->createTargetMachine(Triple, sys::getHostCPUName(), "", options)); -#elif HAVE_LLVM == 0x0300 - OwningPtr TM(T->createTargetMachine(Triple, sys::getHostCPUName(), "")); -#else - OwningPtr TM(T->createTargetMachine(Triple, "")); -#endif const TargetInstrInfo *TII = TM->getInstrInfo(); @@ -324,11 +273,7 @@ disassemble(const void* func, llvm::raw_ostream & Out) if (!DisAsm->getInstruction(Inst, Size, memoryObject, pc, -#if HAVE_LLVM >= 0x0300 nulls(), nulls())) { -#else - nulls())) { -#endif Out << "invalid"; pc += 1; } @@ -350,13 +295,7 @@ disassemble(const void* func, llvm::raw_ostream & Out) /* * Print the instruction. */ -#if HAVE_LLVM >= 0x0300 - Printer->printInst(&Inst, Out, ""); -#elif HAVE_LLVM >= 0x208 - Printer->printInst(&Inst, Out); -#else - Printer->printInst(&Inst); -#endif + Printer->printInst(&Inst, Out, ""); /* * Advance. @@ -364,11 +303,7 @@ disassemble(const void* func, llvm::raw_ostream & Out) pc += Size; -#if HAVE_LLVM >= 0x0300 const MCInstrDesc &TID = TII->get(Inst.getOpcode()); -#else - const TargetInstrDesc &TID = TII->get(Inst.getOpcode()); -#endif /* * Keep track of forward jumps to a nearby address. @@ -445,10 +380,6 @@ disassemble(const void* func, llvm::raw_ostream & Out) Out.flush(); return pc; -#else /* HAVE_LLVM < 0x0207 */ - (void)func; - return 0; -#endif /* HAVE_LLVM < 0x0207 */ } -- cgit v1.2.3