[Lldb-commits] [PATCH] D67111: Adding caching to libc++ std::function formatter for lookups that require scanning symbols

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 11 09:34:57 PDT 2019


aprantl added inline comments.


================
Comment at: source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp:196
+    
+    auto contains_lambda_identifier = []( llvm::StringRef & str_ref ) {
+        return str_ref.contains("$_") || str_ref.contains("'lambda'");
----------------
StringRefs are meant to be value types. A StringRef is only a ptr+offset so we are not being much more efficient by passing a pointer to a StringRef to a function. This should just be a StringRef value argument.


================
Comment at: source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp:275
+      if (contains_lambda_identifier(first_template_parameter) ||
           (symbol != nullptr &&
            symbol->GetName().GetStringRef().contains("__invoke"))) {
----------------
Not your code, but since you're there: `symbol &&`

Actually, this would really benefit from another descriptive helper methid since this is used in several places and not obvious to me what is being checked here. Lambda invokes, block invokes, both?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67111/new/

https://reviews.llvm.org/D67111





More information about the lldb-commits mailing list