[PATCH] D71437: [PDB] Print the most redundant type record indices with /summary
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 30 16:03:25 PST 2019
MaskRay accepted this revision.
MaskRay added inline comments.
This revision is now accepted and ready to land.
================
Comment at: lld/COFF/PDB.cpp:431
+ // collecting statistics.
+ tpiCounts.resize(tMerger.getTypeTable().size());
+ ipiCounts.resize(tMerger.getIDTable().size());
----------------
rnk wrote:
> MaskRay wrote:
> > Can `tpiCounts` be a non-empty vector before `resize()`?
> >
> > If yes, `assign(tMerger.getTypeTable().size(), 0);`
> Yes, it can be non-empty, but why is assign better? `resize()` does zero initialization, it is not reserve.
If it was non-empty, existing non-zero values would not be zeroed.
```
If the current size is less than count,
1) additional default-inserted elements are appended
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71437/new/
https://reviews.llvm.org/D71437
More information about the llvm-commits
mailing list