about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Core/Executor.cpp7
-rw-r--r--lib/Core/Executor.h4
-rw-r--r--lib/Core/ExecutorUtil.cpp3
-rw-r--r--lib/Core/ExternalDispatcher.cpp9
-rw-r--r--lib/Core/Searcher.cpp8
-rw-r--r--lib/Core/StatsTracker.cpp14
-rw-r--r--lib/Module/Checks.cpp1
-rw-r--r--lib/Module/InstructionInfoTable.cpp19
-rw-r--r--lib/Module/KModule.cpp11
-rw-r--r--lib/Module/ModuleUtil.cpp15
-rw-r--r--lib/Module/Optimize.cpp19
-rw-r--r--lib/Solver/QueryLoggingSolver.cpp8
-rw-r--r--lib/Support/TreeStream.cpp5
13 files changed, 92 insertions, 31 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index 545218f9..314e5b82 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -78,12 +78,17 @@
 #endif
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/CallSite.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/raw_ostream.h"
 
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
+#include "llvm/Support/CallSite.h"
+#else
+#include "llvm/IR/CallSite.h"
+#endif
+
 #include <cassert>
 #include <algorithm>
 #include <iomanip>
diff --git a/lib/Core/Executor.h b/lib/Core/Executor.h
index 7d82332c..523b3648 100644
--- a/lib/Core/Executor.h
+++ b/lib/Core/Executor.h
@@ -20,7 +20,9 @@
 #include "klee/Internal/Module/Cell.h"
 #include "klee/Internal/Module/KInstruction.h"
 #include "klee/Internal/Module/KModule.h"
-#include "llvm/Support/CallSite.h"
+
+#include "llvm/ADT/Twine.h"
+
 #include <vector>
 #include <string>
 #include <map>
diff --git a/lib/Core/ExecutorUtil.cpp b/lib/Core/ExecutorUtil.cpp
index f6b3dd5e..56f18e6b 100644
--- a/lib/Core/ExecutorUtil.cpp
+++ b/lib/Core/ExecutorUtil.cpp
@@ -38,9 +38,6 @@
 #endif
 #endif
 
-#include "llvm/Support/CallSite.h"
-
-
 #include <cassert>
 
 using namespace klee;
diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp
index 4c1e2b86..5f9f8dc6 100644
--- a/lib/Core/ExternalDispatcher.cpp
+++ b/lib/Core/ExternalDispatcher.cpp
@@ -32,14 +32,21 @@
 #endif
 #include "llvm/ExecutionEngine/JIT.h"
 #include "llvm/ExecutionEngine/GenericValue.h"
-#include "llvm/Support/CallSite.h"
 #include "llvm/Support/DynamicLibrary.h"
 #include "llvm/Support/raw_ostream.h"
+
 #if LLVM_VERSION_CODE < LLVM_VERSION(3, 0)
 #include "llvm/Target/TargetSelect.h"
 #else
 #include "llvm/Support/TargetSelect.h"
 #endif
+
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
+#include "llvm/Support/CallSite.h"
+#else
+#include "llvm/IR/CallSite.h"
+#endif
+
 #include <setjmp.h>
 #include <signal.h>
 
diff --git a/lib/Core/Searcher.cpp b/lib/Core/Searcher.cpp
index 2610f17e..e33d2a56 100644
--- a/lib/Core/Searcher.cpp
+++ b/lib/Core/Searcher.cpp
@@ -34,10 +34,14 @@
 #include "llvm/Instructions.h"
 #include "llvm/Module.h"
 #endif
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
+#include "llvm/Support/CallSite.h"
+#else
+#include "llvm/IR/CallSite.h"
+#endif
+
 #include <cassert>
 #include <fstream>
 #include <climits>
diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp
index 54dd0df8..0e564fe5 100644
--- a/lib/Core/StatsTracker.cpp
+++ b/lib/Core/StatsTracker.cpp
@@ -52,11 +52,18 @@
 #include "llvm/Type.h"
 #endif
 #include "llvm/Support/CommandLine.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/FileSystem.h"
 
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
+#include "llvm/Support/CallSite.h"
+#include "llvm/Support/CFG.h"
+#else
+#include "llvm/IR/CallSite.h"
+#include "llvm/IR/CFG.h"
+#endif
+
 #include <fstream>
 #include <unistd.h>
 
