[Lldb-commits] [PATCH] D53662: Give the SymbolFile plugin enough information to efficiently do exact match lookups

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 26 09:36:33 PDT 2018


Ok, that reasoning makes sense, I’ll see what i can do
On Fri, Oct 26, 2018 at 9:25 AM Greg Clayton via Phabricator <
reviews at reviews.llvm.org> wrote:

> clayborg added a comment.
>
> My issue with adding "exact_match" is it renders a few of the arguments
> useless:
>
>   size_t FindTypes(
>     const SymbolContext &sc,
>     llvm::StringRef name,
>     const CompilerDeclContext *parent_decl_ctx,
>     bool exact_match,
>     ...);
>
> With exact_match "parent_decl_ctx" is useless and possible the symbol
> context too. The FindTypes as written today was used for two cases which
> evolved over time:
>
> - finding types for users without needing to be fully qualified
> - finding types for the expression parser in a specific context
>
> To fulfill these two cases, arguments have been added over time. As we
> keep adding arguments we make the function even harder to implement for
> SymbolFile subclasses. So as long as we are cleaning things up, it might be
> time to factor this out by making changes now.
>
> Another complexity is that we can either search a single module or
> multiple modules when doing searches, and that is why we have
> Module::FindTypes_Impl(...) in since there is some work that needs to be
> done when we are searching by basename only (strip the context and search
> by basename, then filters matches afterward.
>
> That is why I was thinking we might want to make changes. Seems like
> having:
>
>   size_t FindTypesByBasename(
>     const SymbolContext &sc,
>     llvm::StringRef name,
>     const CompilerDeclContext *parent_decl_ctx
>     ...);
>
>   size_t FindTypesByFullname(llvm::StringRef name, ...);
>
> Clients of the first call must strip a typename to its identifier name
> prior to calling, and clients of the second can call with a fully qualified
> typename.
>
>
> https://reviews.llvm.org/D53662
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181026/ace53046/attachment.html>


More information about the lldb-commits mailing list