Patch from Joern to fix dwarf1 bug: emit debug info for types defined in
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Mon, 26 Jan 1998 18:13:41 +0000 (18:13 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 26 Jan 1998 18:13:41 +0000 (10:13 -0800)
parameter lists.
* c-decl.c (grokdeclarator): Get parameter tags from
last_function_parm_tags.
* dwarfout.c (output_formal_types): Set TREE_ASM_WRITTEN before
traversing the parameter types.
(output_type): No early exit for FUNCTION_TYPE / METHOD_TYPE context.

From-SVN: r17490

gcc/ChangeLog
gcc/c-decl.c
gcc/dwarfout.c

index fcaa21f89bdd18785c2dce0b1e41bf7e314948ae..deb2d9c58c361f8ccf68417d78d416bcdd8b7f2c 100644 (file)
@@ -1,3 +1,11 @@
+Mon Jan 26 18:11:30 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * c-decl.c (grokdeclarator): Get parameter tags from
+       last_function_parm_tags.
+       * dwarfout.c (output_formal_types): Set TREE_ASM_WRITTEN before
+       traversing the parameter types.
+       (output_type): No early exit for FUNCTION_TYPE / METHOD_TYPE context.
+
 Mon Jan 26 01:44:12 1998  Jeffrey A Law  (law@cygnus.com)
 
        * h8300.c (print_operand): Handle CONST_DOUBLE for 'e', 'f', and
index d7f5737d3a92b48c3df3630e4bd40ddea59027cf..3c000e2523c8700fb452ae30c537af120d1e4ea5 100644 (file)
@@ -4878,7 +4878,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
          {
            register tree link;
 
-           for (link = current_function_parm_tags;
+           for (link = last_function_parm_tags;
                 link;
                 link = TREE_CHAIN (link))
              TYPE_CONTEXT (TREE_VALUE (link)) = type;
index 34527a34a4a759aa830718093c1bb2aa80a0f706..406fb89f4cd749747e49d98fc6e9dbc8e12c2e22 100644 (file)
@@ -4018,6 +4018,12 @@ output_formal_types (function_or_method_type)
   register tree formal_type = NULL;
   register tree first_parm_type = TYPE_ARG_TYPES (function_or_method_type);
 
+  /* Set TREE_ASM_WRITTEN while processing the parameters, lest we
+     get bogus recursion when outputting tagged types local to a
+     function declaration.  */
+  int save_asm_written = TREE_ASM_WRITTEN (function_or_method_type);
+  TREE_ASM_WRITTEN (function_or_method_type) = 1;
+
   /* In the case where we are generating a formal types list for a C++
      non-static member function type, skip over the first thing on the
      TYPE_ARG_TYPES list because it only represents the type of the
@@ -4063,6 +4069,8 @@ output_formal_types (function_or_method_type)
 
       output_type (formal_type, function_or_method_type);
     }
+
+  TREE_ASM_WRITTEN (function_or_method_type) = save_asm_written;
 }
 \f
 /* Remember a type in the pending_types_list.  */
@@ -4353,7 +4361,9 @@ output_type (type, containing_scope)
 
        if (TYPE_SIZE (type) == 0
            && (TYPE_CONTEXT (type) == NULL
-               || TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't')
+               || (TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't'
+                   && TREE_CODE (TYPE_CONTEXT (type)) != FUNCTION_TYPE
+                   && TREE_CODE (TYPE_CONTEXT (type)) != METHOD_TYPE))
            && !finalizing)
          return;       /* EARLY EXIT!  Avoid setting TREE_ASM_WRITTEN.  */