mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Implement function prefix data as an IR feature.
Previous discussion: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html Differential Revision: http://llvm-reviews.chandlerc.com/D1191 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190773 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1260,6 +1260,13 @@ bool ModuleLinker::run() {
|
||||
// Skip if not linking from source.
|
||||
if (DoNotLinkFromSource.count(SF)) continue;
|
||||
|
||||
Function *DF = cast<Function>(ValueMap[SF]);
|
||||
if (SF->hasPrefixData()) {
|
||||
// Link in the prefix data.
|
||||
DF->setPrefixData(MapValue(
|
||||
SF->getPrefixData(), ValueMap, RF_None, &TypeMap, &ValMaterializer));
|
||||
}
|
||||
|
||||
// Skip if no body (function is external) or materialize.
|
||||
if (SF->isDeclaration()) {
|
||||
if (!SF->isMaterializable())
|
||||
@@ -1268,7 +1275,7 @@ bool ModuleLinker::run() {
|
||||
return true;
|
||||
}
|
||||
|
||||
linkFunctionBody(cast<Function>(ValueMap[SF]), SF);
|
||||
linkFunctionBody(DF, SF);
|
||||
SF->Dematerialize();
|
||||
}
|
||||
|
||||
@@ -1296,6 +1303,14 @@ bool ModuleLinker::run() {
|
||||
continue;
|
||||
|
||||
Function *DF = cast<Function>(ValueMap[SF]);
|
||||
if (SF->hasPrefixData()) {
|
||||
// Link in the prefix data.
|
||||
DF->setPrefixData(MapValue(SF->getPrefixData(),
|
||||
ValueMap,
|
||||
RF_None,
|
||||
&TypeMap,
|
||||
&ValMaterializer));
|
||||
}
|
||||
|
||||
// Materialize if necessary.
|
||||
if (SF->isDeclaration()) {
|
||||
|
Reference in New Issue
Block a user