From e69a71a164be39baef2a4d3e450c733fd4c7868a Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 30 Sep 2010 04:52:23 +0000 Subject: Update for spurious LLVM API changes. - God forbid we manage to keep an API stable for a single release cycle. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@115139 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Module/InstructionInfoTable.cpp | 13 ++++++++++++- lib/Module/ModuleUtil.cpp | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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" -- cgit 1.4.1