[Lldb-commits] [PATCH] D61759: Switch to FindSymbolsMatchingRegExAndType() from FindFunctions() in FindLibCppStdFunctionCallableInfo()

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 9 13:53:59 PDT 2019

shafik created this revision.
shafik added reviewers: friss, jingham, jasonmolenda.

FindLibCppStdFunctionCallableInfo() currently uses FindFunctions() in order to find a lambdas `operator()()` but using `FindSymbolsMatchingRegExAndType()` is cheaper and if we also anchor the regex using `^` this adds some additional performance gains.



Index: source/Target/CPPLanguageRuntime.cpp
--- source/Target/CPPLanguageRuntime.cpp
+++ source/Target/CPPLanguageRuntime.cpp
@@ -241,8 +241,8 @@
   SymbolContextList scl;
-  target.GetImages().FindFunctions(RegularExpression{func_to_match}, true, true,
-                                   true, scl);
+  target.GetImages().FindSymbolsMatchingRegExAndType(
+      RegularExpression{R"(^)" + func_to_match}, eSymbolTypeAny, scl, true);
   // Case 1,2 or 3
   if (scl.GetSize() >= 1) {

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61759.198899.patch
Type: text/x-patch
Size: 558 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190509/11819f56/attachment.bin>

More information about the lldb-commits mailing list