diff options
-rw-r--r-- | lib/Module/InstructionInfoTable.cpp | 13 | ||||
-rw-r--r-- | lib/Module/ModuleUtil.cpp | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/Module/InstructionInfoTable.cpp b/lib/Module/InstructionInfoTable.cpp index 2efe981b..0a96643c 100644 --- a/lib/Module/InstructionInfoTable.cpp +++ b/lib/Module/InstructionInfoTable.cpp @@ -15,7 +15,12 @@ #include "llvm/IntrinsicInst.h" #include "llvm/Linker.h" #include "llvm/Module.h" +#if (LLVM_MAJOR_VERSION == 2 && LLVM_MINOR_VERSION < 8) #include "llvm/Assembly/AsmAnnotationWriter.h" +#else +#include "llvm/Assembly/AssemblyAnnotationWriter.h" +#include "llvm/Support/FormattedStream.h" +#endif #include "llvm/Support/CFG.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/raw_ostream.h" @@ -32,8 +37,14 @@ using namespace klee; class InstructionToLineAnnotator : public llvm::AssemblyAnnotationWriter { public: +#if (LLVM_MAJOR_VERSION == 2 && LLVM_MINOR_VERSION < 8) void emitInstructionAnnot(const Instruction *i, llvm::raw_ostream &os) { - os << "%%%" << (uintptr_t) i; +#else + void emitInstructionAnnot(const Instruction *i, + llvm::formatted_raw_ostream &os) { +#endif + os << "%%%"; + os << (uintptr_t) i; } }; diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp index 17c4aa91..ff3301ed 100644 --- a/lib/Module/ModuleUtil.cpp +++ b/lib/Module/ModuleUtil.cpp @@ -15,7 +15,11 @@ #include "llvm/IntrinsicInst.h" #include "llvm/Linker.h" #include "llvm/Module.h" +#if (LLVM_MAJOR_VERSION == 2 && LLVM_MINOR_VERSION < 8) #include "llvm/Assembly/AsmAnnotationWriter.h" +#else +#include "llvm/Assembly/AssemblyAnnotationWriter.h" +#endif #include "llvm/Support/CFG.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/InstIterator.h" |