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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 15:26:09 PDT 2017


pcc added a comment.

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

> So the idea is to essentially force callers to supply a linkage type and a filename so that they have to think about this stuff, and then say "If you don't have a linkage type, just pass ExternalLinkage and a dummy filename"?


Yes.

> And then always call getRealLinkageName inside getGUID to correctly handle IRNames and hope that nobody ever has a non-IR name that starts in "\x01"?

The getGUID function should only be taking IR names, never mangled names. To express a mangled name starting with "\x01" you would use something like "\x01\x01foo".

It is unfortunate that we have at least three kinds of names: IR names, getRealLinkageName() and true mangled names as used in object files. I hope we can at least be able to merge the last two in the future, but for now there should be clear comments explaining the different types of names.


https://reviews.llvm.org/D31444





More information about the llvm-commits mailing list