Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
#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>
{
#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
}