From 999ffb6085a6e24261680b41d4f43ad4ba8fd250 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Sat, 9 Nov 2013 00:43:18 +0000 Subject: Revert "Move copying of global initializers below the cloning of functions." This would cause internal symbols that are only referenced by global initializers to be removed. This reverts commit 194219. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194304 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkModules.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/Linker') diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 00c2ed144d..8f2200e4ea 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1251,6 +1251,10 @@ bool ModuleLinker::run() { for (unsigned i = 0, e = AppendingVars.size(); i != e; ++i) linkAppendingVarInit(AppendingVars[i]); + // Update the initializers in the DstM module now that all globals that may + // be referenced are in DstM. + linkGlobalInits(); + // Link in the function bodies that are defined in the source module into // DstM. for (Module::iterator SF = SrcM->begin(), E = SrcM->end(); SF != E; ++SF) { @@ -1332,10 +1336,6 @@ bool ModuleLinker::run() { } } while (LinkedInAnyFunctions); - // Update the initializers in the DstM module now that all globals that may - // be referenced are in DstM. - linkGlobalInits(); - // 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(); -- cgit v1.2.3