1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Allow the source module to be materialized during the linking process.

llvm-svn: 142010
This commit is contained in:
Tanya Lattner 2011-10-14 22:17:46 +00:00
parent 96976108b1
commit 7feda80474

View File

@ -951,8 +951,17 @@ bool ModuleLinker::run() {
// Link in the function bodies that are defined in the source module into
// DstM.
for (Module::iterator SF = SrcM->begin(), E = SrcM->end(); SF != E; ++SF) {
// Skip if no body (function is external) or marked to skip.
if (SF->isDeclaration() || DoNotLinkFromSource.count(SF)) continue;
// Skip if not linking from source.
if (DoNotLinkFromSource.count(SF)) continue;
// Skip if no body (function is external) or materialize.
if (SF->isDeclaration()) {
if (!SF->isMaterializable())
continue;
if (SF->Materialize(&ErrorMsg))
return true;
}
linkFunctionBody(cast<Function>(ValueMap[SF]), SF);
}