[Lldb-commits] [lldb] [llvm] [CodeView] Resolve all forward referenced types from TPI stream (PR #193064)

via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 28 04:00:26 PDT 2026


Nerixyz wrote:

> Shouldn’t it update all references to the old full type index 0x1006 to the new full type index 0x1008?

The only reference to that record is in the TPI hash table. Note that the `(-> 0x1234)` annotation comes from LLVM and that it's not encoded in the PDB.

My guess is that MSVC does it this intentionally to avoid having to re-emit the whole TPI stream. They only need to append the new types which should be relatively few. If they were to remove unreferenced types, they'd need to keep some ref-count for them.

For us, it would be enough if the unreferenced types would be removed from the hash table or if they were replaced by a tombstone record.

Not sure if this is a bug, because there's no spec/docs for the TPI stream. Maybe someone from Microsoft knows more about this?

> There's an additional complexity here: in some situations, the TPI stream carries a hash adjuster table which is used to point to adequate type indexes without having to rewrite everything, but it seems to it is not used by the compiler in this situation. I think we should be supporting that scenario already.

You're right, they're not used here. I also verified this by using a PDB built from yaml2pdb where this adjuster is absent. We don't use the hash adjusters at all except when dumping.

My main concern with the symbol scanning is that it would be slow, because we'd read all module streams synchronously.

https://github.com/llvm/llvm-project/pull/193064


More information about the lldb-commits mailing list