[PATCH] D64407: [DWARF] Simplify DWARFAttribute. NFC.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 20:19:53 PDT 2019


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


================
Comment at: include/llvm/DebugInfo/DWARF/DWARFAttribute.h:34
 
-  DWARFAttribute(uint32_t O, dwarf::Attribute A = dwarf::Attribute(0),
-                 dwarf::Form F = dwarf::Form(0)) : Attr(A), Value(F) {}
+  DWARFAttribute() = default;
 
----------------
dblaikie wrote:
> dblaikie wrote:
> > Remove this ctor since it's the same as the implicit default ctor now.
> This should be written as:
> 
>   DWARFFormValue Value;
> 
> There's no need to explicitly default construct & then copy construct the object - the default constructor will be called implicitly.
Well, I usually prefer more explicit code because it is just simpler to understand, hoping that the optimizer will remove any redundancy. But let it be as you said.


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

https://reviews.llvm.org/D64407





More information about the llvm-commits mailing list