diff options
Diffstat (limited to 'lib/Module/KModule.cpp')
-rw-r--r-- | lib/Module/KModule.cpp | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 207d4bd4..2ee49f23 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -27,6 +27,7 @@ #else #include "llvm/Bitcode/ReaderWriter.h" #endif +#include "llvm/IR/CallSite.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Instructions.h" @@ -34,28 +35,17 @@ #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IR/ValueSymbolTable.h" - -#if LLVM_VERSION_CODE < LLVM_VERSION(3, 5) -#include "llvm/Analysis/Verifier.h" -#include "llvm/Linker.h" -#include "llvm/Support/CallSite.h" -#else -#include "llvm/IR/CallSite.h" #include "llvm/IR/Verifier.h" #include "llvm/Linker/Linker.h" -#endif - #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_os_ostream.h" -#include "llvm/Support/Path.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 @@ -150,14 +140,10 @@ static Function *getStubFunctionForCtorList(Module *m, if (arr) { for (unsigned i=0; i<arr->getNumOperands(); i++) { auto cs = cast<ConstantStruct>(arr->getOperand(i)); -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) // There is a third *optional* element in global_ctor elements (``i8 // @data``). assert((cs->getNumOperands() == 2 || cs->getNumOperands() == 3) && "unexpected element in ctor initializer list"); -#else - assert(cs->getNumOperands()==2 && "unexpected element in ctor initializer list"); -#endif auto fp = cs->getOperand(1); if (!fp->isNullValue()) { if (auto ce = dyn_cast<llvm::ConstantExpr>(fp)) @@ -192,11 +178,7 @@ injectStaticConstructorsAndDestructors(Module *m, entryFunction.str().c_str()); if (ctors) { -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) llvm::IRBuilder<> Builder(&*mainFn->begin()->begin()); -#else - llvm::IRBuilder<> Builder(mainFn->begin()->begin()); -#endif Builder.CreateCall(getStubFunctionForCtorList(m, ctors, "klee.ctor_stub")); } @@ -425,14 +407,8 @@ static int getOperandNum(Value *v, return registerMap[inst]; } else if (Argument *a = dyn_cast<Argument>(v)) { return a->getArgNo(); -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6) - // Metadata is no longer a Value } else if (isa<BasicBlock>(v) || isa<InlineAsm>(v) || isa<MetadataAsValue>(v)) { -#else - } else if (isa<BasicBlock>(v) || isa<InlineAsm>(v) || - isa<MDNode>(v)) { -#endif return -1; } else { assert(isa<Constant>(v)); |