Lines Matching refs:die
99 /// die and which value is the corresponding artefact.
103 /// die, (given by dwarf_dieoffset()) and which value is the
108 /// die, (given by dwarf_dieoffset()) and which value is the
112 /// Convenience typedef for a map which key the offset of a dwarf die
117 /// die and which value is the corresponding function_type.
234 Dwarf_Die* die,
319 /// @param imported_die the die of the unit that has been imported.
368 const Dwarf_Die* die,
374 const Dwarf_Die* die,
379 die_is_anonymous(const Dwarf_Die* die);
382 die_is_type(const Dwarf_Die* die);
385 die_is_decl(const Dwarf_Die* die);
388 die_is_declaration_only(Dwarf_Die* die);
391 die_is_variable_decl(const Dwarf_Die *die);
394 die_is_function_decl(const Dwarf_Die *die);
397 die_has_size_attribute(const Dwarf_Die *die);
400 die_has_no_child(const Dwarf_Die *die);
403 die_is_namespace(const Dwarf_Die* die);
406 die_is_unspecified(Dwarf_Die* die);
409 die_is_void_type(Dwarf_Die* die);
412 die_is_pointer_type(const Dwarf_Die* die);
415 pointer_or_qual_die_of_anonymous_class_type(const Dwarf_Die* die);
418 die_is_reference_type(const Dwarf_Die* die);
421 die_is_pointer_or_reference_type(const Dwarf_Die* die);
424 die_is_pointer_reference_or_typedef_type(const Dwarf_Die* die);
427 die_is_class_type(const Dwarf_Die* die);
430 die_is_qualified_type(const Dwarf_Die* die);
433 die_is_function_type(const Dwarf_Die *die);
436 die_has_object_pointer(const Dwarf_Die* die,
440 die_has_children(const Dwarf_Die* die);
443 die_this_pointer_from_object_pointer(Dwarf_Die* die,
447 die_this_pointer_is_const(Dwarf_Die* die);
450 die_object_pointer_is_for_const_method(Dwarf_Die* die);
453 is_type_die_to_be_canonicalized(const Dwarf_Die *die);
457 const Dwarf_Die* die,
470 die_unsigned_constant_attribute(const Dwarf_Die* die,
475 die_signed_constant_attribute(const Dwarf_Die*die,
480 die_constant_attribute(const Dwarf_Die *die,
492 die_address_attribute(Dwarf_Die* die, unsigned attr_name, Dwarf_Addr& result);
495 die_name(const Dwarf_Die* die);
498 die_location(const reader& rdr, const Dwarf_Die* die);
501 die_location_address(Dwarf_Die* die,
506 die_die_attribute(const Dwarf_Die* die,
512 get_internal_anonymous_die_prefix_name(const Dwarf_Die *die);
519 get_internal_anonymous_die_name(Dwarf_Die *die,
524 const Dwarf_Die* die,
529 const Dwarf_Die* die,
534 const Dwarf_Die* die,
539 const Dwarf_Die* die, size_t where,
544 const Dwarf_Die* die,
555 const Dwarf_Die *die,
559 die_peel_qual_ptr(Dwarf_Die *die, Dwarf_Die& peeled_die);
563 const Dwarf_Die *die,
571 const Dwarf_Die* die,
576 const Dwarf_Die* die,
581 const Dwarf_Die* die,
598 const Dwarf_Die* die,
604 const Dwarf_Die* die,
620 get_member_child_die(const Dwarf_Die *die, Dwarf_Die *child);
1743 /// @param die the DIE which should have the same source as the
1747 /// same source as @p die.
1749 get_container(const reader& rdr, const Dwarf_Die *die)
1751 const die_source source = rdr.get_die_source(die);
1760 /// @param die the DIE which should have the same source as the
1764 /// same source as @p die.
1766 get_container(const reader& rdr, const Dwarf_Die *die) const
1769 get_container(rdr, die);
1785 // A set of maps (one per kind of die source) that associates a decl
1790 // A set of maps (one per kind of die source) that associates a type
1801 // A set of maps (one per kind of die source) that associates the
1802 // offset of a decl die to its corresponding decl artifact.
1805 // A set of maps (one per kind of die source) that associates the
1806 // offset of a type die to its corresponding type artifact.
1809 /// A set of vectors (one per kind of die source) that associates
1813 /// A set of vectors (one per kind of die source) that associates
1842 // A map that associates each tu die to a vector of unit import
1845 // A map that associates each tu die to a vector of unit import
2136 cerr << "building die -> parent maps ...";
2182 // be a DW_TAG_compile_unit die.
2485 /// @param die the DIE to consider.
2490 /// @param die_as_type if yes, it means @p die has to be considered
2493 compute_canonical_die_offset(const Dwarf_Die *die,
2500 get_container(*this, die)
2502 get_container(*this, die);
2505 compute_canonical_die(die, canonical_dies, canonical_die, die_as_type);
2512 /// @param die the DIE to consider.
2522 /// @param die_as_type if yes, it means @p die has to be considered
2525 compute_canonical_die(const Dwarf_Die *die,
2530 const die_source source = get_die_source(die);
2532 Dwarf_Off die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
2553 /// @param die_as_type if yes, it means @p die has to be considered
2562 // The map that associates the string representation of 'die'
2571 Dwarf_Die die;
2573 die_offset, &die));
2575 // The variable repr is the the string representation of 'die'.
2577 // Even if die_as_type is true -- which means that 'die' is said
2583 ? get_die_pretty_type_representation(&die, /*where=*/0)
2584 : get_die_pretty_representation(&die, /*where=*/0);
2606 if (compare_dies(*this, &die, &potential_canonical_die,
2625 /// @param die the DIE to consider.
2628 /// canonical die, if this function returns true.
2634 /// @param die_as_type if set to yes, it means @p die is to be
2637 /// @return true iff a canonical DIE was found for @p die.
2639 get_canonical_die(const Dwarf_Die *die,
2644 const die_source source = get_die_source(die);
2653 Dwarf_Off die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
2661 // The map that associates the string representation of 'die'
2666 type_die_repr_die_offsets_maps().get_container(*this, die))
2668 decl_die_repr_die_offsets_maps().get_container(*this, die));
2670 // The variable repr is the the string representation of 'die'.
2672 // Even if die_as_type is true -- which means that 'die' is said
2677 (die_as_type /*&& dwarf_tag(die) != DW_TAG_subprogram*/)
2678 ? get_die_pretty_type_representation(die, where)
2679 : get_die_pretty_representation(die, where);
2692 // compare die and canonical_die.
2694 die, &canonical_die,
2716 /// @param die the DIE to get a canonical type for.
2727 /// Otherwise, @p die is considered as being a canonical DIE for
2728 /// itself. @p canonical_die is thus set to the canonical die in
2731 get_or_compute_canonical_die(const Dwarf_Die* die,
2736 const die_source source = get_die_source(die);
2745 Dwarf_Off initial_die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
2755 if (!is_type_die_to_be_canonicalized(die))
2758 // The map that associates the string representation of 'die'
2763 type_die_repr_die_offsets_maps().get_container(*this, die))
2765 decl_die_repr_die_offsets_maps().get_container(*this, die));
2767 // The variable repr is the the string representation of 'die'.
2769 // Even if die_as_type is true -- which means that 'die' is said
2775 ? get_die_pretty_type_representation(die, where)
2776 : get_die_pretty_representation(die, where);
2799 // compare die and canonical_die.
2801 die, &canonical_die,
2812 // We didn't find a canonical DIE for 'die'. So let's consider
2830 /// @param die the DIE to get the source of.
2835 get_die_source(const Dwarf_Die *die) const
2838 ABG_ASSERT(die);
2839 ABG_ASSERT(get_die_source(*die, source));
2850 /// @param die the DIE to get the source of.
2858 get_die_source(const Dwarf_Die &die, die_source &source) const
2863 if (!dwarf_diecu(const_cast<Dwarf_Die*>(&die),
2905 /// @param die the resulting DIE. The pointer has to point to an
2908 get_die_from_offset(die_source source, Dwarf_Off offset, Dwarf_Die *die) const
2912 offset, die));
2915 offset, die));
2920 /// Add an entry to the relevant die->decl map.
2922 /// @param die the DIE to add the the map.
2929 /// associates the representation string of @p die with the
2932 /// associated with a DIE of the string representation of @p die.
2935 /// associates the representation string of @p die with the
2939 /// representation of @p die.
2941 associate_die_to_decl(Dwarf_Die* die,
2946 const die_source source = get_die_source(die);
2955 if (!get_or_compute_canonical_die(die, equiv_die, where_offset,
2961 die_offset = dwarf_dieoffset(die);
3000 /// @param die the DIE to consider.
3005 /// @p die.
3007 get_die_qualified_name(Dwarf_Die *die, size_t where_offset)
3009 ABG_ASSERT(die);
3011 die_qualified_name_maps_.get_container(*this, die);
3013 size_t die_offset = dwarf_dieoffset(die);
3019 string qualified_name = die_qualified_name(rdr, die, where_offset);
3034 /// @param die the DIE to consider.
3039 /// @p die.
3041 get_die_qualified_name(Dwarf_Die *die, size_t where_offset) const
3044 get_die_qualified_name(die, where_offset);
3058 /// @param die the DIE to consider.
3063 /// @p die.
3065 get_die_qualified_type_name(const Dwarf_Die *die, size_t where_offset) const
3067 ABG_ASSERT(die);
3069 // The name of the translation unit die is "".
3070 if (die == cur_tu_die())
3075 die);
3077 size_t die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
3085 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
3089 && die_is_anonymous(die))
3091 location l = die_location(*this, die);
3097 die_qualified_type_name(rdr, die, where_offset);
3117 /// @param die the DIE to consider.
3124 get_die_pretty_type_representation(const Dwarf_Die *die,
3127 ABG_ASSERT(die);
3130 die);
3132 size_t die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
3139 die_pretty_print_type(rdr, die, where_offset);
3154 /// @param die the DIE to consider.
3161 get_die_pretty_representation(const Dwarf_Die *die, size_t where_offset) const
3163 ABG_ASSERT(die);
3167 die);
3169 size_t die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
3176 die_pretty_print(rdr, die, where_offset);
3196 /// @param die the DIE to consider.
3202 lookup_type_artifact_from_die(Dwarf_Die *die) const
3205 lookup_artifact_from_die(die, /*type_as_die=*/true);
3222 /// @param die the DIE to consider.
3231 lookup_artifact_from_die(const Dwarf_Die *die, bool die_as_type = false) const
3234 if (!get_or_compute_canonical_die(die, equiv_die, /*where=*/0, die_as_type))
3261 /// @param die the DIE to consider.
3287 /// @param die the DIE to consider.
3293 get_die_language(const Dwarf_Die *die, translation_unit::language &lang) const
3296 ABG_ASSERT(dwarf_diecu(const_cast<Dwarf_Die*>(die), &cu_die, 0, 0));
3309 /// @param die the DIE to consider.
3311 /// @return true iff @p die originates from a program in the C
3314 die_is_in_c(const Dwarf_Die *die) const
3317 if (!get_die_language(die, l))
3325 /// @param die the DIE to consider.
3327 /// @return true iff @p die originates from a program in the C++
3330 die_is_in_cplus_plus(const Dwarf_Die *die) const
3333 if (!get_die_language(die, l))
3341 /// @param die the DIE to consider.
3343 /// @return true iff @p die originates from a program written either in
3346 die_is_in_c_or_cplusplus(const Dwarf_Die *die) const
3349 if (!get_die_language(die, l))
3384 /// @param die the DIE to consider.
3386 /// @return true if the ODR is relevant for @p die.
3390 Dwarf_Die die;
3392 die_offset, &die));
3393 return odr_is_relevant(&die);
3399 /// @param die the DIE to consider.
3401 /// @return true if the ODR is relevant for @p die.
3403 odr_is_relevant(const Dwarf_Die *die) const
3406 if (!get_die_language(die, lang))
3469 /// @param die the DIE to associate to the function type, using its
3472 /// @param fn_type the function type to associate to @p die.
3474 associate_die_repr_to_fn_type_per_tu(const Dwarf_Die *die,
3477 if (!die_is_function_type(die))
3481 get_die_pretty_type_representation(die, /*where=*/0);
3490 /// @param die the DIE of function type to consider.
3492 /// @return the @ref function_type_sptr associated to @p die, or nil
3493 /// of no function_type is associated to @p die.
3495 lookup_fn_type_from_die_repr_per_tu(const Dwarf_Die *die)
3497 if (!die_is_function_type(die))
3501 get_die_pretty_representation(die, /*where=*/0);
3563 /// @param die the DIE to set the canonical DIE for.
3568 /// @param die_as_type if true, it means that @p die has to be
3571 set_canonical_die_offset(const Dwarf_Die *die,
3575 const die_source source = get_die_source(die);
3577 Dwarf_Off die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
3658 /// @param die the DIE to consider.
3664 associate_die_to_type(const Dwarf_Die *die,
3672 if (!get_or_compute_canonical_die(die, equiv_die, where,
3689 /// @param die the DIE to consider.
3694 lookup_type_from_die(const Dwarf_Die* die) const
3697 lookup_artifact_from_die(die, /*die_as_type=*/true);
3754 /// Getter of a map that associates a die that represents a
3766 /// Getter of a map that associates a die that represents a
3792 /// Getter for a map that associates a die (that represents a
3803 /// Getter for a map that associates a die (that represents a
3828 /// Getter for a map that associates a die with a function decl
4823 /// @param DIE the die to consider.
4825 is_decl_die_with_exported_symbol(const Dwarf_Die *die)
4827 if (!die || !die_is_decl(die))
4833 if (die_is_variable_decl(die))
4835 if ((address_found = get_variable_address(die, decl_symbol_address)))
4839 else if (die_is_function_decl(die))
4841 if ((address_found = get_function_address(die, decl_symbol_address)))
4993 /// @param die the DIE we are considering.
4997 /// attribute found on the DIE @p die, iff the function returns
5000 /// @return true iff the DIE @p die does have a DW_AT_ranges
5004 get_first_exported_fn_address_from_DW_AT_ranges(Dwarf_Die* die,
5014 if ((offset = dwarf_ranges(die, offset, &base, &addr, &end_addr)) >= 0)
5034 /// @param function_die the die of the function to consider.
5067 /// @param variable_die the die of the function to consider.
5181 /// Walk the DIEs under a given die and for each child, populate the
5182 /// die -> parent map to record the child -> parent relationship
5184 /// exists between the child and the given die.
5192 /// @param die the DIE whose children to walk recursively.
5194 /// @param source where the DIE @p die comes from.
5197 /// points where unit have been imported, under @p die.
5199 build_die_parent_relations_under(Dwarf_Die* die,
5203 if (!die)
5209 if (dwarf_child(die, &child) != 0)
5214 parent_of[dwarf_dieoffset(&child)] = dwarf_dieoffset(die);
5751 Dwarf_Die* die,
5760 Dwarf_Die* die,
5766 Dwarf_Die* die,
5776 Dwarf_Die* die,
5791 Dwarf_Die* die,
5804 Dwarf_Die *die,
5811 Dwarf_Die *die,
5818 Dwarf_Die *die,
5829 finish_member_function_reading(Dwarf_Die* die,
5836 /// @param die the DIE to consider.
5838 /// @return true iff @p die is anonymous.
5840 die_is_anonymous(const Dwarf_Die* die)
5843 if (!dwarf_attr_integrate(const_cast<Dwarf_Die*>(die), DW_AT_name, &attr))
5851 /// @param die the DIE to get the attribute value from.
5859 die_string_attribute(const Dwarf_Die* die, unsigned attr_name)
5861 if (!die)
5865 if (!dwarf_attr_integrate(const_cast<Dwarf_Die*>(die), attr_name, &attr))
5875 /// @param die the DIE to get the attribute value from.
5883 die_char_str_attribute(const Dwarf_Die* die, unsigned attr_name)
5885 if (!die)
5889 if (!dwarf_attr_integrate(const_cast<Dwarf_Die*>(die), attr_name, &attr))
5899 /// @param die the DIE to read the information from.
5912 die_unsigned_constant_attribute(const Dwarf_Die* die,
5916 if (!die)
5921 if (!dwarf_attr_integrate(const_cast<Dwarf_Die*>(die), attr_name, &attr)
5933 /// @param die the DIE to get the attribute from.
5940 /// attr_name was found on the DIE @p die.
5942 die_signed_constant_attribute(const Dwarf_Die *die,
5946 if (!die)
5951 if (!dwarf_attr_integrate(const_cast<Dwarf_Die*>(die), attr_name, &attr)
5965 /// @param die the DIE from which to read the value of the attribute.
5973 /// on DIE @p die.
5975 /// @return true iff DIE @p die has an attribute named @p attr_name
5978 die_constant_attribute(const Dwarf_Die *die,
5986 if (!die_unsigned_constant_attribute(die, attr_name, l))
5993 if (!die_signed_constant_attribute(die, attr_name, l))
6053 /// @param die the DIE to get the attribute from.
6070 die_flag_attribute(const Dwarf_Die* die,
6077 ? !dwarf_attr_integrate(const_cast<Dwarf_Die*>(die), attr_name, &attr)
6078 : !dwarf_attr(const_cast<Dwarf_Die*>(die), attr_name, &attr))
6091 /// @param die the DIE to read the mangled name from.
6096 die_linkage_name(const Dwarf_Die* die)
6098 if (!die)
6101 string linkage_name = die_string_attribute(die, DW_AT_linkage_name);
6103 linkage_name = die_string_attribute(die, DW_AT_MIPS_linkage_name);
6111 /// @param die the DIE to consider.
6114 /// value of the DW_AT_decl_file attribute. If the DIE @p die
6118 die_decl_file_attribute(const Dwarf_Die* die)
6120 if (!die)
6123 const char* str = dwarf_decl_file(const_cast<Dwarf_Die*>(die));
6131 /// @param die the DIE to read the value from.
6143 /// @return true if the DIE @p die contains an attribute named @p
6146 die_die_attribute(const Dwarf_Die* die,
6153 ? !dwarf_attr_integrate(const_cast<Dwarf_Die*>(die), attr_name, &attr)
6154 : !dwarf_attr(const_cast<Dwarf_Die*>(die), attr_name, &attr))
6162 /// @param die the DIE to consider.
6172 die_address_attribute(Dwarf_Die* die, unsigned attr_name, Dwarf_Addr& result)
6175 if (!dwarf_attr_integrate(die, attr_name, &attr))
6184 /// @param die the DIE the read the source location from.
6186 /// @return the location associated with @p die.
6188 die_location(const reader& rdr, const Dwarf_Die* die)
6190 if (!die)
6193 string file = die_decl_file_attribute(die);
6195 die_unsigned_constant_attribute(die, DW_AT_decl_line, line);
6208 /// @param die the DIE to consider.
6212 die_name(const Dwarf_Die* die)
6214 string name = die_string_attribute(die, DW_AT_name);
6222 /// @param die the DIE to read location and names from.
6231 Dwarf_Die* die,
6236 loc = die_location(rdr, die);
6237 name = die_name(die);
6238 linkage_name = die_linkage_name(die);
6244 /// @param die the DIE to read the information from.
6251 die_size_in_bits(const Dwarf_Die* die, uint64_t& size)
6253 if (!die)
6258 if (!die_unsigned_constant_attribute(die, DW_AT_byte_size, byte_size))
6260 if (!die_unsigned_constant_attribute(die, DW_AT_bit_size, bit_size))
6274 /// @param die the DIE to consider.
6279 /// @return bool if the DIE contains the DW_AT_accessibility die.
6281 die_access_specifier(Dwarf_Die * die, access_specifier& access)
6283 if (!die)
6287 if (!die_unsigned_constant_attribute(die, DW_AT_accessibility, a))
6317 /// @param die the DIE to consider for testing.
6322 die_is_public_decl(const Dwarf_Die* die)
6324 if (!die)
6332 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6334 die_flag_attribute(die, DW_AT_external, is_public);
6337 string name = die_name(die);
6353 const Dwarf_Die* die)
6355 if (die_is_public_decl(die))
6358 unsigned tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6364 if (!get_parent_die(rdr, die, parent_die, where_offset))
6391 /// @param die the DIE to consider.
6395 die_is_declaration_only(Dwarf_Die* die)
6398 die_flag_attribute(die, DW_AT_declaration, is_declaration, false);
6399 if (is_declaration && !die_has_size_attribute(die))
6406 /// @param die the DIE to consider.
6408 /// @return true iff @p die represents a function decl.
6410 die_is_function_decl(const Dwarf_Die *die)
6412 if (!die)
6415 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6423 /// @param die the DIE to consider.
6425 /// @return true iff @p die represents a variable decl.
6427 die_is_variable_decl(const Dwarf_Die *die)
6429 if (!die)
6432 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6440 /// @param die the DIE to consider.
6444 die_has_size_attribute(const Dwarf_Die *die)
6447 if (die_size_in_bits(die, s))
6454 /// @param die the DIE to consider.
6456 /// @return true iff @p die has no child DIE.
6458 die_has_no_child(const Dwarf_Die *die)
6460 if (!die)
6464 if (dwarf_child(const_cast<Dwarf_Die*>(die), &child) == 0)
6473 /// @param die the DIE to consider.
6477 die_is_declaration_only(const Dwarf_Die* die)
6478 {return die_is_declaration_only(const_cast<Dwarf_Die*>(die));}
6482 /// @param die the test to test for.
6486 die_is_artificial(Dwarf_Die* die)
6489 return die_flag_attribute(die, DW_AT_artificial, is_artificial);
6688 /// @param die the DIE to consider.
6690 /// @return true iff @p die is to be canonicalized.
6692 is_type_die_to_be_canonicalized(const Dwarf_Die *die)
6695 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6705 result = !die_is_declaration_only(die);
6747 /// @param die the DIE to consider.
6749 /// @return true if @p die represents a type, false otherwise.
6751 die_is_type(const Dwarf_Die* die)
6753 if (!die)
6755 return is_type_tag(dwarf_tag(const_cast<Dwarf_Die*>(die)));
6760 /// @param die the DIE to consider.
6762 /// @return true if @p die represents a decl, false otherwise.
6764 die_is_decl(const Dwarf_Die* die)
6766 if (!die)
6768 return is_decl_tag(dwarf_tag(const_cast<Dwarf_Die*>(die)));
6773 /// @param die the DIE to consider.
6775 /// @return true if @p die represents a namespace, false otherwise.
6777 die_is_namespace(const Dwarf_Die* die)
6779 if (!die)
6781 return (dwarf_tag(const_cast<Dwarf_Die*>(die)) == DW_TAG_namespace);
6786 /// @param die the DIE to consider.
6788 /// @return true if @p die has tag DW_TAG_unspecified_type.
6790 die_is_unspecified(Dwarf_Die* die)
6792 if (!die)
6794 return (dwarf_tag(die) == DW_TAG_unspecified_type);
6799 /// @param die the DIE to consider.
6801 /// @return true if @p die represents a void type, false otherwise.
6803 die_is_void_type(Dwarf_Die* die)
6805 if (!die || dwarf_tag(die) != DW_TAG_base_type)
6808 string name = die_name(die);
6817 /// @param die the die to consider.
6819 /// @return true iff @p die represents a pointer type.
6821 die_is_pointer_type(const Dwarf_Die* die)
6823 if (!die)
6826 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6836 /// @param die the DIE to consider.
6841 pointer_or_qual_die_of_anonymous_class_type(const Dwarf_Die* die)
6843 if (!die_is_pointer_or_reference_type(die)
6844 && !die_is_qualified_type(die))
6848 if (!die_die_attribute(die, DW_AT_type, underlying_type_die))
6861 /// @param die the die to consider.
6863 /// @return true iff @p die represents a reference type.
6865 die_is_reference_type(const Dwarf_Die* die)
6867 if (!die)
6870 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6879 /// @param die the die to consider.
6881 /// @return true iff @p die represents an array type.
6883 die_is_array_type(const Dwarf_Die* die)
6885 if (!die)
6888 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6897 /// @param die the die to consider.
6899 /// @return true iff @p die represents a pointer or reference type.
6901 die_is_pointer_or_reference_type(const Dwarf_Die* die)
6902 {return (die_is_pointer_type(die)
6903 || die_is_reference_type(die)
6904 || die_is_array_type(die));}
6908 /// @param die the die to consider.
6910 /// @return true iff @p die represents a pointer, a reference or a
6913 die_is_pointer_reference_or_typedef_type(const Dwarf_Die* die)
6914 {return (die_is_pointer_or_reference_type(die)
6915 || dwarf_tag(const_cast<Dwarf_Die*>(die)) == DW_TAG_typedef);}
6919 /// @param die the die to consider.
6921 /// @return true iff @p die represents a class type.
6923 die_is_class_type(const Dwarf_Die* die)
6925 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6935 /// @param die the DIE to consider.
6937 /// @return true iff @p die is for a qualified type.
6939 die_is_qualified_type(const Dwarf_Die* die)
6941 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6952 /// @param die the DIE to consider.
6954 /// @return true iff @p die is for a function type.
6956 die_is_function_type(const Dwarf_Die *die)
6958 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
6968 /// @param die the DIE to consider.
6973 /// @return true iff the DIE @p die has an object pointer. In that
6977 die_has_object_pointer(const Dwarf_Die* die, Dwarf_Die& object_pointer)
6979 if (!die)
6982 if (die_die_attribute(die, DW_AT_object_pointer, object_pointer))
6990 /// @param die the DIE to consider.
6994 die_has_children(const Dwarf_Die* die)
6996 if (!die)
7000 if (dwarf_child(const_cast<Dwarf_Die*>(die), &child) == 0)
7010 /// @param die the DIE of the object pointer of the function or member
7017 /// object pointer DIE @p die. In that case, the parameter @p
7020 die_this_pointer_from_object_pointer(Dwarf_Die* die,
7023 ABG_ASSERT(die);
7024 ABG_ASSERT(dwarf_tag(die) == DW_TAG_formal_parameter);
7026 if (die_die_attribute(die, DW_AT_type, this_pointer_die))
7037 /// @param die the DIE of the "this" pointer to consider.
7039 /// @return true iff @p die points to a const class type.
7041 die_this_pointer_is_const(Dwarf_Die* die)
7043 ABG_ASSERT(die);
7045 if (dwarf_tag(die) == DW_TAG_pointer_type)
7048 if (die_die_attribute(die, DW_AT_type, pointed_to_type_die))
7060 /// @param die the DIE of the object pointer to consider.
7062 /// @return true iff the object pointer represented by @p die is for a
7065 die_object_pointer_is_for_const_method(Dwarf_Die* die)
7067 ABG_ASSERT(die);
7068 ABG_ASSERT(dwarf_tag(die) == DW_TAG_formal_parameter);
7071 if (die_this_pointer_from_object_pointer(die, this_pointer_die))
7082 /// @param die the DIE to consider.
7087 /// containing class iff @p die happens to be at class scope; that is,
7090 /// @return true iff @p die is at class scope. In that case, @p
7092 /// die.
7095 const Dwarf_Die* die,
7099 if (!get_scope_die(rdr, die, where_offset, class_scope_die))
7112 /// @param die the DIE of the type to consider.
7119 die_peel_qual_ptr(Dwarf_Die *die, Dwarf_Die& peeled_die)
7121 if (!die)
7124 int tag = dwarf_tag(die);
7133 if (!die_die_attribute(die, DW_AT_type, peeled_die))
7139 memcpy(&peeled_die, die, sizeof(peeled_die));
7158 /// @param die the DIE of the type to consider.
7165 die_peel_typedef(Dwarf_Die *die, Dwarf_Die& peeled_die)
7167 if (!die)
7170 int tag = dwarf_tag(die);
7172 memcpy(&peeled_die, die, sizeof(peeled_die));
7176 if (!die_die_attribute(die, DW_AT_type, peeled_die))
7195 /// @param die the DIE to consider.
7200 /// @return true iff the function could peel @p die.
7202 die_peel_pointer_and_typedef(const Dwarf_Die *die, Dwarf_Die& peeled_die)
7204 if (!die)
7207 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
7214 if (!die_die_attribute(die, DW_AT_type, peeled_die))
7236 /// @param die the DIE to consider.
7242 /// which holds the implicit "this" pointer of the method. That die
7250 /// function if @p die is a static method. This is set iff the
7253 /// @return true iff @p die is a DIE for a method type.
7256 const Dwarf_Die *die,
7262 if (!die)
7265 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
7273 if (die_die_attribute(die, DW_AT_specification,
7275 || die_die_attribute(die, DW_AT_abstract_origin,
7292 if (die_has_object_pointer(die, object_pointer_die))
7296 if (die_is_at_class_scope(rdr, die, where_offset, class_die))
7305 if (die_has_object_pointer(die, object_pointer_die))
7314 // The object pointer die points to a DW_TAG_formal_parameter which
7344 /// @param die the DIE to read from.
7351 die_virtuality(const Dwarf_Die* die, virtuality& virt)
7353 if (!die)
7357 die_unsigned_constant_attribute(die, DW_AT_virtuality, v);
7371 /// @param die the DIE to consider.
7376 die_is_virtual(const Dwarf_Die* die)
7379 if (!die_virtuality(die, v))
7387 /// @param die the DIE to test for.
7392 die_is_declared_inline(Dwarf_Die* die)
7395 if (!die_unsigned_constant_attribute(die, DW_AT_inline, inline_value))
7552 /// @param die the DIE to read the attribute from.
7567 die_location_expr(const Dwarf_Die* die,
7572 if (!die)
7576 if (!dwarf_attr_integrate(const_cast<Dwarf_Die*>(die), attr_name, &attr))
8521 /// @param die the DIE to consider.
8532 /// @return true if DW_AT_bit_offset was found on @p die.
8534 read_and_convert_DW_at_bit_offset(const Dwarf_Die* die,
8539 if (!die_unsigned_constant_attribute(die, DW_AT_bit_offset, off))
8553 ABG_ASSERT(die_unsigned_constant_attribute(die, DW_AT_byte_size,
8558 ABG_ASSERT(die_unsigned_constant_attribute(die, DW_AT_bit_size,
8577 /// @param die the DIE to read the attribute from.
8585 die_constant_data_member_location(const Dwarf_Die *die,
8588 if (!die)
8592 if (!dwarf_attr(const_cast<Dwarf_Die*>(die),
8649 /// @param die the DIE to read the information from.
8655 const Dwarf_Die* die,
8664 if (die_unsigned_constant_attribute(die, DW_AT_data_bit_offset, bit_offset))
8678 if (!die_constant_data_member_location(die, offset))
8683 if (!die_location_expr(die, DW_AT_data_member_location,
8713 if (read_and_convert_DW_at_bit_offset(die, is_big_endian, bit_offset))
8723 /// @param die the DIE to consider.
8731 die_location_address(Dwarf_Die* die,
8740 if (!die)
8744 if (!dwarf_attr_integrate(const_cast<Dwarf_Die*>(die), DW_AT_location, &attr))
8767 /// @param die the DIE of the function to consider.
8775 die_virtual_function_index(Dwarf_Die* die,
8778 if (!die)
8783 if (!die_location_expr(die, DW_AT_vtable_elem_location,
8801 /// @param die the DIE to consider.
8803 /// @return true iff @p die represents an anonymous type.
8805 is_anonymous_type_die(Dwarf_Die *die)
8807 int tag = dwarf_tag(die);
8813 return die_is_anonymous(die);
8829 /// @param die the type DIE to look at. This function expects a type
8835 get_internal_anonymous_die_prefix_name(const Dwarf_Die *die)
8837 ABG_ASSERT(die_is_type(die));
8838 ABG_ASSERT(die_string_attribute(die, DW_AT_name) == "");
8840 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
8881 /// @param die the DIE representing the anonymous type to consider.
8885 /// several different anonymous types of the same kind as @p die, this
8891 get_internal_anonymous_die_name(Dwarf_Die *die,
8894 string name = get_internal_anonymous_die_prefix_name(die);
8910 /// @param die the DIE to consider.
8918 const Dwarf_Die* die,
8921 if (!die)
8924 int tag = dwarf_tag (const_cast<Dwarf_Die*>(die));
8930 string name = die_name(die);
8933 if (!get_scope_die(rdr, die, where_offset, scope_die))
8937 bool colon_colon = die_is_type(die) || die_is_namespace(die);
8969 name = get_internal_anonymous_die_prefix_name(die);
8982 die_die_attribute(die, DW_AT_type, underlying_type_die);
9041 if (!die_die_attribute(die, DW_AT_type, pointed_to_type_die))
9083 die, where_offset,
9092 if (!die_die_attribute(die, DW_AT_type, element_type_die))
9101 die, subranges, where_offset,
9118 die_return_and_parm_names_from_fn_type_die(rdr, die, where_offset,
9170 /// @param die the DIE to consider.
9177 const Dwarf_Die* die,
9180 if (!die || !die_is_decl(die))
9183 string name = die_name(die);
9186 if (!get_scope_die(rdr, die, where_offset, scope_die))
9194 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
9203 repr = die_function_signature(rdr, die, where_offset);
9231 /// @param die the DIE to consider.
9237 die_qualified_name(const reader& rdr, const Dwarf_Die* die, size_t where)
9239 if (die_is_type(die))
9240 return die_qualified_type_name(rdr, die, where);
9241 else if (die_is_decl(die))
9242 return die_qualified_decl_name(rdr, die, where);
9255 /// @param die the DIE to consider.
9265 const Dwarf_Die* die,
9268 if (!die)
9271 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
9284 if (die_die_attribute(die, DW_AT_type, underlying_type_die))
9294 string name = die_qualified_type_name(rdr, die, where);
9299 qname = die_qualified_type_name(rdr, die, where);
9319 /// @param die the DIE of the function or function type we are looking
9344 const Dwarf_Die* die,
9355 if (!die_die_attribute(die, DW_AT_type, ret_type_die))
9368 die_function_type_is_method_type(rdr, die, where_offset,
9386 string fn_name = die_name(die);
9395 if (dwarf_child(const_cast<Dwarf_Die*>(die), &child) == 0)
9431 if (get_parent_die(rdr, die, parent_die, where_offset))
9567 const Dwarf_Die* die,
9570 if (!die
9571 || (!die_is_type(die)
9572 && dwarf_tag(const_cast<Dwarf_Die*>(die)) != DW_TAG_subprogram))
9577 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
9596 repr = "namespace " + rdr.get_die_qualified_type_name(die, where_offset);
9600 repr = rdr.get_die_qualified_type_name(die, where_offset);
9606 if (!die_qualified_type_name_empty(rdr, die,
9619 repr = rdr.get_die_qualified_type_name(die, where_offset);
9625 rdr.get_die_qualified_type_name(die, where_offset);
9634 rdr.get_die_qualified_type_name(die, where_offset);
9642 rdr.get_die_qualified_type_name(die, where_offset);
9650 if (!die_die_attribute(die, DW_AT_type, element_type_die))
9658 build_subranges_from_array_type_die(rdr, die, subranges, where_offset,
9676 repr += die_qualified_type_name(rdr, die, where_offset);
9689 die_return_and_parm_names_from_fn_type_die(rdr, die, where_offset,
9698 repr += " " + rdr.get_die_qualified_type_name(die, where_offset);
9734 const Dwarf_Die* die,
9737 if (!die || !die_is_decl(die))
9742 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
9746 repr = "namespace " + die_qualified_name(rdr, die, where_offset);
9754 if (die_die_attribute(die, DW_AT_type, type_die))
9756 repr = die_qualified_name(rdr, die, where_offset);
9763 repr = die_function_signature(rdr, die, where_offset);
9783 /// @param die the DIE to consider.
9789 die_pretty_print(reader& rdr, const Dwarf_Die* die, size_t where_offset)
9791 if (die_is_type(die))
9792 return die_pretty_print_type(rdr, die, where_offset);
9793 else if (die_is_decl(die))
9794 return die_pretty_print_decl(rdr, die, where_offset);
9799 // </die pretty printer>
9804 // <die comparison engine>
10192 /// @param die the DIE to consider.
10200 get_next_member_sibling_die(const Dwarf_Die *die, Dwarf_Die *member)
10202 if (!die)
10206 for (found_member = (dwarf_siblingof(const_cast<Dwarf_Die*>(die),
10222 /// @param die the DIE to consider.
10227 /// @return TRUE iff @p child is set to the first child DIE of @p die
10230 get_member_child_die(const Dwarf_Die *die, Dwarf_Die *child)
10232 if (!die)
10235 int tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
10240 bool found_child = (dwarf_child(const_cast<Dwarf_Die*>(die),
10372 /// @param cur_dies the pair of die offsets of l and r. This is
11236 // </die comparison engine>
11423 /// @param die the DIE for which we want the parent.
11425 /// @param parent_die the output parameter set to the parent die of
11426 /// @p die. Its memory must be allocated and handled by the caller.
11429 /// positionned at, in the DIE tree. This is useful when @p die is
11437 const Dwarf_Die* die,
11443 const die_source source = rdr.get_die_source(die);
11447 m.find(dwarf_dieoffset(const_cast<Dwarf_Die*>(die)));
11518 /// @param die the DIE to consider.
11526 const Dwarf_Die* die,
11532 ABG_ASSERT(dwarf_tag(const_cast<Dwarf_Die*>(die)) != DW_TAG_member);
11533 return dwarf_diecu(const_cast<Dwarf_Die*>(die), &scope_die, 0, 0);
11537 if (die_die_attribute(die, DW_AT_specification,
11539 || die_die_attribute(die, DW_AT_abstract_origin,
11543 if (!get_parent_die(rdr, die, scope_die, where_offset))
11566 /// @param die the DIE to get the scope for.
11572 /// positionned at, in the DIE tree. This is useful when @p die is
11577 Dwarf_Die* die,
11581 const die_source source_of_die = rdr.get_die_source(die);
11584 rdr.get_die_language(die, die_lang);
11591 ABG_ASSERT(dwarf_tag(die) != DW_TAG_member);
11596 if (die_die_attribute(die, DW_AT_specification, cloned_die, false)
11597 || die_die_attribute(die, DW_AT_abstract_origin, cloned_die, false))
11604 if (!get_parent_die(rdr, die, parent_die, where_offset))
11650 if (is_anonymous_type_die(die))
11890 /// @param die the DW_TAG_compile_unit DIE to consider.
11898 Dwarf_Die* die,
11903 if (!die)
11905 ABG_ASSERT(dwarf_tag(die) == DW_TAG_compile_unit);
11911 rdr.cur_tu_die(die);
11913 string path = die_string_attribute(die, DW_AT_name);
11919 // with its die offset.
11921 o << path << "-" << std::hex << dwarf_dieoffset(die);
11924 string compilation_dir = die_string_attribute(die, DW_AT_comp_dir);
11947 die_unsigned_constant_attribute(die, DW_AT_language, l);
11952 rdr.die_tu_map()[dwarf_dieoffset(die)] = result;
11955 if (dwarf_child(die, &child) != 0)
12040 /// @param die the DIE to read from. Must be either DW_TAG_namespace
12044 /// positionned at, in the DIE tree. This is useful when @p die is
12052 Dwarf_Die* die,
12057 if (!die)
12060 unsigned tag = dwarf_tag(die);
12064 scope_decl_sptr scope = get_scope_for_die(rdr, die,
12070 die_loc_and_name(rdr, die, loc, name, linkage_name);
12074 rdr.associate_die_to_decl(die, result, where_offset);
12077 if (dwarf_child(die, &child) != 0)
12088 die_is_public_decl(die) && die_is_public_decl(&child),
12100 /// @param die the DW_TAG_base_type to consider.
12106 build_type_decl(reader& rdr, Dwarf_Die* die, size_t where_offset)
12110 if (!die)
12112 ABG_ASSERT(dwarf_tag(die) == DW_TAG_base_type);
12115 if (!die_unsigned_constant_attribute(die, DW_AT_byte_size, byte_size))
12116 if (!die_unsigned_constant_attribute(die, DW_AT_bit_size, bit_size))
12125 die_loc_and_name(rdr, die, loc, type_name, linkage_name);
12154 rdr.associate_die_to_type(die, result, where_offset);
12197 /// @param die the DIE to read from.
12203 /// @param is_declaration_only is true if the DIE denoted by @p die is
12209 Dwarf_Die* die,
12215 if (!die)
12218 unsigned tag = dwarf_tag(die);
12224 die_loc_and_name(rdr, die, loc, name, linkage_name);
12230 name = get_internal_anonymous_die_prefix_name(die);
12239 bool use_odr = rdr.odr_is_relevant(die);
12250 is_enum_type(rdr.lookup_artifact_from_die(die)))
12261 is_enum_type(rdr.lookup_artifact_from_die(die)))
12268 rdr.associate_die_to_type(die, result, where_offset);
12276 if (die_unsigned_constant_attribute(die, DW_AT_byte_size, size))
12278 bool is_artificial = die_is_artificial(die);
12285 if (dwarf_child(die, &child) == 0)
12315 rdr.associate_die_to_type(die, result, where_offset);
12328 /// @param die the DIE of the function_decl that has been just built.
12330 /// @param f the function_decl that has just been built from @p die.
12336 finish_member_function_reading(Dwarf_Die* die,
12352 bool is_virtual = die_is_virtual(die);
12355 die_virtual_function_index(die, vindex);
12360 die_access_specifier(die, access);
12408 if (die_has_object_pointer(die, object_pointer_die))
12443 Dwarf_Off die_offset = dwarf_dieoffset(die);
12461 /// @param die the function DIE to consider.
12471 Dwarf_Die* die,
12475 function_decl_sptr result = build_function_decl(rdr, die,
12506 /// @param die the DIE which has the same name as the type we are
12517 Dwarf_Die* die,
12521 if (!die)
12524 string class_name = die_string_attribute(die, DW_AT_name);
12528 scope_decl_sptr scope = get_scope_for_die(rdr, die,
12558 /// @param die the DIE of the class, typedef or enum to lookup.
12569 lookup_class_typedef_or_enum_type_from_corpus(Dwarf_Die* die,
12573 if (!die)
12576 string type_name = die_string_attribute(die, DW_AT_name);
12577 if (is_anonymous_type_die(die))
12579 get_internal_anonymous_die_name(die, anonymous_member_type_idx);
12692 /// @param die the DIE to read information from. Must be either a
12707 /// positionned at, in the DIE tree. This is useful when @p die is
12711 /// @param is_declaration_only is true if the DIE denoted by @p die is
12717 Dwarf_Die* die,
12726 if (!die)
12729 const die_source source = rdr.get_die_source(die);
12731 unsigned tag = dwarf_tag(die);
12738 rdr.die_wip_classes_map(source).find(dwarf_dieoffset(die));
12749 die_loc_and_name(rdr, die, loc, name, linkage_name);
12756 name = get_internal_anonymous_die_prefix_name(die);
12787 rdr.associate_die_to_type(die, result, where_offset);
12798 // If we've already seen the same class as 'die', then let's re-use
12805 is_class_type(rdr.lookup_type_artifact_from_die(die)))
12809 die_size_in_bits(die, size);
12810 bool is_artificial = die_is_artificial(die);
12813 bool has_child = (dwarf_child(die, &child) == 0);
12869 rdr.associate_die_to_type(die, result, where_offset);
12878 rdr.die_wip_classes_map(source)[dwarf_dieoffset(die)] = result;
13085 rdr.die_wip_classes_map(source).find(dwarf_dieoffset(die));
13103 /// @param die the DIE to read from.
13115 /// positionned at, in the DIE tree. This is useful when @p die is
13119 /// @param is_declaration_only is true if the DIE denoted by @p die is
13125 Dwarf_Die* die,
13133 if (!die)
13136 unsigned tag = dwarf_tag(die);
13141 const die_source source = rdr.get_die_source(die);
13144 rdr.die_wip_classes_map(source).find(dwarf_dieoffset(die));
13155 die_loc_and_name(rdr, die, loc, name, linkage_name);
13162 name = get_internal_anonymous_die_prefix_name(die);
13187 rdr.associate_die_to_type(die, result, where_offset);
13193 // if we've already seen a union with the same union as 'die' then
13200 is_union_type(rdr.lookup_artifact_from_die(die)))
13204 die_size_in_bits(die, size);
13205 bool is_artificial = die_is_artificial(die);
13231 rdr.associate_die_to_type(die, result, where_offset);
13238 bool has_child = (dwarf_child(die, &child) == 0);
13242 rdr.die_wip_classes_map(source)[dwarf_dieoffset(die)] = result;
13335 rdr.die_wip_classes_map(source).find(dwarf_dieoffset(die));
13353 /// @param die the input DIE to read from.
13360 /// positionned at, in the DIE tree. This is useful when @p die is
13367 Dwarf_Die* die,
13372 if (!die)
13375 unsigned tag = dwarf_tag(die);
13384 if (!die_die_attribute(die, DW_AT_type, underlying_type_die))
13399 if (type_base_sptr t = rdr.lookup_type_from_die(die))
13402 rdr.associate_die_to_type(die, result, where_offset);
13422 rdr.associate_die_to_type(die, result, where_offset);
13569 /// @param die the DIE to read information from.
13576 /// positionned at, in the DIE tree. This is useful when @p die is
13583 Dwarf_Die* die,
13589 if (!die)
13592 unsigned tag = dwarf_tag(die);
13599 if (!die_die_attribute(die, DW_AT_type, underlying_type_die))
13615 if (type_base_sptr t = rdr.lookup_type_from_die(die))
13629 if (die_unsigned_constant_attribute(die, DW_AT_byte_size, size))
13641 rdr.associate_die_to_type(die, result, where_offset);
13650 /// @param die the DIE to read from.
13657 /// positionned at, in the DIE tree. This is useful when @p die is
13664 Dwarf_Die* die,
13670 if (!die)
13673 unsigned tag = dwarf_tag(die);
13679 if (!die_die_attribute(die, DW_AT_type, underlying_type_die))
13691 if (type_base_sptr t = rdr.lookup_type_from_die(die))
13705 if (die_unsigned_constant_attribute(die, DW_AT_byte_size, size))
13720 rdr.associate_die_to_type(die, result, where_offset);
13728 /// @param die the DIE to read from.
13735 /// positioned at, in the DIE tree. This is useful when @p die is
13742 Dwarf_Die* die,
13748 if (!die)
13751 ABG_ASSERT(dwarf_tag(die) == DW_TAG_subroutine_type
13752 || dwarf_tag(die) == DW_TAG_subprogram);
13754 const die_source source = rdr.get_die_source(die);
13757 size_t off = dwarf_dieoffset(die);
13775 if (type_base_sptr t = rdr.lookup_fn_type_from_die_repr_per_tu(die))
13779 rdr.associate_die_to_type(die, result, where_offset);
13783 bool odr_is_relevant = rdr.odr_is_relevant(die);
13791 // representation as the function type 'die', then it's the same
13792 // type as the one denoted by 'die'.
13794 is_function_type(rdr.lookup_type_artifact_from_die(die)))
13796 rdr.associate_die_to_type(die, fn_type, where_offset);
13809 die_function_type_is_method_type(rdr, die, where_offset,
13836 // 'die'. This way, when building the sub-type triggers the
13837 // creation of a type matching the same 'die', then we'll reuse this
13846 rdr.associate_die_to_type(die, result, where_offset);
13847 rdr.die_wip_function_types_map(source)[dwarf_dieoffset(die)] = result;
13851 if (die_die_attribute(die, DW_AT_type, ret_type_die))
13863 if (dwarf_child(die, &child) == 0)
13924 rdr.associate_die_repr_to_fn_type_per_tu(die, result);
13929 find(dwarf_dieoffset(die));
13942 /// @param die the DIE to read from.
13945 /// positionned at in the DIE tree. This is useful when @p die is
13950 /// type is associated to the @p die, so that next time when the
13962 const Dwarf_Die* die,
13968 if (!die)
13971 unsigned tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
13975 string name = die_name(die);
13982 if (die_die_attribute(die, DW_AT_type, underlying_type_die))
14014 die_constant_attribute(die, DW_AT_lower_bound, is_signed, lower_bound);
14017 if (!die_constant_attribute(die, DW_AT_upper_bound, is_signed, upper_bound))
14030 die_unsigned_constant_attribute(die, DW_AT_count, count);
14070 rdr.associate_die_to_type(die, result, where_offset);
14081 /// @param die the DIE of tag DW_TAG_array_type which contains
14085 /// that are built from @p die.
14088 /// positioned at, in the DIE tree. This is useful when @p die is
14093 const Dwarf_Die* die,
14100 if (dwarf_child(const_cast<Dwarf_Die*>(die), &child) == 0)
14138 /// @param die the DIE to read from.
14145 /// positioned at, in the DIE tree. This is useful when @p die is
14152 Dwarf_Die* die,
14158 if (!die)
14161 unsigned tag = dwarf_tag(die);
14168 if (die_die_attribute(die, DW_AT_type, type_die))
14177 if (type_base_sptr t = rdr.lookup_type_from_die(die))
14189 build_subranges_from_array_type_die(rdr, die, subranges, where_offset);
14200 /// @param die the DIE to read from.
14207 /// positionned at, in the DIE tree. This is useful when @p die is
14214 Dwarf_Die* die,
14220 if (!die)
14223 unsigned tag = dwarf_tag(die);
14229 die_loc_and_name(rdr, die, loc, name, linkage_name);
14239 if (!die_die_attribute(die, DW_AT_type, underlying_type_die))
14267 rdr.associate_die_to_type(die, result, where_offset);
14282 /// @param die the DIE representing the variable we are looking at.
14285 /// positionned at, in the DIE tree. This is useful when @p die is
14290 /// that the function will append the new properties it sees on @p die
14303 Dwarf_Die *die,
14309 if (variable_is_suppressed(rdr, scope, die, is_required_decl_spec))
14314 string var_name = die_name(die);
14319 var = build_var_decl(rdr, die, where_offset, result);
14327 /// @param die the DIE representing the variable we are looking at.
14330 /// positionned at, in the DIE tree. This is useful when @p die is
14335 /// that the function will append the new properties it sees on @p die
14343 Dwarf_Die *die,
14347 if (!die)
14350 int tag = dwarf_tag(die);
14353 if (!die_is_public_decl(die))
14358 if (die_die_attribute(die, DW_AT_type, type_die))
14375 die_loc_and_name(rdr, die, loc, name, linkage_name);
14396 if (rdr.get_variable_address(die, var_addr))
14435 /// @param is_declaration_only is true if the DIE denoted by @p die is
14516 /// positionned at, in the DIE tree. This is useful when @p die is
14738 /// @param scope the scope of the type die we are looking at.
14743 /// positionned at, in the DIE tree. This is useful when @p die is
14867 /// @param die the DW_TAG_subprogram DIE to read from.
14870 /// positionned at, in the DIE tree. This is useful when @p die is
14878 Dwarf_Die* die,
14883 if (!die)
14885 ABG_ASSERT(dwarf_tag(die) == DW_TAG_subprogram);
14887 if (!die_is_public_decl(die))
14895 die_loc_and_name(rdr, die, floc, fname, flinkage_name);
14897 size_t is_inline = die_is_declared_inline(die);
14899 is_class_or_union_type(get_scope_for_die(rdr, die, true, where_offset));
14920 function_type_sptr fn_type(build_function_type(rdr, die, is_method,
14942 if (rdr.get_function_address(die, fn_addr))
14962 rdr.associate_die_to_type(die, result->get_type(), where_offset);
14964 size_t die_offset = dwarf_dieoffset(die);
15031 Dwarf_Die* die)
15045 die_access_specifier(die, access);
15061 /// @param fn_die the DWARF die of @p fn.
15094 /// @param die the DIE to consider.
15108 /// positionned at, in the DIE tree. This is useful when @p die is
15116 /// @param is_declaration_only is true if the DIE denoted by @p die is
15122 Dwarf_Die* die,
15131 if (!die || !scope)
15134 int tag = dwarf_tag(die);
15138 if (rdr.load_all_types() && die_is_type(die))
15149 const die_source source_of_die = rdr.get_die_source(die);
15151 if ((result = rdr.lookup_decl_from_die_offset(dwarf_dieoffset(die),
15167 is_declaration_only = is_declaration_only && die_is_declaration_only(die);
15173 if (type_decl_sptr t = build_type_decl(rdr, die, where_offset))
15184 t = is_typedef(scope->find_member_type(die_name(die)));
15187 t = build_typedef_type(rdr, die,
15194 maybe_set_member_type_access_specifier(is_decl(result), die);
15203 build_pointer_type_def(rdr, die,
15220 build_reference_type(rdr, die,
15228 rdr.associate_die_to_type(die, r, where_offset);
15239 build_qualified_type(rdr, die,
15252 // Associate the die to type ty again because 'ty'might be
15255 rdr.associate_die_to_type(die, ty, where_offset);
15267 type_is_suppressed(rdr, scope, die, type_is_private);
15276 result = get_opaque_version_of_type(rdr, scope, die, where_offset);
15281 enum_type_decl_sptr e = build_enum_type(rdr, die, scope,
15287 maybe_set_member_type_access_specifier(is_decl(result), die);
15299 type_is_suppressed(rdr, scope, die, type_is_private);
15309 result = get_opaque_version_of_type(rdr, scope, die, where_offset);
15317 if (die_die_attribute(die, DW_AT_specification, spec_die))
15336 add_or_update_class_type(rdr, die,
15346 add_or_update_class_type(rdr, die, scope,
15355 maybe_set_member_type_access_specifier(klass, die);
15362 if (!type_is_suppressed(rdr, scope, die))
15365 add_or_update_union_type(rdr, die, scope,
15372 maybe_set_member_type_access_specifier(union_type, die);
15382 function_type_sptr f = build_function_type(rdr, die,
15396 die,
15403 rdr.associate_die_to_type(die, a, where_offset);
15414 build_subrange_type(rdr, die, where_offset);
15419 rdr.associate_die_to_type(die, s, where_offset);
15448 result = build_namespace_decl_and_add_to_ir(rdr, die, where_offset);
15460 if (die_die_attribute(die, DW_AT_specification, spec_die, false)
15461 || (var_is_cloned = die_die_attribute(die, DW_AT_abstract_origin,
15467 die_is_effectively_public_decl(rdr, die),
15484 m = build_var_decl(rdr, die, where_offset, m);
15488 rdr.associate_die_to_decl(die, m, where_offset,
15503 build_or_get_var_decl_if_not_suppressed(rdr, scope, die,
15525 if (die_is_artificial(die))
15529 bool has_spec = die_die_attribute(die, DW_AT_specification,
15532 die_die_attribute(die, DW_AT_abstract_origin,
15545 string linkage_name = die_linkage_name(die);
15588 die, where_offset,
15595 die)
15610 finish_member_function_reading(die, fn, klass, rdr);
15616 rdr.associate_die_to_decl(die, fn, where_offset,
15686 rdr.associate_die_to_decl(die, is_decl(result), where_offset,
15744 /// @param die the DIE to consider.
15755 /// positionned at, in the DIE tree. This is useful when @p die is
15762 Dwarf_Die* die,
15766 if (!die)
15772 return build_ir_node_from_die(rdr, die, scop.get(),
15787 called_from_public_decl || die_is_effectively_public_decl(rdr, die);
15788 scope_decl_sptr scope = get_scope_for_die(rdr, die,
15791 return build_ir_node_from_die(rdr, die, scope.get(),