[ThinLTO] WeakAny fixes/cleanup
authorTeresa Johnson <tejohnson@google.com>
Tue, 10 Nov 2015 18:20:11 +0000 (18:20 +0000)
committerTeresa Johnson <tejohnson@google.com>
Tue, 10 Nov 2015 18:20:11 +0000 (18:20 +0000)
commit649084b00b5bb85507168f6a7939ef2bad3a1fd5
tree39b2a2fde4cb06ffbd8fd5429ee0c4143a45df0b
parentccb762ceea71b86cdf40af65d26ce86515037e58
[ThinLTO] WeakAny fixes/cleanup

Ensure WeakAny variables are imported as ExternalWeak declarations. To
handle WeakAny more consistently and fix this issue:

1) Update helper doImportAsDefinition to properly flag WeakAny variables
   and aliases as not importing defintions.

   Update callers of doImportAsDefinition to remove now redundant checks for
   WeakAny aliases, or ignore aliases, as appropriate.

2) Add any !doImportAsDefinition GVs to DoNotLinkFromSource set during
   linking of the GV prototype, where we usually add GVs to the
   DoNotLinkFromSource set for other reasons.

   Remove now unnecessary adding of WeakAny aliases to
   DoNotLinkFromSource set from copyGlobalAliasProto.

   Remove now unnecessary guard against linking non-imported function
   bodies from ModuleLinker::run.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252626 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Linker/LinkModules.cpp
test/Linker/funcimport.ll