summaryrefslogtreecommitdiff
path: root/lib/Linker
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-07-14 22:13:07 +0000
committerDevang Patel <dpatel@apple.com>2011-07-14 22:13:07 +0000
commit2959ebd14d1f98095678ae6bd8bb52ee456313cd (patch)
treee033aa840d8ec87b27792c05c89bd22470a33135 /lib/Linker
parent33c16a27370939de39679245c3dff72383c210bd (diff)
downloadllvm-2959ebd14d1f98095678ae6bd8bb52ee456313cd.tar.gz
llvm-2959ebd14d1f98095678ae6bd8bb52ee456313cd.tar.bz2
llvm-2959ebd14d1f98095678ae6bd8bb52ee456313cd.tar.xz
Link NamedMDNode before linking function bodies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135204 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkModules.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index f566c079e6..55aa9bf188 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -896,6 +896,11 @@ bool ModuleLinker::run() {
// Loop over all of the linked values to compute type mappings.
computeTypeMapping();
+ // Remap all of the named mdnoes in Src into the DstM module. We do this
+ // after linking GlobalValues so that MDNodes that reference GlobalValues
+ // are properly remapped.
+ linkNamedMDNodes();
+
// Insert all of the globals in src into the DstM module... without linking
// initializers (which could refer to functions not yet mapped over).
for (Module::global_iterator I = SrcM->global_begin(),
@@ -936,11 +941,6 @@ bool ModuleLinker::run() {
// Resolve all uses of aliases with aliasees.
linkAliasBodies();
- // Remap all of the named mdnoes in Src into the DstM module. We do this
- // after linking GlobalValues so that MDNodes that reference GlobalValues
- // are properly remapped.
- linkNamedMDNodes();
-
// Now that all of the types from the source are used, resolve any structs
// copied over to the dest that didn't exist there.
TypeMap.linkDefinedTypeBodies();