aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1993-09-21 18:42:59 -0700
committerPer Bothner <bothner@gcc.gnu.org>1993-09-21 18:42:59 -0700
commitcb96be0bf70de411aab1e2b71953371f15a00b88 (patch)
tree9a57a41074fdbf102f947eeef1b86935146fee64 /gcc
parentca695ac93dca6da6f9bcb2916cd3798f016084b2 (diff)
downloadgcc-cb96be0bf70de411aab1e2b71953371f15a00b88.zip
gcc-cb96be0bf70de411aab1e2b71953371f15a00b88.tar.gz
gcc-cb96be0bf70de411aab1e2b71953371f15a00b88.tar.bz2
Minor push_member_name improvement.
From-SVN: r5380
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 206f5c6..a298c57 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -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);
}