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

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 11:44:25 PDT 2017


rnk added a comment.

In https://reviews.llvm.org/D31444#712724, @pcc wrote:

> So maybe we should have just one static function:
>
>   static GUID getGUID(StringRef Name, GlobalValue::LinkageTypes Linkage, StringRef FileName);
>
> That should hopefully make the API harder to misuse.


+1

If we really wanted to fix this with a giant hammer, these APIs shouldn't take strings at all. They should take some type that indicates if the name comes from bitcode or an object file, and we should run the IR mangler on IR names to get the object file names. This would remove the need for the MachO-specific underscore removal hack in `computeGUIDPreservedSymbols`, which looks like it's trying to map from object file names back to IR names. That code is probably broken on Windows.


https://reviews.llvm.org/D31444





More information about the llvm-commits mailing list