diff options
Diffstat (limited to 'backends/alpha_retval.c')
| -rw-r--r-- | backends/alpha_retval.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/backends/alpha_retval.c b/backends/alpha_retval.c index 6dfa6944..53dbfa45 100644 --- a/backends/alpha_retval.c +++ b/backends/alpha_retval.c @@ -1,5 +1,5 @@ /* Function return value location for Alpha ELF ABI. - Copyright (C) 2005, 2007 Red Hat, Inc. + Copyright (C) 2005, 2007, 2014 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -67,27 +67,10 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) { /* Start with the function's type, and get the DW_AT_type attribute, which is the type of the return value. */ - - 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_OR_RETURN (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_integrate (typedie, DW_AT_type, &attr_mem); - typedie = dwarf_formref_die (attr, &die_mem); - tag = DWARF_TAG_OR_RETURN (typedie); - } + Dwarf_Die die_mem, *typedie = &die_mem; + int tag = dwarf_peeled_die_type (functypedie, typedie); + if (tag <= 0) + return tag; switch (tag) { @@ -97,6 +80,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_subrange_type: if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) { + Dwarf_Attribute attr_mem, *attr; attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = DWARF_TAG_OR_RETURN (typedie); @@ -108,6 +92,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_pointer_type: case DW_TAG_ptr_to_member_type: { + Dwarf_Attribute attr_mem; Dwarf_Word size; if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, &attr_mem), &size) != 0) |
