Commit 38f01e5a by Jason Merrill Committed by Jason Merrill

cp-tree.h (FORMAT_VBASE_NAME): New macro.

	* cp-tree.h (FORMAT_VBASE_NAME): New macro.
	* class.c (build_vbase_pointer): Use it.
	* rtti.c (expand_class_desc): Likewise.
	* tree.c (build_vbase_pointer_fields): Likewise.

From-SVN: r22713
parent 43cab252
1998-10-01 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h (FORMAT_VBASE_NAME): New macro.
* class.c (build_vbase_pointer): Use it.
* rtti.c (expand_class_desc): Likewise.
* tree.c (build_vbase_pointer_fields): Likewise.
Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
* decl.c (start_decl): Add invocation of
......
......@@ -146,9 +146,8 @@ build_vbase_pointer (exp, type)
tree exp, type;
{
char *name;
FORMAT_VBASE_NAME (name, type);
name = (char *) alloca (TYPE_NAME_LENGTH (type) + sizeof (VBASE_NAME) + 1);
sprintf (name, VBASE_NAME_FORMAT, TYPE_NAME_STRING (type));
return build_component_ref (exp, get_identifier (name), NULL_TREE, 0);
}
......
......@@ -2140,6 +2140,13 @@ extern int current_function_parms_stored;
&& IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \
&& IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
/* Store the vbase pointer field name for type TYPE into pointer BUF. */
#define FORMAT_VBASE_NAME(BUF,TYPE) do { \
BUF = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE) \
+ sizeof (VBASE_NAME) + 1); \
sprintf (BUF, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE)); \
} while (0)
#define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
#define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
......
......@@ -801,8 +801,7 @@ expand_class_desc (tdecl, type)
char *name;
tree field;
name = (char *) alloca (TYPE_NAME_LENGTH (t)+sizeof (VBASE_NAME)+1);
sprintf (name, VBASE_NAME_FORMAT, TYPE_NAME_STRING (t));
FORMAT_VBASE_NAME (name, t);
field = lookup_field (type, get_identifier (name), 0, 0);
offset = size_binop (FLOOR_DIV_EXPR,
DECL_FIELD_BITPOS (field), size_int (BITS_PER_UNIT));
......
......@@ -882,8 +882,7 @@ build_vbase_pointer_fields (rec)
if (TREE_VIA_VIRTUAL (base_binfo))
{
int j;
char *name = (char *)alloca (TYPE_NAME_LENGTH (basetype)
+ sizeof (VBASE_NAME) + 1);
char *name;
/* The offset for a virtual base class is only used in computing
virtual function tables and for initializing virtual base
......@@ -903,7 +902,7 @@ build_vbase_pointer_fields (rec)
))
goto got_it;
}
sprintf (name, VBASE_NAME_FORMAT, TYPE_NAME_STRING (basetype));
FORMAT_VBASE_NAME (name, basetype);
decl = build_lang_field_decl (FIELD_DECL, get_identifier (name),
build_pointer_type (basetype));
/* If you change any of the below, take a look at all the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment