LLVM  8.0.1
DWARFAttribute.h
Go to the documentation of this file.
1 //===- DWARFAttribute.h -----------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_DWARFATTRIBUTE_H
11 #define LLVM_DEBUGINFO_DWARFATTRIBUTE_H
12 
15 #include <cstdint>
16 
17 namespace llvm {
18 
19 //===----------------------------------------------------------------------===//
20 /// Encapsulates a DWARF attribute value and all of the data required to
21 /// describe the attribute value.
22 ///
23 /// This class is designed to be used by clients that want to iterate across all
24 /// attributes in a DWARFDie.
26  /// The debug info/types offset for this attribute.
28  /// The debug info/types section byte size of the data for this attribute.
30  /// The attribute enumeration of this attribute.
32  /// The form and value for this attribute.
34 
36  dwarf::Form F = dwarf::Form(0)) : Attr(A), Value(F) {}
37 
38  bool isValid() const {
39  return Offset != 0 && Attr != dwarf::Attribute(0);
40  }
41 
42  explicit operator bool() const {
43  return isValid();
44  }
45 
46  void clear() {
47  Offset = 0;
48  ByteSize = 0;
49  Attr = dwarf::Attribute(0);
50  Value = DWARFFormValue();
51  }
52 };
53 
54 } // end namespace llvm
55 
56 #endif // LLVM_DEBUGINFO_DWARFATTRIBUTE_H
dwarf::Attribute Attr
The attribute enumeration of this attribute.
This class represents lattice values for constants.
Definition: AllocatorList.h:24
Attribute
Attributes.
Definition: Dwarf.h:115
uint32_t ByteSize
The debug info/types section byte size of the data for this attribute.
F(f)
DWARFFormValue Value
The form and value for this attribute.
Encapsulates a DWARF attribute value and all of the data required to describe the attribute value...
DWARFAttribute(uint32_t O, dwarf::Attribute A=dwarf::Attribute(0), dwarf::Form F=dwarf::Form(0))
uint32_t Offset
The debug info/types offset for this attribute.
This file contains constants used for implementing Dwarf debug support.
bool isValid() const