about summary refs log tree commit diff homepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/klee/Internal/Module/LLVMPassManager.h22
-rw-r--r--include/klee/Internal/Support/ModuleUtil.h37
2 files changed, 48 insertions, 11 deletions
diff --git a/include/klee/Internal/Module/LLVMPassManager.h b/include/klee/Internal/Module/LLVMPassManager.h
new file mode 100644
index 00000000..5a1b8927
--- /dev/null
+++ b/include/klee/Internal/Module/LLVMPassManager.h
@@ -0,0 +1,22 @@
+//===-- InstructionInfoTable.h ----------------------------------*- C++ -*-===//
+//
+//                     The KLEE Symbolic Virtual Machine
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+#include "llvm/IR/LegacyPassManager.h"
+#else
+#include "llvm/PassManager.h"
+#endif
+
+namespace klee {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+typedef llvm::legacy::PassManager LegacyLLVMPassManagerTy;
+#else
+typedef llvm::PassManager LegacyLLVMPassManagerTy;
+#endif
+}
diff --git a/include/klee/Internal/Support/ModuleUtil.h b/include/klee/Internal/Support/ModuleUtil.h
index c85ba591..78998051 100644
--- a/include/klee/Internal/Support/ModuleUtil.h
+++ b/include/klee/Internal/Support/ModuleUtil.h
@@ -7,22 +7,37 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef KLEE_TRANSFORM_UTIL_H
-#define KLEE_TRANSFORM_UTIL_H
+#ifndef KLEE_MODULE_UTIL_H
+#define KLEE_MODULE_UTIL_H
+
+#include "klee/Config/Version.h"
+
+#if LLVM_VERSION_CODE > LLVM_VERSION(3, 2)
+#include "llvm/IR/Module.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/LLVMContext.h"
+#else
+#include "llvm/Module.h"
+#include "llvm/Function.h"
+#include "llvm/LLVMContext.h"
+#endif
 
-#include <string>
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
+#include "llvm/IR/CallSite.h"
+#else
+#include "llvm/Support/CallSite.h"
+#endif
 
-namespace llvm {
-  class Function;
-  class Instruction;
-  class Module; 
-  class CallSite; 
-}
+#include <string>
 
 namespace klee {
- 
+  /// Load llvm module from a bitcode archive file.
+  llvm::Module *loadModule(llvm::LLVMContext &ctx,
+                           const std::string &path,
+                           std::string &errorMsg);
+
   /// Link a module with a specified bitcode archive.
-  llvm::Module *linkWithLibrary(llvm::Module *module, 
+  llvm::Module *linkWithLibrary(llvm::Module *module,
                                 const std::string &libraryName);
 
   /// Return the Function* target of a Call or Invoke instruction, or