-
- Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
- &attr_mem);
- if (attr == NULL)
- /* The function has no return value, like a `void' function in C. */
- return 0;
-
- Dwarf_Die die_mem;
- Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
- int tag = dwarf_tag (typedie);
-
- /* Follow typedefs and qualifiers to get to the actual type. */
- while (tag == DW_TAG_typedef
- || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
- || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
- {
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
- typedie = dwarf_formref_die (attr, &die_mem);
- tag = dwarf_tag (typedie);
- }
+ Dwarf_Die die_mem, *typedie = &die_mem;
+ int tag = dwarf_peeled_die_type (functypedie, typedie);
+ if (tag <= 0)
+ return tag;