jimingham wrote:

Not sure why you say "SBTarget::FindFirstType" is a replacement for the deeper 
search, since it will search the whole type landscape which is what your search 
allows us to avoid...

You could make this API more general by adding a "depth" parameter:

SBType::FindNestedTypes(const char *name, uint32_t depth);


Your use case would pass depth of 1, and retain the speed you intend, but allow 
for more general searches.

If you do that I think the API is great.  If you still just want to do 1 level 
depth search, then I think you have to reflect that more clearly in the name.  
I would NOT expect FindNestedType to only search one level deep because that's 
the only way it would be guaranteed to only return a singular type.  If you 
want to keep it this way, you should do something like "FindDirectlyNestedType" 
though that makes it more obvious that this is an oddly limited API...

Jim


> On Oct 10, 2023, at 9:58 AM, Vlad Serebrennikov ***@***.***> wrote:
> 
> 
> Is FindNestedType guaranteed to have a single return?
> 
> Yes, because search is not recursive, i.e. doesn't search inside nested types.
> I'm intentionally specifying FindNestedType this way, because I'd like it to 
> not do too much to remain fast by design, and I'm yet to see a use case when 
> I'd be interested in type NN, buried inside arbitrary number of intervening 
> nested types. Even if there is such use case, SBTarget::FindFirstType could 
> be a better fit to address it.
> 
> —
> Reply to this email directly, view it on GitHub 
> <https://github.com/llvm/llvm-project/pull/68705#issuecomment-1755870685>, or 
> unsubscribe 
> <https://github.com/notifications/unsubscribe-auth/ADUPVW24DW7TW3NAJT7XNJDX6V5BTAVCNFSM6AAAAAA52MJQ3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVHA3TANRYGU>.
> You are receiving this because your review was requested.
> 



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

Reply via email to