* 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
+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
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);
}
&& 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))
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));
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
))
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