Fix build with LLVM 3.5

This commit is contained in:
Kai Nacke
2014-01-11 17:25:59 +01:00
parent 67a1a3273a
commit 52a17c3a34
2 changed files with 8 additions and 3 deletions

View File

@@ -61,9 +61,6 @@
using llvm::IRBuilder;
// for WriteTypeSymbolic
#include "llvm/Assembly/Writer.h"
#define GET_INTRINSIC_DECL(_X) (llvm::Intrinsic::getDeclaration(gIR->module, llvm::Intrinsic:: _X ))
// shortcuts for the common llvm types

View File

@@ -24,7 +24,11 @@
#endif
#include "llvm/Support/Casting.h"
#include "llvm/Support/raw_os_ostream.h"
#if LDC_LLVM_VER >= 305
#include "llvm/IR/Value.h"
#else
#include "llvm/Assembly/Writer.h"
#endif
#include "gen/logger.h"
#include "gen/irstate.h"
@@ -40,7 +44,11 @@ void Stream::writeValue(std::ostream& OS, const llvm::Value& V) {
// still get their initializers printed)
llvm::raw_os_ostream raw(OS);
if (llvm::isa<llvm::Constant>(V) && !llvm::isa<llvm::GlobalValue>(V))
#if LDC_LLVM_VER >= 305
V.printAsOperand(raw, true, gIR->module);
#else
llvm::WriteAsOperand(raw, &V, true, gIR->module);
#endif
else
V.print(raw);
}