Revert r221096 bringing back r221014 with a fix.
authorRafael Espindola <rafael.espindola@gmail.com>
Sun, 2 Nov 2014 13:28:57 +0000 (13:28 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sun, 2 Nov 2014 13:28:57 +0000 (13:28 +0000)
commit778fcc770b249fbc0157c50318825c931ee9f485
treec8e81736a08789375b32273b37039b110adda56b
parent8cb7876cb366b5803ca35d92313ea00eadf29b78
Revert r221096 bringing back r221014 with a fix.

The issue was that linkAppendingVarProto does the full linking job, including
deleting the old dst variable. The fix is just to call it and return early
if we have a GV with appending linkage.

original message:

    Refactor duplicated code in liking GlobalValues.

    There is quiet a bit of logic that is common to any GlobalValue but was
    duplicated for Functions, GlobalVariables and GlobalAliases.

    While at it, merge visibility even when comdats are used, fixing pr21415.

llvm-svn: 221098
llvm/lib/Linker/LinkModules.cpp
llvm/test/Linker/Inputs/visibility.ll
llvm/test/Linker/visibility.ll