[Lldb-commits] [PATCH] D47147: DWARFIndex: Reduce duplication in the GetFunctions methods
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon May 21 14:24:19 PDT 2018
clayborg added a comment.
Before I look too closely, we can probably add a DWARFDIE accessor function like:
bool DWARFDIE::IsClassMethod() const;
Then this would allow each DWARFIndex to just check and we might be able to get rid of the 3 lists in GetFunctionsByBaseOrMethodName? Seems like it shouldn't be hard for the index to weed these things out. Or we can add a generic layer into the DWARFIndex base class that the different indexes can call to weed out the things that aren't wanted. The earlier we can weed things out the better. so the index might return 20 matches, but it would be nice to weed out any mismatches as soon as possible so we can avoid creating any clang AST types for the functions/methods if we don't need do.
The example I am thinking of is "search for all methods called 'erase'" where the index might just be able to lookup "erase" and get 20 matches, but then before we realize/make any clang AST types, we would quickly call "DWARFDIE::IsClassMethod()" on it to weed out any mismatches before we hand them back. Let me know if that makes sense or if I am missing anything. I would like the DWARFIndex class to be as dead simple as possible.
https://reviews.llvm.org/D47147
More information about the lldb-commits
mailing list