From: Jiri Slaby Date: Wed, 7 Jun 2017 14:57:45 +0200 Subject: llvm40: handle different header names Patch-mainline: no LLVM 4.0 renamed and split some headers. Take this into account in includes. Signed-off-by: Jiri Slaby --- lib/Module/KModule.cpp | 4 ++++ lib/Module/ModuleUtil.cpp | 9 ++++++++- tools/klee/main.cpp | 7 ++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 0439431b3bc8..ff76cd53c895 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/Instructions.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp index ee4af254dae2..8aa070743048 100644 --- a/lib/Module/ModuleUtil.cpp +++ b/lib/Module/ModuleUtil.cpp @@ -26,7 +26,9 @@ #include "llvm/Object/Error.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/SourceMgr.h" +#if LLVM_VERSION_CODE < LLVM_VERSION(4, 0) #include "llvm/Support/DataStream.h" +#endif #if LLVM_VERSION_CODE < LLVM_VERSION(3, 5) #include "llvm/Linker.h" @@ -36,8 +38,13 @@ #include "llvm/IR/AssemblyAnnotationWriter.h" #endif +#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0) +#include +#else +#include +#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" diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index 436651f438d4..07f302a4641f 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -31,7 +31,6 @@ #include "llvm/IR/LLVMContext.h" #include "llvm/Support/Errno.h" #include "llvm/Support/FileSystem.h" -#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" @@ -45,6 +44,12 @@ #include "llvm/Support/system_error.h" #endif +#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0) +#include +#else +#include +#endif + #include #include #include -- 2.15.1