Fix for change in LLVM in llvm::Linker::linkModules()
This commit is contained in:
19
builtins.cpp
19
builtins.cpp
@@ -891,18 +891,19 @@ AddBitcodeToModule(const unsigned char *bitcode, int length,
|
|||||||
bcModule->setDataLayout(module->getDataLayout());
|
bcModule->setDataLayout(module->getDataLayout());
|
||||||
|
|
||||||
std::string(linkError);
|
std::string(linkError);
|
||||||
#if ISPC_LLVM_VERSION <= ISPC_LLVM_3_7
|
|
||||||
if (llvm::Linker::LinkModules(module, bcModule
|
#if ISPC_LLVM_VERSION <= ISPC_LLVM_3_5 // 3.2-3.5
|
||||||
#else // LLVM 3.8+
|
if (llvm::Linker::LinkModules(module, bcModule,
|
||||||
if (llvm::Linker::linkModules(*module, *bcModule
|
llvm::Linker::DestroySource,
|
||||||
#endif
|
|
||||||
#if ISPC_LLVM_VERSION <= ISPC_LLVM_3_5
|
|
||||||
, llvm::Linker::DestroySource,
|
|
||||||
&linkError))
|
&linkError))
|
||||||
Error(SourcePos(), "Error linking stdlib bitcode: %s", linkError.c_str());
|
Error(SourcePos(), "Error linking stdlib bitcode: %s", linkError.c_str());
|
||||||
#else // LLVM 3.6+
|
#elif ISPC_LLVM_VERSION <= ISPC_LLVM_3_7 // 3.6-3.7
|
||||||
)) {}
|
llvm::Linker::LinkModules(module, bcModule);
|
||||||
|
#else // LLVM 3.8+
|
||||||
|
// TODO: Pass diagnostic function for proper error reporting.
|
||||||
|
llvm::Linker::linkModules(*module, *bcModule, nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lSetInternalFunctions(module);
|
lSetInternalFunctions(module);
|
||||||
if (symbolTable != NULL)
|
if (symbolTable != NULL)
|
||||||
lAddModuleSymbols(module, symbolTable);
|
lAddModuleSymbols(module, symbolTable);
|
||||||
|
|||||||
Reference in New Issue
Block a user