Simplify the handling of aliases in the gold plugin.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 10 Dec 2014 00:09:35 +0000 (00:09 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 10 Dec 2014 00:09:35 +0000 (00:09 +0000)
commitd3732d9095052e6c01846354b5cb167437842cbe
tree0e3a6a0471bd923b497ae6328760e9452d0777bb
parent605c40341b57a61058800c5852c97265bbc9de48
Simplify the handling of aliases in the gold plugin.

The complicated situation is when we have to keep an alias but drop a GV
that is part of the aliasee.

We used to clone the dropped GV and make the clone internal. This is wasteful
as we know the original will be dropped.

With this patch what is done instead is set the linkage of the original to
internal and replace all uses (but the one in the alias) with a new
declaration that takes the name of the old GV. This saves us from having
to copy the body.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223863 91177308-0d34-0410-b5e6-96231b3b80d8
tools/gold/gold-plugin.cpp