[Lldb-commits] [PATCH] D114627: [lldb] add new overload for SymbolFile::FindTypes that accepts a scope

Andy Yankovsky via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 7 07:24:19 PST 2021


werat added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2461
+  bool has_scope = !scope.IsEmpty();
+  llvm::StringRef sc(scope.GetStringRef());
+  std::string storage;
----------------
nit: maybe call it `scope_ref`?


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2470
+      const char *qn = die.GetQualifiedName(storage);
+      if (qn && !llvm::StringRef(qn).startswith(sc))
+        return true;
----------------
`llvm::StringRef(storage)` is slightly more efficient here than `llvm::StringRef(qn)`. The latter uses strlen in the constructor to calculate the length of the source string.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114627



More information about the lldb-commits mailing list