aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/kleaver/main.cpp33
-rw-r--r--tools/klee/main.cpp39
2 files changed, 0 insertions, 72 deletions
diff --git a/tools/kleaver/main.cpp b/tools/kleaver/main.cpp
index f5bbfaf0..abc37d4b 100644
--- a/tools/kleaver/main.cpp
+++ b/tools/kleaver/main.cpp
@@ -34,12 +34,8 @@
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
-#include "llvm/System/Signals.h"
-#else
#include "llvm/Support/Signals.h"
#include "llvm/Support/system_error.h"
-#endif
using namespace llvm;
using namespace klee;
@@ -459,20 +455,12 @@ int main(int argc, char **argv) {
std::string ErrorStr;
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
- MemoryBuffer *MB = MemoryBuffer::getFileOrSTDIN(InputFile.c_str(), &ErrorStr);
- if (!MB) {
- std::cerr << argv[0] << ": error: " << ErrorStr << "\n";
- return 1;
- }
-#else
OwningPtr<MemoryBuffer> MB;
error_code ec=MemoryBuffer::getFileOrSTDIN(InputFile.c_str(), MB);
if (ec) {
std::cerr << argv[0] << ": error: " << ec.message() << "\n";
return 1;
}
-#endif
ExprBuilder *Builder = 0;
switch (BuilderKind) {
@@ -492,45 +480,24 @@ int main(int argc, char **argv) {
switch (ToolAction) {
case PrintTokens:
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
- PrintInputTokens(MB);
-#else
PrintInputTokens(MB.get());
-#endif
break;
case PrintAST:
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
- success = PrintInputAST(InputFile=="-" ? "<stdin>" : InputFile.c_str(), MB,
- Builder);
-#else
success = PrintInputAST(InputFile=="-" ? "<stdin>" : InputFile.c_str(), MB.get(),
Builder);
-#endif
break;
case Evaluate:
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
- success = EvaluateInputAST(InputFile=="-" ? "<stdin>" : InputFile.c_str(),
- MB, Builder);
-#else
success = EvaluateInputAST(InputFile=="-" ? "<stdin>" : InputFile.c_str(),
MB.get(), Builder);
-#endif
break;
case PrintSMTLIBv2:
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
- success = printInputAsSMTLIBv2(InputFile=="-"? "<stdin>" : InputFile.c_str(), MB,Builder);
-#else
success = printInputAsSMTLIBv2(InputFile=="-"? "<stdin>" : InputFile.c_str(), MB.get(),Builder);
-#endif
break;
default:
std::cerr << argv[0] << ": error: Unknown program action!\n";
}
delete Builder;
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
- delete MB;
-#endif
llvm::llvm_shutdown();
return success ? 0 : 1;
}
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 0f5ce0c0..3616bfa6 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -28,14 +28,9 @@
#include "llvm/InstrTypes.h"
#include "llvm/Instruction.h"
#include "llvm/Instructions.h"
-#if LLVM_VERSION_CODE >= LLVM_VERSION(2, 7)
#include "llvm/LLVMContext.h"
#include "llvm/Support/FileSystem.h"
#endif
-#endif
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 7)
-#include "llvm/ModuleProvider.h"
-#endif
#include "llvm/Support/FileSystem.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Support/CommandLine.h"
@@ -53,12 +48,8 @@
#else
#include "llvm/Support/TargetSelect.h"
#endif
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
-#include "llvm/System/Signals.h"
-#else
#include "llvm/Support/Signals.h"
#include "llvm/Support/system_error.h"
-#endif
#include <dirent.h>
#include <signal.h>
@@ -571,11 +562,7 @@ void KleeHandler::getOutFiles(std::string path,
}
for (std::set<llvm::sys::Path>::iterator it = contents.begin(),
ie = contents.end(); it != ie; ++it) {
-#if LLVM_VERSION_CODE != LLVM_VERSION(2, 6)
std::string f = it->str();
-#else
- std::string f = it->toString();
-#endif
if (f.substr(f.size()-6,f.size()) == ".ktest") {
results.push_back(f);
}
@@ -750,7 +737,6 @@ static const char *modelledExternals[] = {
"klee_warning_once",
"klee_alias_function",
"klee_stack_trace",
- "llvm.dbg.stoppoint",
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 1)
"llvm.dbg.declare",
"llvm.dbg.value",
@@ -1216,28 +1202,7 @@ int main(int argc, char **argv, char **envp) {
// Load the bytecode...
std::string ErrorMsg;
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 7)
- ModuleProvider *MP = 0;
- if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile, &ErrorMsg)) {
- MP = getBitcodeModuleProvider(Buffer, getGlobalContext(), &ErrorMsg);
- if (!MP) delete Buffer;
- }
-
- if (!MP)
- klee_error("error loading program '%s': %s", InputFile.c_str(), ErrorMsg.c_str());
-
- Module *mainModule = MP->materializeModule();
- MP->releaseModule();
- delete MP;
-#else
Module *mainModule = 0;
-#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile, &ErrorMsg);
- if (Buffer) {
- mainModule = getLazyBitcodeModule(Buffer, getGlobalContext(), &ErrorMsg);
- if (!mainModule) delete Buffer;
- }
-#else
OwningPtr<MemoryBuffer> BufferPtr;
error_code ec=MemoryBuffer::getFileOrSTDIN(InputFile.c_str(), BufferPtr);
if (ec) {
@@ -1246,7 +1211,6 @@ int main(int argc, char **argv, char **envp) {
}
mainModule = getLazyBitcodeModule(BufferPtr.get(), getGlobalContext(), &ErrorMsg);
-#endif
if (mainModule) {
if (mainModule->MaterializeAllPermanently(&ErrorMsg)) {
delete mainModule;
@@ -1256,7 +1220,6 @@ int main(int argc, char **argv, char **envp) {
if (!mainModule)
klee_error("error loading program '%s': %s", InputFile.c_str(),
ErrorMsg.c_str());
-#endif
if (WithPOSIXRuntime) {
int r = initEnv(mainModule);
@@ -1540,9 +1503,7 @@ int main(int argc, char **argv, char **envp) {
std::cerr << stats.str();
handler->getInfoStream() << stats.str();
-#if LLVM_VERSION_CODE >= LLVM_VERSION(2, 9)
BufferPtr.take();
-#endif
delete handler;
return 0;