gallivm: try to fix build with LLVM <= 3.4 due to missing CallSite.h
authorMarek Olšák <marek.olsak@amd.com>
Thu, 20 Oct 2016 09:21:26 +0000 (11:21 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 20 Oct 2016 15:45:23 +0000 (17:45 +0200)
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp

index f4045ad1d89645054d6c17890b7577c7bc49af13..bd4d4d3c0947380d73e13e2df6da4ff3432c54d3 100644 (file)
@@ -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
 }