This is an archive of the discontinued LLVM Phabricator instance.

[PDB] Use one func id DenseMap instead of per-source maps, NFC
ClosedPublic

Authored by rnk on Sep 30 2020, 2:54 PM.

Details

Summary

This avoids some DenseMap copies when /Zi is in use, and results in
fewer data structures.

Diff Detail

Event Timeline

rnk created this revision.Sep 30 2020, 2:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2020, 2:54 PM
rnk requested review of this revision.Sep 30 2020, 2:54 PM
aganea accepted this revision.Sep 30 2020, 4:39 PM

Looks good, thanks!

lld/COFF/DebugTypes.cpp
661

Before, we were calling this if, even for non-uniqued records, meaning that we were doing (potentially) too many insertions. Now this happens only for 'unique' records, do I understand that well?

This revision is now accepted and ready to land.Sep 30 2020, 4:39 PM
rnk added inline comments.Sep 30 2020, 4:54 PM
lld/COFF/DebugTypes.cpp
661

Yes. Previously, each source had its own map, which needed to to contain all LF_FUNC_ID records even if they were not unique. Now, because we later merge together all the mappings from all the sources, we have one map that is a complete global mapping from func id to type for the final PDB.

This revision was landed with ongoing or failed builds.Oct 1 2020, 12:22 PM
This revision was automatically updated to reflect the committed changes.