summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2001-07-25 08:54:06 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2001-07-25 08:54:06 +0000
commit0abe00c528965ac8c84fed624ab93dc30e7636b9 (patch)
treeed500a3570f1d4d23489c787d75c0dfc4db6cf26
parent90b1ca2f5203e8df93ff5ae83aeff062b08ab7f9 (diff)
downloadgcc-0abe00c528965ac8c84fed624ab93dc30e7636b9.tar.gz
class.c (build_vtbl_or_vbase_field): Remove, move into ...
cp: * class.c (build_vtbl_or_vbase_field): Remove, move into ... (create_vtbl_ptr): ... here. From-SVN: r44337
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/class.c63
2 files changed, 21 insertions, 47 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 08e91be10b2..6ae301c5c3a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+ * class.c (build_vtbl_or_vbase_field): Remove, move into ...
+ (create_vtbl_ptr): ... here.
+
+2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
* class.c (build_vbase_offset_vbtl_entries): Look for
non-primary base of which we are a sub vtable.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f6729541b49..4ff29a1e67a 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -146,8 +146,6 @@ static bool build_base_field PARAMS ((record_layout_info, tree, int *,
splay_tree, tree));
static bool build_base_fields PARAMS ((record_layout_info, int *,
splay_tree, tree));
-static tree build_vtbl_or_vbase_field PARAMS ((tree, tree, tree, tree, tree,
- int *));
static void check_methods PARAMS ((tree));
static void remove_zero_width_bit_fields PARAMS ((tree));
static void check_bases PARAMS ((tree, int *, int *, int *));
@@ -3496,43 +3494,6 @@ check_field_decls (t, access_decls, empty_p,
*access_decls = nreverse (*access_decls);
}
-/* Return a FIELD_DECL for a pointer-to-virtual-table or
- pointer-to-virtual-base. The NAME, ASSEMBLER_NAME, and TYPE of the
- field are as indicated. The CLASS_TYPE in which this field occurs
- is also indicated. FCONTEXT is the type that is needed for the debug
- info output routines. *EMPTY_P is set to a non-zero value by this
- function to indicate that a class containing this field is
- non-empty. */
-
-static tree
-build_vtbl_or_vbase_field (name, assembler_name, type, class_type, fcontext,
- empty_p)
- tree name;
- tree assembler_name;
- tree type;
- tree class_type;
- tree fcontext;
- int *empty_p;
-{
- tree field;
-
- /* This class is non-empty. */
- *empty_p = 0;
-
- /* Build the FIELD_DECL. */
- field = build_decl (FIELD_DECL, name, type);
- SET_DECL_ASSEMBLER_NAME (field, assembler_name);
- DECL_VIRTUAL_P (field) = 1;
- DECL_ARTIFICIAL (field) = 1;
- DECL_FIELD_CONTEXT (field) = class_type;
- DECL_FCONTEXT (field) = fcontext;
- DECL_ALIGN (field) = TYPE_ALIGN (type);
- DECL_USER_ALIGN (field) = TYPE_USER_ALIGN (type);
-
- /* Return it. */
- return field;
-}
-
/* If TYPE is an empty class type, records its OFFSET in the table of
OFFSETS. */
@@ -4490,13 +4451,21 @@ create_vtable_ptr (t, empty_p, vfuns_p,
bounds. That's better than using `void*' or some such; it's
cleaner, and it let's the alias analysis code know that these
stores cannot alias stores to void*! */
- TYPE_VFIELD (t)
- = build_vtbl_or_vbase_field (get_vfield_name (t),
- get_identifier (VFIELD_BASE),
- vtbl_ptr_type_node,
- t,
- t,
- empty_p);
+ tree field;
+
+ field = build_decl (FIELD_DECL, get_vfield_name (t), vtbl_ptr_type_node);
+ SET_DECL_ASSEMBLER_NAME (field, get_identifier (VFIELD_BASE));
+ DECL_VIRTUAL_P (field) = 1;
+ DECL_ARTIFICIAL (field) = 1;
+ DECL_FIELD_CONTEXT (field) = t;
+ DECL_FCONTEXT (field) = t;
+ DECL_ALIGN (field) = TYPE_ALIGN (vtbl_ptr_type_node);
+ DECL_USER_ALIGN (field) = TYPE_USER_ALIGN (vtbl_ptr_type_node);
+
+ TYPE_VFIELD (t) = field;
+
+ /* This class is non-empty. */
+ *empty_p = 0;
if (CLASSTYPE_N_BASECLASSES (t))
/* If there were any baseclasses, they can't possibly be at
@@ -4505,7 +4474,7 @@ create_vtable_ptr (t, empty_p, vfuns_p,
take work. */
TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (t) = 1;
- return TYPE_VFIELD (t);
+ return field;
}
return NULL_TREE;