[PATCH] D31444: LTO: call getRealLinkageName on IRNames before feeding to getGUID

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 15:10:38 PDT 2017


tejohnson added a comment.

In https://reviews.llvm.org/D31444#713537, @inglorion wrote:

> > static GUID getGUID(StringRef Name, GlobalValue::LinkageTypes Linkage, StringRef FileName);
>
> That crossed my mind as well, but it would need 3 pieces of information, and we have only 1 in LTO::GlobalResolution. Plus the type id awkwardness that pcc mentioned. You also still need to deal with IRNames and linkage names. In other words, having everything go through that static method would reduce the number of getGUID methods from 2 to 1, which is good, but what is the proposal for making sure it is invoked correctly?


By forcing through a single interface that invokes getGlobalIdentifier under the cover, we can ensure the symbols all go through handling such as getRealLinkageName. It is a bit awkward in places where we don't have a linkage type, but in those cases we could presumably default linkage type to global so that no renaming is done.


https://reviews.llvm.org/D31444





More information about the llvm-commits mailing list