mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-11 09:23:13 +01:00
Fix build with LLVM 3.5
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user