summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-09-16 01:08:15 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-09-16 01:08:15 +0000
commit3fa50f9b0529f046c27a0a9d7f93732138638a6c (patch)
tree5839a9eb7a11a3ca38a19c38dbb0cd1760ee7e5e /llvm/lib/Linker
parent3ee2bf6a627fcd2e872eaa748bb886ff3d4faa12 (diff)
downloadbcm5719-llvm-3fa50f9b0529f046c27a0a9d7f93732138638a6c.tar.gz
bcm5719-llvm-3fa50f9b0529f046c27a0a9d7f93732138638a6c.zip
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 llvm-svn: 190773
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 4fffa55fe4d..c3bcbcf8f35 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -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()) {
OpenPOWER on IntegriCloud