comparison lib/CodeGen/AsmPrinter/DIEHash.h @ 95:afa8332a0e37 LLVM3.8

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 17:48:58 +0900
parents 60c9769439b8
children 7d135dc70f03
comparison
equal deleted inserted replaced
84:f3e34b893a5f 95:afa8332a0e37
24 class CompileUnit; 24 class CompileUnit;
25 25
26 /// \brief An object containing the capability of hashing and adding hash 26 /// \brief An object containing the capability of hashing and adding hash
27 /// attributes onto a DIE. 27 /// attributes onto a DIE.
28 class DIEHash { 28 class DIEHash {
29
30 // The entry for a particular attribute.
31 struct AttrEntry {
32 const DIEValue *Val;
33 const DIEAbbrevData *Desc;
34 };
35
36 // Collection of all attributes used in hashing a particular DIE. 29 // Collection of all attributes used in hashing a particular DIE.
37 struct DIEAttrs { 30 struct DIEAttrs {
38 AttrEntry DW_AT_name; 31 DIEValue DW_AT_name;
39 AttrEntry DW_AT_accessibility; 32 DIEValue DW_AT_accessibility;
40 AttrEntry DW_AT_address_class; 33 DIEValue DW_AT_address_class;
41 AttrEntry DW_AT_allocated; 34 DIEValue DW_AT_allocated;
42 AttrEntry DW_AT_artificial; 35 DIEValue DW_AT_artificial;
43 AttrEntry DW_AT_associated; 36 DIEValue DW_AT_associated;
44 AttrEntry DW_AT_binary_scale; 37 DIEValue DW_AT_binary_scale;
45 AttrEntry DW_AT_bit_offset; 38 DIEValue DW_AT_bit_offset;
46 AttrEntry DW_AT_bit_size; 39 DIEValue DW_AT_bit_size;
47 AttrEntry DW_AT_bit_stride; 40 DIEValue DW_AT_bit_stride;
48 AttrEntry DW_AT_byte_size; 41 DIEValue DW_AT_byte_size;
49 AttrEntry DW_AT_byte_stride; 42 DIEValue DW_AT_byte_stride;
50 AttrEntry DW_AT_const_expr; 43 DIEValue DW_AT_const_expr;
51 AttrEntry DW_AT_const_value; 44 DIEValue DW_AT_const_value;
52 AttrEntry DW_AT_containing_type; 45 DIEValue DW_AT_containing_type;
53 AttrEntry DW_AT_count; 46 DIEValue DW_AT_count;
54 AttrEntry DW_AT_data_bit_offset; 47 DIEValue DW_AT_data_bit_offset;
55 AttrEntry DW_AT_data_location; 48 DIEValue DW_AT_data_location;
56 AttrEntry DW_AT_data_member_location; 49 DIEValue DW_AT_data_member_location;
57 AttrEntry DW_AT_decimal_scale; 50 DIEValue DW_AT_decimal_scale;
58 AttrEntry DW_AT_decimal_sign; 51 DIEValue DW_AT_decimal_sign;
59 AttrEntry DW_AT_default_value; 52 DIEValue DW_AT_default_value;
60 AttrEntry DW_AT_digit_count; 53 DIEValue DW_AT_digit_count;
61 AttrEntry DW_AT_discr; 54 DIEValue DW_AT_discr;
62 AttrEntry DW_AT_discr_list; 55 DIEValue DW_AT_discr_list;
63 AttrEntry DW_AT_discr_value; 56 DIEValue DW_AT_discr_value;
64 AttrEntry DW_AT_encoding; 57 DIEValue DW_AT_encoding;
65 AttrEntry DW_AT_enum_class; 58 DIEValue DW_AT_enum_class;
66 AttrEntry DW_AT_endianity; 59 DIEValue DW_AT_endianity;
67 AttrEntry DW_AT_explicit; 60 DIEValue DW_AT_explicit;
68 AttrEntry DW_AT_is_optional; 61 DIEValue DW_AT_is_optional;
69 AttrEntry DW_AT_location; 62 DIEValue DW_AT_location;
70 AttrEntry DW_AT_lower_bound; 63 DIEValue DW_AT_lower_bound;
71 AttrEntry DW_AT_mutable; 64 DIEValue DW_AT_mutable;
72 AttrEntry DW_AT_ordering; 65 DIEValue DW_AT_ordering;
73 AttrEntry DW_AT_picture_string; 66 DIEValue DW_AT_picture_string;
74 AttrEntry DW_AT_prototyped; 67 DIEValue DW_AT_prototyped;
75 AttrEntry DW_AT_small; 68 DIEValue DW_AT_small;
76 AttrEntry DW_AT_segment; 69 DIEValue DW_AT_segment;
77 AttrEntry DW_AT_string_length; 70 DIEValue DW_AT_string_length;
78 AttrEntry DW_AT_threads_scaled; 71 DIEValue DW_AT_threads_scaled;
79 AttrEntry DW_AT_upper_bound; 72 DIEValue DW_AT_upper_bound;
80 AttrEntry DW_AT_use_location; 73 DIEValue DW_AT_use_location;
81 AttrEntry DW_AT_use_UTF8; 74 DIEValue DW_AT_use_UTF8;
82 AttrEntry DW_AT_variable_parameter; 75 DIEValue DW_AT_variable_parameter;
83 AttrEntry DW_AT_virtuality; 76 DIEValue DW_AT_virtuality;
84 AttrEntry DW_AT_visibility; 77 DIEValue DW_AT_visibility;
85 AttrEntry DW_AT_vtable_elem_location; 78 DIEValue DW_AT_vtable_elem_location;
86 AttrEntry DW_AT_type; 79 DIEValue DW_AT_type;
87 80
88 // Insert any additional ones here... 81 // Insert any additional ones here...
89 }; 82 };
90 83
91 public: 84 public:
133 /// \brief Hashes the attributes in \param Attrs in order. 126 /// \brief Hashes the attributes in \param Attrs in order.
134 void hashAttributes(const DIEAttrs &Attrs, dwarf::Tag Tag); 127 void hashAttributes(const DIEAttrs &Attrs, dwarf::Tag Tag);
135 128
136 /// \brief Hashes the data in a block like DIEValue, e.g. DW_FORM_block or 129 /// \brief Hashes the data in a block like DIEValue, e.g. DW_FORM_block or
137 /// DW_FORM_exprloc. 130 /// DW_FORM_exprloc.
138 void hashBlockData(const SmallVectorImpl<DIEValue *> &Values); 131 void hashBlockData(const DIE::const_value_range &Values);
139 132
140 /// \brief Hashes the contents pointed to in the .debug_loc section. 133 /// \brief Hashes the contents pointed to in the .debug_loc section.
141 void hashLocList(const DIELocList &LocList); 134 void hashLocList(const DIELocList &LocList);
142 135
143 /// \brief Hashes an individual attribute. 136 /// \brief Hashes an individual attribute.
144 void hashAttribute(AttrEntry Attr, dwarf::Tag Tag); 137 void hashAttribute(DIEValue Value, dwarf::Tag Tag);
145 138
146 /// \brief Hashes an attribute that refers to another DIE. 139 /// \brief Hashes an attribute that refers to another DIE.
147 void hashDIEEntry(dwarf::Attribute Attribute, dwarf::Tag Tag, 140 void hashDIEEntry(dwarf::Attribute Attribute, dwarf::Tag Tag,
148 const DIE &Entry); 141 const DIE &Entry);
149 142