diff options
author | Adrian Prantl <aprantl@apple.com> | 2013-11-09 00:43:18 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2013-11-09 00:43:18 +0000 |
commit | 999ffb6085a6e24261680b41d4f43ad4ba8fd250 (patch) | |
tree | 695a40407468402119f51eab06f7384f88ca03ff /lib/Linker | |
parent | ab6f27c7ff043f393e1831d35f596b50be959cdb (diff) | |
download | llvm-999ffb6085a6e24261680b41d4f43ad4ba8fd250.tar.gz llvm-999ffb6085a6e24261680b41d4f43ad4ba8fd250.tar.bz2 llvm-999ffb6085a6e24261680b41d4f43ad4ba8fd250.tar.xz |
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
Diffstat (limited to 'lib/Linker')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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(); |