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

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 31 10:37:14 PDT 2023


kastiglione 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);
----------------
bulbazord wrote:
> 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?
yes I figure a StringRef is cheap to 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