Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Looks ok but a couple of clarifying questions below.
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | ||
---|---|---|
956 ↗ | (On Diff #105349) | Out of curiosity, couldn't the Hasher be updated with the contents of the StrtabBuilder when we writeModuleHash? I guess that would require finalizing the StrtabBuilder a little earlier - ah, we need to add to the StrtabBuilder when building the symtab. |
llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp | ||
660 ↗ | (On Diff #105349) | It's unfortunate that we need to explicitly pass in the expected strtab contents rather than just using the STRTAB_BLOB, but I guess here too the issue is that the final strtab included strings that were in the symtab that we didn't have when writing the module hash? |
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | ||
---|---|---|
956 ↗ | (On Diff #105349) | Yes, or when adding other modules to the bitcode file. |
llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp | ||
660 ↗ | (On Diff #105349) | Right. We could also in principle teach llvm-bcanalyzer about the various records that may refer to the string table, and have it include the hashes of those strings in the hash it computes here, but that seems more complicated than called for here (for one thing, it would require multiple passes over the bitcode file). I guess that requiring the user to provide the string table also has the side benefit of having the test verify that the string table contents are as expected. |
LGTM
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | ||
---|---|---|
956 ↗ | (On Diff #105349) | Ah, forgot about other modules. |