[PATCH] D101125: [Debug-Info][NFC] add a wrapper for Die.addValue

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 19:38:21 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h:79
 
+  template <class T>
+  void addAttribute(DIEValueList &Die, BumpPtrAllocator &Alloc,
----------------
I'd prefer 'typename' rather than 'class' here (since that's what templates really take - types of any kind, not only classes). I think LLVM probably leans that way generally.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h:82
+                    dwarf::Attribute Attribute, dwarf::Form Form, T &&Value) {
+    Die.addValue(Alloc, DIEValue(Attribute, Form, std::forward<T>(Value)));
+  }
----------------
Perhaps this function could use the DIEValueAllocator member directly, rather than having to pass it in - since all the callers pass the same value?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101125



More information about the llvm-commits mailing list