summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover/llvm
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-06-27 23:24:59 -0700
committerFrancisco Jerez <[email protected]>2016-07-11 20:19:49 -0700
commit600ac51448f0dc62808e962a206d11e1b179a32f (patch)
treea4701505a173e0d2340a0c510366611de14a708d /src/gallium/state_trackers/clover/llvm
parent8624888d6f015439b3d73ec5eb9a7d5e82c65282 (diff)
clover/llvm: Drop support for LLVM < 3.6.
Reviewed-by: Serge Martin <[email protected]> Tested-by: Jan Vesely <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover/llvm')
-rw-r--r--src/gallium/state_trackers/clover/llvm/invocation.cpp40
1 files changed, 4 insertions, 36 deletions
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<llvm::Function *>
@@ -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<llvm::Function>(
-#else
- kernels.push_back(llvm::dyn_cast<llvm::Function>(
-#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<kernel_arg_md>
- get_kernel_arg_md(const llvm::Function *kernel_func) {
- return std::vector<kernel_arg_md>(
- kernel_func->getArgumentList().size(),
- kernel_arg_md("", ""));
- }
-
-#endif // HAVE_LLVM >= 0x0306
+#endif
std::vector<module::argument>
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;
}