From 215ca762d0be61f8831d370d4fc8785835c7fec5 Mon Sep 17 00:00:00 2001 From: Vsevolod Livinskiy Date: Wed, 29 Oct 2014 22:52:52 +0400 Subject: [PATCH] Fix for rev. 220741. LinkModiles emits error by itself --- builtins.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/builtins.cpp b/builtins.cpp index 2a1df0eb..90410f1e 100644 --- a/builtins.cpp +++ b/builtins.cpp @@ -877,10 +877,14 @@ AddBitcodeToModule(const unsigned char *bitcode, int length, bcModule->setDataLayout(module->getDataLayout()); std::string(linkError); - if (llvm::Linker::LinkModules(module, bcModule, - llvm::Linker::DestroySource, + if (llvm::Linker::LinkModules(module, bcModule +#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) + , llvm::Linker::DestroySource, &linkError)) Error(SourcePos(), "Error linking stdlib bitcode: %s", linkError.c_str()); +#else // LLVM 3.6+ + )) +#endif lSetInternalFunctions(module); if (symbolTable != NULL) lAddModuleSymbols(module, symbolTable);