LLVM  9.0.0svn
DWARFAttribute.h
Go to the documentation of this file.
1 //===- DWARFAttribute.h -----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_DWARFATTRIBUTE_H
10 #define LLVM_DEBUGINFO_DWARFATTRIBUTE_H
11 
14 #include <cstdint>
15 
16 namespace llvm {
17 
18 //===----------------------------------------------------------------------===//
19 /// Encapsulates a DWARF attribute value and all of the data required to
20 /// describe the attribute value.
21 ///
22 /// This class is designed to be used by clients that want to iterate across all
23 /// attributes in a DWARFDie.
25  /// The debug info/types offset for this attribute.
27  /// The debug info/types section byte size of the data for this attribute.
29  /// The attribute enumeration of this attribute.
31  /// The form and value for this attribute.
33 
35  dwarf::Form F = dwarf::Form(0)) : Attr(A), Value(F) {}
36 
37  bool isValid() const {
38  return Offset != 0 && Attr != dwarf::Attribute(0);
39  }
40 
41  explicit operator bool() const {
42  return isValid();
43  }
44 
45  /// Identifies DWARF attributes that may contain a reference to a
46  /// DWARF expression.
48 
49  void clear() {
50  Offset = 0;
51  ByteSize = 0;
52  Attr = dwarf::Attribute(0);
53  Value = DWARFFormValue();
54  }
55 };
56 
57 } // end namespace llvm
58 
59 #endif // LLVM_DEBUGINFO_DWARFATTRIBUTE_H
dwarf::Attribute Attr
The attribute enumeration of this attribute.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Attribute
Attributes.
Definition: Dwarf.h:114
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.
static bool mayHaveLocationDescription(dwarf::Attribute Attr)
Identifies DWARF attributes that may contain a reference to a DWARF expression.
Definition: DWARFDie.cpp:706
bool isValid() const