[PATCH] D35189: Add GUID-ValueID map and original name to ThinLTO summary.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 09:16:50 PDT 2017


mehdi_amini added a comment.





================
Comment at: lib/Bitcode/Writer/BitcodeWriter.cpp:3437
+  // For local linkage, we also emit the original name separately
+  // immediately after the record.
+  auto MaybeEmitOriginalName = [&](const GlobalValue &GV) {
----------------
Please add here *why* this is done, other the comment is fairly not helpful: it just tells me wha the function is doing.
I think the reason is "This is needed because promoting internal symbol to global requires generating a new GUID from the original name".
That said, unless there is another reason I missed, we could also immediately instead store two GUID for internal symbols: the local and the global.
Also, alternatively and even more simpler I think, we could just always use the global GUID for internal symbols, whether they're promoted or not.


https://reviews.llvm.org/D35189





More information about the llvm-commits mailing list