diff options
author | Tanya Lattner <tonic@nondot.org> | 2011-10-14 22:17:46 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2011-10-14 22:17:46 +0000 |
commit | ea166d44e7dde9f197e8ec0d73342a22a77aec04 (patch) | |
tree | 0df70265fe7ad9301a984c42dbbe43aef6d6a88c /llvm/lib/Linker | |
parent | 03d1ed304b782c3983a2b445bf93733abd3580ef (diff) | |
download | bcm5719-llvm-ea166d44e7dde9f197e8ec0d73342a22a77aec04.tar.gz bcm5719-llvm-ea166d44e7dde9f197e8ec0d73342a22a77aec04.zip |
Allow the source module to be materialized during the linking process.
llvm-svn: 142010
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 4ccabcf5860..03a962e3be5 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -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); } |