llvm.org GIT mirror llvm / d296495
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366188 91177308-0d34-0410-b5e6-96231b3b80d8 Igor Kudrin 3 months ago
2 changed file(s) with 3 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
2626 /// The debug info/types section byte size of the data for this attribute.
2727 uint32_t ByteSize = 0;
2828 /// The attribute enumeration of this attribute.
29 dwarf::Attribute Attr;
29 dwarf::Attribute Attr = dwarf::Attribute(0);
3030 /// The form and value for this attribute.
3131 DWARFFormValue Value;
32
33 DWARFAttribute(uint32_t O, dwarf::Attribute A = dwarf::Attribute(0),
34 dwarf::Form F = dwarf::Form(0)) : Attr(A), Value(F) {}
3532
3633 bool isValid() const {
3734 return Offset != 0 && Attr != dwarf::Attribute(0);
4441 /// Identifies DWARF attributes that may contain a reference to a
4542 /// DWARF expression.
4643 static bool mayHaveLocationDescription(dwarf::Attribute Attr);
47
48 void clear() {
49 Offset = 0;
50 ByteSize = 0;
51 Attr = dwarf::Attribute(0);
52 Value = DWARFFormValue();
53 }
5444 };
5545
5646 } // end namespace llvm
662662 }
663663
664664 DWARFDie::attribute_iterator::attribute_iterator(DWARFDie D, bool End)
665 : Die(D), AttrValue(0), Index(0) {
665 : Die(D), Index(0) {
666666 auto AbbrDecl = Die.getAbbreviationDeclarationPtr();
667667 assert(AbbrDecl && "Must have abbreviation declaration");
668668 if (End) {
692692 AttrValue.ByteSize = ParseOffset - AttrValue.Offset;
693693 } else {
694694 assert(Index == NumAttrs && "Indexes should be [0, NumAttrs) only");
695 AttrValue.clear();
695 AttrValue = {};
696696 }
697697 }
698698