summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-10-20 11:21:26 +0200
committerMarek Olšák <[email protected]>2016-10-20 17:45:23 +0200
commitc2a602d21a4dd7da9d3226a70cb83ab85ceb446a (patch)
tree1abe7cfd73185bd2e9af85e3229e38f9107e5ac9 /src/gallium
parentf19f71830bb342ff10019fca30dc5f1fd5755202 (diff)
gallivm: try to fix build with LLVM <= 3.4 due to missing CallSite.h
Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index f4045ad1d89..bd4d4d3c094 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -77,7 +77,9 @@
#include <llvm/Support/TargetSelect.h>
+#if HAVE_LLVM >= 0x0305
#include <llvm/IR/CallSite.h>
+#endif
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Module.h>
#include <llvm/Support/CBindingWrapping.h>
@@ -715,8 +717,10 @@ lp_get_called_value(LLVMValueRef call)
{
#if HAVE_LLVM >= 0x0309
return LLVMGetCalledValue(call);
-#else
+#elif HAVE_LLVM >= 0x0305
return llvm::wrap(llvm::CallSite(llvm::unwrap<llvm::Instruction>(call)).getCalledValue());
+#else
+ return NULL; /* radeonsi doesn't support so old LLVM. */
#endif
}