klee/0009-llvm40-handle-different-header-names.patch

85 lines
2.4 KiB
Diff

From: Jiri Slaby <jirislaby@gmail.com>
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 <jirislaby@gmail.com>
---
lib/Module/KModule.cpp | 4 ++++
lib/Module/ModuleUtil.cpp | 6 ++++++
tools/klee/main.cpp | 7 ++++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp
index b31b7fd5a56d..a47e0a43615a 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
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 3)
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
index 14d48b026d14..6bdea479ee06 100644
--- a/lib/Module/ModuleUtil.cpp
+++ b/lib/Module/ModuleUtil.cpp
@@ -19,7 +19,11 @@
#endif
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 3)
+#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
+#include <llvm/Bitcode/BitcodeReader.h>
+#else
#include "llvm/Bitcode/ReaderWriter.h"
+#endif
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
@@ -31,7 +35,9 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "llvm/Support/SourceMgr.h"
+#if LLVM_VERSION_CODE < LLVM_VERSION(4, 0)
#include "llvm/Support/DataStream.h"
+#endif
#else
#include "llvm/Function.h"
#include "llvm/Instructions.h"
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index eac69ada30e0..eccc79776bb5 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -43,13 +43,18 @@
#endif
#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"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
+#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
+#include <llvm/Bitcode/BitcodeReader.h>
+#else
+#include <llvm/Bitcode/ReaderWriter.h>
+#endif
+
#if LLVM_VERSION_CODE < LLVM_VERSION(3, 0)
#include "llvm/Target/TargetSelect.h"
#else
--
2.13.1