Hi,

On 02/28/2014 04:50 PM, Jason Merrill wrote:
OK, thanks.
Applied. I have just noticed (sorry) that get_AT_ref (thus get_AT) isn't trivial at all, thus I propose to apply the below. Is it Ok with you?

Thanks,
Paolo.

//////////////////////
2014-03-01  Paolo Carlini  <paolo.carl...@oracle.com>

        * dwarf2out.c (gen_subprogram_die): Tidy.
Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 208243)
+++ dwarf2out.c (working copy)
@@ -18028,11 +18028,13 @@ gen_subprogram_die (tree decl, dw_die_ref context_
 
          /* If the prototype had an 'auto' or 'decltype(auto)' return type,
             emit the real type on the definition die.  */
-         if (is_cxx() && debug_info_level > DINFO_LEVEL_TERSE
-             && (get_AT_ref (old_die, DW_AT_type) == auto_die
-                 || get_AT_ref (old_die, DW_AT_type) == decltype_auto_die))
-           add_type_attribute (subr_die, TREE_TYPE (TREE_TYPE (decl)),
-                               0, 0, context_die);
+         if (is_cxx() && debug_info_level > DINFO_LEVEL_TERSE)
+           {
+             dw_die_ref die = get_AT_ref (old_die, DW_AT_type);
+             if (die == auto_die || die == decltype_auto_die)
+               add_type_attribute (subr_die, TREE_TYPE (TREE_TYPE (decl)),
+                                   0, 0, context_die);
+           }
        }
     }
   else

Reply via email to