[llvm-commits] [llvm] r135204 - /llvm/trunk/lib/Linker/LinkModules.cpp
Devang Patel
dpatel at apple.com
Thu Jul 14 15:13:07 PDT 2011
Author: dpatel
Date: Thu Jul 14 17:13:07 2011
New Revision: 135204
URL: http://llvm.org/viewvc/llvm-project?rev=135204&view=rev
Log:
Link NamedMDNode before linking function bodies.
Modified:
llvm/trunk/lib/Linker/LinkModules.cpp
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=135204&r1=135203&r2=135204&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Thu Jul 14 17:13:07 2011
@@ -896,6 +896,11 @@
// 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 @@
// 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();
More information about the llvm-commits
mailing list