@@ -190,8 +197,13 @@ StatsTracker::StatsTracker(Executor &_executor, std::string _objectFilename,
     SmallString<128> current(objectFilename);
     if(sys::fs::make_absolute(current)) {
       bool exists = false;
+
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
       error_code ec = sys::fs::exists(current.str(), exists);
       if (ec == errc::success && exists) {
+#else
+      if (!sys::fs::exists(current.str(), exists)) {
+#endif
         objectFilename = current.c_str();
       }
     }
diff --git a/lib/Module/Checks.cpp b/lib/Module/Checks.cpp
index e1076d43..7d9b7284 100644
--- a/lib/Module/Checks.cpp
+++ b/lib/Module/Checks.cpp
@@ -45,7 +45,6 @@
 #include "llvm/Pass.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Support/CallSite.h"
 
 using namespace llvm;
 using namespace klee;
diff --git a/lib/Module/InstructionInfoTable.cpp b/lib/Module/InstructionInfoTable.cpp
index eca1ae1d..7e9a9e26 100644
--- a/lib/Module/InstructionInfoTable.cpp
+++ b/lib/Module/InstructionInfoTable.cpp
@@ -21,17 +21,28 @@
 #include "llvm/IntrinsicInst.h"
 #include "llvm/Module.h"
 #endif
-#include "llvm/Linker.h"
+
+# if LLVM_VERSION_CODE < LLVM_VERSION(3,5)
 #include "llvm/Assembly/AssemblyAnnotationWriter.h"
-#include "llvm/Support/FormattedStream.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/InstIterator.h"
+#include "llvm/Linker.h"
+#else
+#include "llvm/IR/AssemblyAnnotationWriter.h"
+#include "llvm/IR/InstIterator.h"
+#include "llvm/Linker/Linker.h"
+#endif
+
+#include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/raw_ostream.h"
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 2)
+
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3,5)
+#include "llvm/IR/DebugInfo.h"
+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 2)
 #include "llvm/DebugInfo.h"
 #else
 #include "llvm/Analysis/DebugInfo.h"
 #endif
+
 #include "llvm/Analysis/ValueTracking.h"
 #include "llvm/Support/ErrorHandling.h"
 
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp
index 57e0c4fe..428acbc8 100644
--- a/lib/Module/KModule.cpp
+++ b/lib/Module/KModule.cpp
@@ -10,6 +10,7 @@
 // FIXME: This does not belong here.
 #include "../Core/Common.h"
 
+#define DEBUG_TYPE "KModule"
 #include "klee/Internal/Module/KModule.h"
 
 #include "Passes.h"
@@ -42,8 +43,13 @@
 
 #endif
 
-#include "llvm/PassManager.h"
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
 #include "llvm/Support/CallSite.h"
+#else
+#include "llvm/IR/CallSite.h"
+#endif
+
+#include "llvm/PassManager.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/raw_os_ostream.h"
@@ -51,7 +57,6 @@
 #include "llvm/Transforms/Scalar.h"
 
 #include <llvm/Transforms/Utils/Cloning.h>
-#include <llvm/Support/InstIterator.h>
 
 #include <sstream>
 
