mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 09:31:03 +03:00
Fix LLVM 3.6 build
This commit is contained in:
parent
6aca85a5e3
commit
aa35307f54
3 changed files with 13 additions and 4 deletions
|
@ -512,7 +512,9 @@ static void initializePasses() {
|
|||
// For codegen passes, only passes that do IR to IR transformation are
|
||||
// supported. For now, just add CodeGenPrepare.
|
||||
initializeCodeGenPreparePass(Registry);
|
||||
#if LDC_LLVM_VER >= 305
|
||||
#if LDC_LLVM_VER >= 306
|
||||
initializeAtomicExpandPass(Registry);
|
||||
#elif LDC_LLVM_VER == 305
|
||||
initializeAtomicExpandLoadLinkedPass(Registry);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -685,7 +685,7 @@ void ldc::DIBuilder::EmitBlockStart(Loc& loc)
|
|||
CreateFile(loc), // file
|
||||
loc.linnum, // line
|
||||
0 // column
|
||||
#if LDC_LLVM_VER >= 305
|
||||
#if LDC_LLVM_VER == 305
|
||||
, 0 // DWARF path discriminator value
|
||||
#endif
|
||||
);
|
||||
|
|
|
@ -379,7 +379,10 @@ LLFunction* DtoInlineIRFunction(FuncDeclaration* fdecl)
|
|||
|
||||
llvm::SMDiagnostic err;
|
||||
|
||||
#if LDC_LLVM_VER >= 303
|
||||
#if LDC_LLVM_VER >= 306
|
||||
std::unique_ptr<llvm::Module> m = llvm::parseAssemblyString(
|
||||
stream.str().c_str(), err, gIR->context());
|
||||
#elif LDC_LLVM_VER >= 303
|
||||
llvm::Module* m = llvm::ParseAssemblyString(
|
||||
stream.str().c_str(), NULL, err, gIR->context());
|
||||
#else
|
||||
|
@ -399,9 +402,13 @@ LLFunction* DtoInlineIRFunction(FuncDeclaration* fdecl)
|
|||
(std::string(err.getColumnNo(), ' ') + '^').c_str(),
|
||||
errstr.c_str(), stream.str().c_str());
|
||||
|
||||
#if LDC_LLVM_VER >= 303
|
||||
#if LDC_LLVM_VER >= 303
|
||||
std::string errstr2 = "";
|
||||
#if LDC_LLVM_VER >= 303
|
||||
llvm::Linker(gIR->module).linkInModule(m.get(), &errstr2);
|
||||
#else
|
||||
llvm::Linker(gIR->module).linkInModule(m, &errstr2);
|
||||
#endif
|
||||
if(errstr2 != "")
|
||||
error(tinst->loc,
|
||||
"Error when linking in llvm inline ir: %s", errstr2.c_str());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue