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)
commit4d47f7f52bbdcbedd5c59e6076ad68a5312f5898
treee91011f51544a2078f0f94faff59f86f6bf9b127
parent7efbac74ec2932f22ec5134d555ab9141ed8b798
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.

llvm-svn: 223863
llvm/tools/gold/gold-plugin.cpp