about summary refs log tree commit diff homepage
path: root/lib/Module
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2017-06-07 14:57:45 +0200
committerMartinNowack <martin.nowack@gmail.com>2018-09-18 10:36:36 +0100
commit411754f7922a21229f9d3d4349cfb766900228ec (patch)
treea1ca95ce0dbca5b48bc61fc3c66356effb5e6212 /lib/Module
parent4d30c74c7b38e32073c92bf9d8bb7c5acf597cfd (diff)
downloadklee-411754f7922a21229f9d3d4349cfb766900228ec.tar.gz
llvm4: handle different header names
LLVM 4 renamed and splitted some headers. Take this into account in
includes.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/KModule.cpp4
-rw-r--r--lib/Module/ModuleUtil.cpp9
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp
index 49a1ba69..7b02c856 100644
--- a/lib/Module/KModule.cpp
+++ b/lib/Module/KModule.cpp
@@ -21,7 +21,11 @@
 #include "klee/Internal/Support/Debug.h"
 #include "klee/Internal/Support/ModuleUtil.h"
 
+#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
+#include "llvm/Bitcode/BitcodeWriter.h"
+#else
 #include "llvm/Bitcode/ReaderWriter.h"
+#endif
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/IR/Instructions.h"
diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
index 79395da6..e2da9e51 100644
--- a/lib/Module/ModuleUtil.cpp
+++ b/lib/Module/ModuleUtil.cpp
@@ -24,7 +24,9 @@
 #include "llvm/Object/Archive.h"
 #include "llvm/Object/Error.h"
 #include "llvm/Object/ObjectFile.h"
+#if LLVM_VERSION_CODE < LLVM_VERSION(4, 0)
 #include "llvm/Support/DataStream.h"
+#endif
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/SourceMgr.h"
 
@@ -43,8 +45,13 @@
 #include "llvm/IR/DiagnosticPrinter.h"
 #endif
 
+#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
+#include <llvm/Bitcode/BitcodeReader.h>
+#else
+#include <llvm/Bitcode/ReaderWriter.h>
+#endif
+
 #include "llvm/Analysis/ValueTracking.h"
-#include "llvm/Bitcode/ReaderWriter.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/Path.h"