@@ -273,7 +278,7 @@ static void inlineChecks(Module *module, const char * functionName) {
 void KModule::addInternalFunction(const char* functionName){
   Function* internalFunction = module->getFunction(functionName);
   if (!internalFunction) {
-    KLEE_DEBUG_WITH_TYPE("KModule", klee_warning(
+    KLEE_DEBUG(klee_warning(
         "Failed to add internal function %s. Not found.", functionName));
     return ;
   }
diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
index be1ea4c1..3811003e 100644
--- a/lib/Module/ModuleUtil.cpp
+++ b/lib/Module/ModuleUtil.cpp
@@ -41,15 +41,24 @@
 #include "llvm/Module.h"
 #endif
 
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
 #include "llvm/Linker.h"
 #include "llvm/Assembly/AssemblyAnnotationWriter.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/InstIterator.h"
+#else
+#include "llvm/Linker/Linker.h"
+#include "llvm/IR/AssemblyAnnotationWriter.h"
+#endif
+
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Analysis/ValueTracking.h"
 #include "llvm/Support/Path.h"
 
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
+#include "llvm/Support/CallSite.h"
+#else
+#include "llvm/IR/CallSite.h"
+#endif
+
 #include <map>
 #include <set>
 #include <fstream>
diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp
index ed1e0e34..ce43cd96 100644
--- a/lib/Module/Optimize.cpp
+++ b/lib/Module/Optimize.cpp
@@ -19,7 +19,6 @@
 #include "llvm/PassManager.h"
 #include "llvm/Analysis/Passes.h"
 #include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/Verifier.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/DynamicLibrary.h"
 
@@ -35,19 +34,18 @@
 #endif
 #endif
 
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
+#include "llvm/IR/Verifier.h"
+#else
+#include "llvm/Analysis/Verifier.h"
+#endif
+
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Transforms/Scalar.h"
-#include "llvm/Support/PassNameParser.h"
 #include "llvm/Support/PluginLoader.h"
 using namespace llvm;
 
-#if 0
-// Pass Name Options as generated by the PassNameParser
-static cl::list<const PassInfo*, bool, PassNameParser>
-  OptimizationList(cl::desc("Optimizations available:"));
-#endif
-
 // Don't verify at the end
 static cl::opt<bool> DontVerify("disable-verify", cl::ReallyHidden);
 
@@ -177,9 +175,12 @@ void Optimize(Module* M) {
 #if LLVM_VERSION_CODE <= LLVM_VERSION(3, 1)
   // Add an appropriate TargetData instance for this module...
   addPass(Passes, new TargetData(M));
-#else
+#elif LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
   // Add an appropriate DataLayout instance for this module...
   addPass(Passes, new DataLayout(M));
+#else
+  // Add an appropriate DataLayout instance for this module...
+  addPass(Passes, new DataLayoutPass(M));
 #endif
 
   // DWD - Run the opt standard pass list as well.
diff --git a/lib/Solver/QueryLoggingSolver.cpp b/lib/Solver/QueryLoggingSolver.cpp
index d5598d1d..5484a319 100644
--- a/lib/Solver/QueryLoggingSolver.cpp
+++ b/lib/Solver/QueryLoggingSolver.cpp
@@ -4,6 +4,10 @@
 #include "klee/Internal/System/Time.h"
 #include "klee/Statistics.h"
 
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
+#include "llvm/Support/FileSystem.h"
+#endif
+
 //
 //                     The KLEE Symbolic Virtual Machine
 //
@@ -19,7 +23,11 @@ QueryLoggingSolver::QueryLoggingSolver(Solver *_solver,
                                        const std::string& commentSign,
                                        int queryTimeToLog)                                  
     : solver(_solver),
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
+      os(path.c_str(), ErrorInfo, llvm::sys::fs::OpenFlags::F_Text),
+#else
       os(path.c_str(), ErrorInfo),
+#endif
       BufferString(""),
       logBuffer(BufferString),
       queryCount(0),    
diff --git a/lib/Support/TreeStream.cpp b/lib/Support/TreeStream.cpp
index 74ffe3ba..ef59b2a9 100644
--- a/lib/Support/TreeStream.cpp
+++ b/lib/Support/TreeStream.cpp
@@ -7,6 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "TreeStreamWriter"
 #include "klee/Internal/ADT/TreeStream.h"
 
 #include "klee/Internal/Support/Debug.h"
@@ -107,8 +108,7 @@ void TreeStreamWriter::readStream(TreeStreamID streamID,
   std::ifstream is(path.c_str(),
                    std::ios::in | std::ios::binary);
   assert(is.good());
-  KLEE_DEBUG_WITH_TYPE("TreeStreamWriter",
-                  llvm::errs() << "finding chain for: " << streamID << "\n");
+  KLEE_DEBUG(llvm::errs() << "finding chain for: " << streamID << "\n");
 
   std::map<unsigned,unsigned> parents;
   std::vector<unsigned> roots;
@@ -202,3 +202,4 @@ void TreeOStream::flush() {
   assert(writer);
   writer->flush();
 }
+