[Lldb-commits] [PATCH] D151813: [lldb] Take StringRef names in GetChildAtNamePath (NFC)

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 31 10:11:43 PDT 2023


bulbazord accepted this revision.
bulbazord added inline comments.


================
Comment at: lldb/source/Core/ValueObject.cpp:434
   ValueObjectSP root(GetSP());
-  for (ConstString name : names) {
+  for (auto name : names) {
     root = root->GetChildMemberWithName(name, true);
----------------
kastiglione wrote:
> JDevlieghere wrote:
> > I don’t think this qualifies for ‘auto’ according to the LLVM coding guidelines.
> I find the guidelines to be not specific enough. Case in point, this section shows `auto` being used in range for loops: https://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto
nit: mark `name` as `const` -> `const auto name`.
I suppose it's ok if it's a copy since it's a StringRef and it's less expensive to make the copy?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151813



More information about the lldb-commits mailing list