From 6cc8ee707c1b4337120aa2972e2ad13a4861bbc3 Mon Sep 17 00:00:00 2001 From: Frank Busse Date: Mon, 13 Jun 2022 10:42:51 +0100 Subject: remove LLVM < 9 --- lib/Module/KModule.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'lib/Module/KModule.cpp') diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 139149e5..049c6744 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -23,9 +23,6 @@ #include "klee/Support/ModuleUtil.h" #include "llvm/Bitcode/BitcodeWriter.h" -#if LLVM_VERSION_CODE < LLVM_VERSION(8, 0) -#include "llvm/IR/CallSite.h" -#endif #include "llvm/IR/DataLayout.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Instructions.h" @@ -40,13 +37,9 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_os_ostream.h" #include "llvm/Transforms/Scalar.h" -#if LLVM_VERSION_CODE >= LLVM_VERSION(8, 0) #include "llvm/Transforms/Scalar/Scalarizer.h" -#endif #include "llvm/Transforms/Utils/Cloning.h" -#if LLVM_VERSION_CODE >= LLVM_VERSION(7, 0) #include "llvm/Transforms/Utils.h" -#endif #include @@ -138,14 +131,8 @@ static Function *getStubFunctionForCtorList(Module *m, for (unsigned i=0; igetNumOperands(); i++) { auto cs = cast(arr->getOperand(i)); // There is a third element in global_ctor elements (``i8 @data``). -#if LLVM_VERSION_CODE >= LLVM_VERSION(9, 0) assert(cs->getNumOperands() == 3 && "unexpected element in ctor initializer list"); -#else - // before LLVM 9.0, the third operand was optional - assert((cs->getNumOperands() == 2 || cs->getNumOperands() == 3) && - "unexpected element in ctor initializer list"); -#endif auto fp = cs->getOperand(1); if (!fp->isNullValue()) { if (auto ce = dyn_cast(fp)) @@ -303,11 +290,7 @@ void KModule::manifest(InterpreterHandler *ih, bool forceSourceOutput) { if (OutputModule) { std::unique_ptr f(ih->openOutputFile("final.bc")); -#if LLVM_VERSION_CODE >= LLVM_VERSION(7, 0) WriteBitcodeToFile(*module, *f); -#else - WriteBitcodeToFile(module.get(), *f); -#endif } /* Build shadow structures */ @@ -468,13 +451,8 @@ KFunction::KFunction(llvm::Function *_function, ki->dest = registerMap[inst]; if (isa(it) || isa(it)) { -#if LLVM_VERSION_CODE >= LLVM_VERSION(8, 0) const CallBase &cs = cast(*inst); Value *val = cs.getCalledOperand(); -#else - const CallSite cs(inst); - Value *val = cs.getCalledValue(); -#endif unsigned numArgs = cs.arg_size(); ki->operands = new int[numArgs+1]; ki->operands[0] = getOperandNum(val, registerMap, km, ki); -- cgit 1.4.1