Drop support for llvm versions < 11.
#include <llvm/IR/DataLayout.h>
#include <llvm/Transforms/Scalar.h>
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
-#if LLVM_VERSION_MAJOR > 9
#include <llvm/Support/ManagedStatic.h>
-#endif
#include <vespa/eval/eval/check_type.h>
#include <vespa/vespalib/stllike/hash_set.h>
#include <vespa/vespalib/util/approx.h>
@@ -339,7 +337,6 @@ struct FunctionBuilder : public NodeVisitor, public NodeTraverser {
llvm::Value *a = pop_double();
push(builder.CreateCall(fun, a));
}
-#if LLVM_VERSION_MAJOR >= 9
void make_call_1(llvm::FunctionCallee fun) {
if (!fun || fun.getFunctionType()->getNumParams() != 1) {
return make_error(1);
@@ -347,16 +344,11 @@ struct FunctionBuilder : public NodeVisitor, public NodeTraverser {
llvm::Value *a = pop_double();
push(builder.CreateCall(fun, a));
}
-#endif
void make_call_1(const llvm::Intrinsic::ID &id) {
make_call_1(llvm::Intrinsic::getDeclaration(&module, id, builder.getDoubleTy()));
}
void make_call_1(const char *name) {
-#if LLVM_VERSION_MAJOR >= 9
make_call_1(module.getOrInsertFunction(name, make_call_1_fun_t()));
-#else
- make_call_1(llvm::dyn_cast<llvm::Function>(module.getOrInsertFunction(name, make_call_1_fun_t())));
-#endif
}
void make_call_2(llvm::Function *fun) {
@@ -367,7 +359,6 @@ struct FunctionBuilder : public NodeVisitor, public NodeTraverser {
llvm::Value *a = pop_double();
push(builder.CreateCall(fun, {a, b}));
}
-#if LLVM_VERSION_MAJOR >= 9
void make_call_2(llvm::FunctionCallee fun) {
if (!fun || fun.getFunctionType()->getNumParams() != 2) {
return make_error(2);
@@ -376,16 +367,11 @@ struct FunctionBuilder : public NodeVisitor, public NodeTraverser {
llvm::Value *a = pop_double();
push(builder.CreateCall(fun, {a, b}));
}
-#endif
void make_call_2(const llvm::Intrinsic::ID &id) {
make_call_2(llvm::Intrinsic::getDeclaration(&module, id, builder.getDoubleTy()));
}
void make_call_2(const char *name) {
-#if LLVM_VERSION_MAJOR >= 9
make_call_2(module.getOrInsertFunction(name, make_call_2_fun_t()));
-#else
- make_call_2(llvm::dyn_cast<llvm::Function>(module.getOrInsertFunction(name, make_call_2_fun_t())));
-#endif
}
//-------------------------------------------------------------------------
