[PDB] Emit index/offset pairs for TPI and IPI streams
authorReid Kleckner <rnk@google.com>
Tue, 11 Apr 2017 16:26:15 +0000 (16:26 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 11 Apr 2017 16:26:15 +0000 (16:26 +0000)
commit6e545ffc4e99b16cab6494eba21dd3b6cf06ee68
tree90459834c4fa5cc9175e13e308fe91ddb246c659
parent83d37dc0662ceb4489fceda0d3044a08ef5a6159
[PDB] Emit index/offset pairs for TPI and IPI streams

Summary:
This lets PDB readers lookup type record data by type index in O(log n)
time. It also enables makes `cvdump -t` work on PDBs produced by LLD.
cvdump will not dump a PDB that doesn't have an index-to-offset table.

The table is sorted by type index, and has an entry every 8KB. Looking
up a type record by index is a binary search of this table, followed by
a scan of at most 8KB.

Reviewers: ruiu, zturner, inglorion

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31636

llvm-svn: 299958
lld/test/COFF/pdb.test
llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp
llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
llvm/test/DebugInfo/PDB/pdb-yaml-types.test [new file with mode: 0644]