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

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


This revision was automatically updated to reflect the committed changes.
Closed by commit rL366188: [DWARF] Simplify DWARFAttribute. NFC. (authored by ikudrin, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D64407?vs=209116&id=210027#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D64407

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


Index: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
===================================================================
--- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
+++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
@@ -27,13 +27,10 @@
   /// 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 @@
   /// 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
Index: llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -663,7 +663,7 @@
 }
 
 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 @@
     AttrValue.ByteSize = ParseOffset - AttrValue.Offset;
   } else {
     assert(Index == NumAttrs && "Indexes should be [0, NumAttrs) only");
-    AttrValue.clear();
+    AttrValue = {};
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64407.210027.patch
Type: text/x-patch
Size: 1874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190716/89b6daff/attachment.bin>


More information about the llvm-commits mailing list