[Lldb-commits] [PATCH] D98153: Some FormatEntity.cpp cleanup and unit testing

Neal via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 13 22:24:22 PDT 2021

nealsid marked an inline comment as done.
nealsid added inline comments.

Comment at: lldb/unittests/Core/FormatEntityTest.cpp:154
+TEST(FormatEntity, LookupAllEntriesInTree) {
+  for (const auto &testString : lookupStrings) {
+    Entry e;
teemperor wrote:
> teemperor wrote:
> > You could just use `llvm::StringRef` here (it's shorter and more descriptive than the `auto`).
> I actually meant `llvm::StringRef` as the whole type (StringRef references are not really useful as StringRef is already a lightweight String reference)
Done - kept it const since StringRef appears to depend on that for some of its methods.  I was looking through StringRef (and the use of optionals for something else) and as far as I understand, which could be entirely wrong, it's meant to provide a single interface over unowned character data whether it comes from a std::string or char*, and thought using string_view would be good, as well - is moving to C++17 on the roadmap? I know it's one of those things that everyone is in favor of and wants to do but nobody has time for :)

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list