Michael137 wrote:

> > As an alternative, we might be able to make the die-to-type map shared 
> > between all symbol files in a debug map (similar to how "unique dwarf ast 
> > type map" is shared).
> 
> Yea I considered that, but I was concerned with the unforeseen complications 
> this might have. Particularly I'm not sure how the `TypeSP` ownership should 
> be managed. IIUC, a `TypeSP` is solely supposed to be owned by a single 
> `SymbolFile` (`MakeType` kind of binds the two together). But then if we 
> bundled `TypeSP`s from different modules into a single map on 
> `SymbolFileDWARFDebugMap`, could we run into issues if one of the 
> `SymbolFile`'s gets torn down (if that can happen)? Though I'm also not 
> certain that we _only_ store `TypeSP`s inside the `SymbolFileDWARF`. I don't 
> think there's anything asserting/enforcing this.

On second thought, this does feel more consistent with how all the other 
bookkeeping structures already work. And re. the ownership, my current patch 
pretty much achieves the same thing (but possibly in a less apparent manner). 
I'm still mixing `Type*` into `GetDIEToType` of a different `SymbolFile`. And 
the `UniqueDWARFASTType` owns a `TypeSP`, and we are sharing those via a 
debug-map. So I'll go with this suggestion. Confirmed that this does fix the 
test attached test-case

https://github.com/llvm/llvm-project/pull/120569
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to