Minor push_member_name improvement.
authorPer Bothner <bothner@gcc.gnu.org>
Wed, 22 Sep 1993 01:42:59 +0000 (18:42 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Wed, 22 Sep 1993 01:42:59 +0000 (18:42 -0700)
From-SVN: r5380

gcc/c-typeck.c

index 206f5c62801b7fd2fe096bc692e2858e4e3962bf..a298c57bd53e24a76e5b2c0df465a1602753c699 100644 (file)
@@ -4780,9 +4780,12 @@ push_string (string)
 /* Push a member name on the stack.  Printed as '.' STRING.  */
 
 static void
-push_member_name (string)
-     char *string;
+push_member_name (decl)
+     tree decl;
+     
 {
+  char *string
+    = DECL_NAME (decl) ? IDENTIFIER_POINTER (DECL_NAME (decl)) : "<anonymous>";
   PUSH_SPELLING (SPELLING_MEMBER, string, u.s);
 }
 
@@ -5519,7 +5522,7 @@ push_init_level (implicit)
       else
        {
          constructor_type = TREE_TYPE (constructor_fields);
-         push_member_name (IDENTIFIER_POINTER (DECL_NAME (constructor_fields)));
+         push_member_name (constructor_fields);
        }
     }
   else if (TREE_CODE (constructor_type) == ARRAY_TYPE)
@@ -6258,7 +6261,7 @@ process_init_element (value)
 
          if (value)
            {
-             push_member_name (IDENTIFIER_POINTER (DECL_NAME (constructor_fields)));
+             push_member_name (constructor_fields);
              output_init_element (value, fieldtype, constructor_fields, 1);
              RESTORE_SPELLING_DEPTH (constructor_depth);
            }
@@ -6315,7 +6318,7 @@ process_init_element (value)
 
          if (value)
            {
-             push_member_name (IDENTIFIER_POINTER (DECL_NAME (constructor_fields)));
+             push_member_name (constructor_fields);
              output_init_element (value, fieldtype, constructor_fields, 1);
              RESTORE_SPELLING_DEPTH (constructor_depth);
            }