summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-08-28 00:36:45 +0100
committerEric Engestrom <[email protected]>2019-09-06 22:26:29 +0100
commitba1e085587a3f72e5f3453f436034d7ac7183045 (patch)
tree7c162adeabf9da895bf7772b1ae63c7ad483fe2d /src/gallium
parent1c1c477470697a65b85bed1fa52b3b37861dd530 (diff)
clover: replace more complex 3.x version check with LLVM_VERSION_MAJOR/MINOR
Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/clover/llvm/metadata.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/metadata.hpp b/src/gallium/state_trackers/clover/llvm/metadata.hpp
index 825008d4974..4a6f37d8f5d 100644
--- a/src/gallium/state_trackers/clover/llvm/metadata.hpp
+++ b/src/gallium/state_trackers/clover/llvm/metadata.hpp
@@ -32,6 +32,7 @@
#include "util/algorithm.hpp"
#include <vector>
+#include <llvm/Config/llvm-config.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/Metadata.h>
@@ -57,7 +58,7 @@ namespace clover {
inline bool
is_kernel(const ::llvm::Function &f) {
-#if HAVE_LLVM >= 0x0309
+#if (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 9))
return f.getMetadata("kernel_arg_type");
#else
return clover::any_of(is_kernel_node_for(f),
@@ -68,7 +69,7 @@ namespace clover {
inline iterator_range< ::llvm::MDNode::op_iterator>
get_kernel_metadata_operands(const ::llvm::Function &f,
const std::string &name) {
-#if HAVE_LLVM >= 0x0309
+#if (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 9))
// On LLVM v3.9+ kernel argument attributes are stored as
// function metadata.
const auto data_node = f.getMetadata(name);