[PATCH] D84803: [ThinLTO][MachO] Preserve both possible GUIDs from exported list

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 13:30:23 PDT 2020


steven_wu added a comment.

In D84803#2185566 <https://reviews.llvm.org/D84803#2185566>, @mehdi_amini wrote:

> So `getGlobalIdentifier` removes the leading `\01` because it only indicates that the symbol is already mangled, but on the other hand does not apply the platform mangling when there isn't a `\01`? It seems inconsistent isn't it? Could `getGlobalIdentifier` mangle the symbol when there isn't the leading `\01`?

That is the other option. I am not sure if what the impact of that will be, especially on PGO. Let me try that.



================
Comment at: llvm/lib/LTO/ThinLTOCodeGenerator.cpp:280
+    // symbols "_$NAME", we need to preserve the corresponding GUID for "$NAME"
+    // and "\01_$NAME".
     if (TheTriple.isOSBinFormatMachO() && Name.size() > 0 && Name[0] == '_')
----------------
tejohnson wrote:
> The code doesn't seem to match the new comment. Should it be also preserving "\01_$NAME"?
It does. The GUID for "\01_$NAME" is computed from "_$NAME" as indicated in getGlobalIdentifier()


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84803/new/

https://reviews.llvm.org/D84803



More information about the llvm-commits mailing list