[Lldb-commits] [lldb] [llvm] [CodeView] Resolve all forward referenced types from TPI stream (PR #193064)
Alexandre Ganea via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 20 15:46:50 PDT 2026
================
@@ -61,8 +61,21 @@ class TpiStream {
codeview::LazyRandomTypeCollection &typeCollection() { return *Types; }
- LLVM_ABI Expected<codeview::TypeIndex>
- findFullDeclForForwardRef(codeview::TypeIndex ForwardRefTI) const;
+ /// Find all possible declarations this \p ForwardRefTI is a forward reference
+ /// for and add them to \p Decls.
+ ///
+ /// This method uses the TPI hash table to find the referenced types.
+ ///
+ /// In most cases, this should return at most one declaration. However, in
+ /// incrementally linked PDBs, there might be multiple possible records \p
+ /// ForwardRefTI could reference. From the TPI stream alone, it's not known
+ /// which record is the "real" one.
+ ///
+ /// If no type could be found, \p Decls will remain unmodified and success is
+ /// returned.
+ LLVM_ABI Error
+ findFullDeclsForForwardRef(codeview::TypeIndex ForwardRefTI,
+ SmallVectorImpl<codeview::TypeIndex> &Decls) const;
----------------
aganea wrote:
Please refer to my comment https://github.com/llvm/llvm-project/pull/193064#issuecomment-4284737639 - from the perspective a consumer of this function I find this a bit confusing: they must do further work to actually resolve the complete type. Can we rather do it ourselves here, instead of deferring that work to the caller?
https://github.com/llvm/llvm-project/pull/193064
More information about the lldb-commits
mailing list