From: Francisco Jerez Date: Tue, 28 Jun 2016 06:24:59 +0000 (-0700) Subject: clover/llvm: Drop support for LLVM < 3.6. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=600ac51448f0dc62808e962a206d11e1b179a32f;p=mesa.git clover/llvm: Drop support for LLVM < 3.6. Reviewed-by: Serge Martin Tested-by: Jan Vesely --- diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 44c7e1eb2c9..4d0f0f8a10d 100644 --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp @@ -219,13 +219,8 @@ namespace { s_log, &c.getDiagnosticOpts())); -#if HAVE_LLVM >= 0x0306 c.getPreprocessorOpts().addRemappedFile(name, llvm::MemoryBuffer::getMemBuffer(source).release()); -#else - c.getPreprocessorOpts().addRemappedFile(name, - llvm::MemoryBuffer::getMemBuffer(source)); -#endif if (headers.size()) { const std::string tmp_header_path = "/tmp/clover/"; @@ -239,11 +234,7 @@ namespace { it != headers.end(); ++it) { const std::string path = tmp_header_path + std::string(it->first); c.getPreprocessorOpts().addRemappedFile(path, -#if HAVE_LLVM >= 0x0306 llvm::MemoryBuffer::getMemBuffer(it->second.c_str()).release()); -#else - llvm::MemoryBuffer::getMemBuffer(it->second.c_str())); -#endif } } @@ -273,11 +264,7 @@ namespace { memcpy(address_spaces, c.getTarget().getAddressSpaceMap(), sizeof(address_spaces)); -#if HAVE_LLVM >= 0x0306 return act.takeModule().release(); -#else - return act.takeModule(); -#endif } std::vector @@ -302,11 +289,7 @@ namespace { kernels.reserve(kernel_node->getNumOperands()); for (unsigned i = 0; i < kernel_node->getNumOperands(); ++i) { -#if HAVE_LLVM >= 0x0306 kernels.push_back(llvm::mdconst::dyn_extract( -#else - kernels.push_back(llvm::dyn_cast( -#endif kernel_node->getOperand(i)->getOperand(0))); } return kernels; @@ -354,9 +337,7 @@ namespace { export_list.push_back(kernel->getName().data()); } #endif -#if HAVE_LLVM < 0x0306 - PM.add(new llvm::DataLayoutPass(mod)); -#elif HAVE_LLVM < 0x0307 +#if HAVE_LLVM < 0x0307 PM.add(new llvm::DataLayoutPass()); #endif #if HAVE_LLVM >= 0x0309 @@ -405,7 +386,7 @@ namespace { return res; } -#elif HAVE_LLVM >= 0x0306 +#else const llvm::MDNode * get_kernel_metadata(const llvm::Function *kernel_func) { @@ -464,17 +445,7 @@ namespace { return res; } - -#else - - std::vector - get_kernel_arg_md(const llvm::Function *kernel_func) { - return std::vector( - kernel_func->getArgumentList().size(), - kernel_arg_md("", "")); - } - -#endif // HAVE_LLVM >= 0x0306 +#endif std::vector get_kernel_args(const llvm::Module *mod, const std::string &kernel_name, @@ -941,10 +912,7 @@ clover::compile_program_llvm(const std::string &source, break; } } -#if HAVE_LLVM >= 0x0306 - // LLVM 3.6 and newer, the user takes ownership of the module. + // The user takes ownership of the module. delete mod; -#endif - return m; }