Reapply r194218 with fix:
authorBill Wendling <isanbard@gmail.com>
Thu, 16 Jan 2014 06:29:36 +0000 (06:29 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 16 Jan 2014 06:29:36 +0000 (06:29 +0000)
commita950ad4eec1b0ff3c1a83e9d8ccba9dc36995352
tree270aa747069de45c560c0d1e6dd3d81f25808db6
parentfab01c190883724f92111e5bdb4d4d82748284eb
Reapply r194218 with fix:

Move copying of global initializers below the cloning of functions.

The BlockAddress doesn't have access to the correct basic blocks until the
functions have been cloned. This causes the BlockAddress to point to the old
values. Just wait until the functions have been cloned before copying the
initializers.
PR13163

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199354 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Linker/LinkModules.cpp
unittests/Linker/CMakeLists.txt [new file with mode: 0644]
unittests/Linker/LinkModulesTest.cpp [new file with mode: 0644]
unittests/Linker/Makefile [new file with mode: 0644]
unittests/Makefile