From 215ca762d0be61f8831d370d4fc8785835c7fec5 Mon Sep 17 00:00:00 2001 From: Vsevolod Livinskiy Date: Wed, 29 Oct 2014 22:52:52 +0400 Subject: [PATCH 1/2] 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); From a239f37302d27340dcb58d90f2eba2a51b74f014 Mon Sep 17 00:00:00 2001 From: Vsevolod Livinskiy Date: Wed, 29 Oct 2014 23:48:21 +0400 Subject: [PATCH 2/2] Fix for missing declaration of IntrinsicInst --- builtins.cpp | 2 +- opt.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/builtins.cpp b/builtins.cpp index 90410f1e..8686ec97 100644 --- a/builtins.cpp +++ b/builtins.cpp @@ -883,7 +883,7 @@ AddBitcodeToModule(const unsigned char *bitcode, int length, &linkError)) Error(SourcePos(), "Error linking stdlib bitcode: %s", linkError.c_str()); #else // LLVM 3.6+ - )) + )) {} #endif lSetInternalFunctions(module); if (symbolTable != NULL) diff --git a/opt.cpp b/opt.cpp index 135a7c8c..b36c7d8f 100644 --- a/opt.cpp +++ b/opt.cpp @@ -103,6 +103,9 @@ #include #include #include +#if !defined(LLVM_3_2) && !defined(LLVM_3_5) && !defined(LLVM_3_4) && !defined(LLVM_3_5) + #include +#endif #ifdef ISPC_IS_LINUX #include #elif defined(ISPC_IS_WINDOWS)