This is an archive of the discontinued LLVM Phabricator instance.

[pdb] Merge PublicsStreamBuilder and GlobalsStreamBuilder
ClosedPublic

Authored by zturner on Aug 8 2017, 2:37 PM.

Details

Summary

the publics stream and globals stream are very similar. They both contain a list of hash buckets that refer into a single shared stream, the symbol record stream. Because of the need for each builder to manage both an independent hash stream as well as a single shared record stream, making the two builders be independent entities is not the right design. This patch merges them into a single class, of which only a single instance is needed to create all 3 streams. PublicsStreamBuilder and GlobalsStreamBuilder are now merged into the single GSIStreamBuilder class, which writes all 3 streams at once.

Note that this patch does not contain any functionality change. So we're still not yet writing any records to the globals stream. All we're doing is making it so that when we do start writing records to the globals, this refactor won't have to be part of that patch.

Diff Detail

Event Timeline

zturner created this revision.Aug 8 2017, 2:37 PM
rnk added inline comments.Aug 8 2017, 2:50 PM
lld/COFF/PDB.cpp
644

Rename the local?

llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
45

These method bodies are long. We should sink them out of the class definition to reduce indentation.

rnk accepted this revision.Aug 8 2017, 3:02 PM

lgtm

This revision is now accepted and ready to land.Aug 8 2017, 3:02 PM
This revision was automatically updated to reflect the committed changes.
llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp