[Lldb-commits] [lldb] [lldb] Add SBType::FindNestedType() function (PR #68705)

via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 11 10:00:14 PDT 2023


jimingham wrote:

Just to make sure I understand.  You're using FindTypes in a DeclContext using max_matches == 1.  But FindTypes will recurse in the DeclContext, so depending on the actual search implementation, you could have a situation like:

```
class A {
  class B {
       class C {
       };
   };
  class C {
  };
};

```

where if we do depth first we could start recursing down B, find A::B::C which is a match, note max_matches == 1 and return.  So this is really just FindFirstNestedType, I don't think you can make any claim about directness given how this is implemented.

I still think the idea of allowing a type search to be limited to a given type context is useful.  We usually do "FindWhatever" returning a list, and "FindFirstWhatever" returning some not described algorithm's chosen "first" match.  It's a little odd to add the "First" w/o the list version, however.

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


More information about the lldb-commits mailing list