[PATCH] D155723: [DWARFVerifier] Allow simplified template names in debug_name

Felipe de Azevedo Piovezan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 10:39:55 PDT 2023


fdeazeve added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp:1354
 
 static SmallVector<StringRef, 2> getNames(const DWARFDie &DIE,
+                                          bool IncludeStrippedTemplateNames,
----------------
avl wrote:
> probably use 3 here as initial size? As it may return three names now.
Good call


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp:1363
+              StripTemplateParameters(Result.back()))
+        Result.push_back(*StrippedName);
+    }
----------------
avl wrote:
> nit: other places use emplace_back.
Other places have a `const char*`, which is why they emplace, not push. In the grand scheme of things, either will generate the same code, but I think the `push` here is the more expressive call: we are communicating that we already have a StringRef. Do you agree?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155723



More information about the llvm-commits mailing list