mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
Allow the source module to be materialized during the linking process.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142010 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -951,8 +951,17 @@ bool ModuleLinker::run() {
|
|||||||
// Link in the function bodies that are defined in the source module into
|
// Link in the function bodies that are defined in the source module into
|
||||||
// DstM.
|
// DstM.
|
||||||
for (Module::iterator SF = SrcM->begin(), E = SrcM->end(); SF != E; ++SF) {
|
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);
|
linkFunctionBody(cast<Function>(ValueMap[SF]), SF);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user