[llvm] r366188 - [DWARF] Simplify DWARFAttribute. NFC.

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 23:53:06 PDT 2019


Author: ikudrin
Date: Mon Jul 15 23:53:06 2019
New Revision: 366188

URL: http://llvm.org/viewvc/llvm-project?rev=366188&view=rev
Log:
[DWARF] Simplify DWARFAttribute. NFC.

The first argument in the constructor was ignored, and the remaining
arguments were always passed as their defaults.

Differential Revision: https://reviews.llvm.org/D64407

Modified:
    llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
    llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp

Modified: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAttribute.h?rev=366188&r1=366187&r2=366188&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAttribute.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAttribute.h Mon Jul 15 23:53:06 2019
@@ -27,13 +27,10 @@ struct DWARFAttribute {
   /// The debug info/types section byte size of the data for this attribute.
   uint32_t ByteSize = 0;
   /// The attribute enumeration of this attribute.
-  dwarf::Attribute Attr;
+  dwarf::Attribute Attr = dwarf::Attribute(0);
   /// The form and value for this attribute.
   DWARFFormValue Value;
 
-  DWARFAttribute(uint32_t O, dwarf::Attribute A = dwarf::Attribute(0),
-                 dwarf::Form F = dwarf::Form(0)) : Attr(A), Value(F) {}
-
   bool isValid() const {
     return Offset != 0 && Attr != dwarf::Attribute(0);
   }
@@ -45,13 +42,6 @@ struct DWARFAttribute {
   /// Identifies DWARF attributes that may contain a reference to a
   /// DWARF expression.
   static bool mayHaveLocationDescription(dwarf::Attribute Attr);
-
-  void clear() {
-    Offset = 0;
-    ByteSize = 0;
-    Attr = dwarf::Attribute(0);
-    Value = DWARFFormValue();
-  }
 };
 
 } // end namespace llvm

Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp?rev=366188&r1=366187&r2=366188&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp Mon Jul 15 23:53:06 2019
@@ -663,7 +663,7 @@ iterator_range<DWARFDie::attribute_itera
 }
 
 DWARFDie::attribute_iterator::attribute_iterator(DWARFDie D, bool End)
-    : Die(D), AttrValue(0), Index(0) {
+    : Die(D), Index(0) {
   auto AbbrDecl = Die.getAbbreviationDeclarationPtr();
   assert(AbbrDecl && "Must have abbreviation declaration");
   if (End) {
@@ -693,7 +693,7 @@ void DWARFDie::attribute_iterator::updat
     AttrValue.ByteSize = ParseOffset - AttrValue.Offset;
   } else {
     assert(Index == NumAttrs && "Indexes should be [0, NumAttrs) only");
-    AttrValue.clear();
+    AttrValue = {};
   }
 }
 




More information about the llvm-commits mailing list