aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-08-30 22:54:06 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-08-30 22:54:06 +0000
commit19c29b2fc41bad4e3676f3977e4ebc88ee936b64 (patch)
treecb48a2f26270dff9ebb3b93323918ba903e7d7e4 /gcc/cp/class.c
parentff164b22d364c830b43d08e521a768b2a2957bbc (diff)
downloadgcc-19c29b2fc41bad4e3676f3977e4ebc88ee936b64.zip
gcc-19c29b2fc41bad4e3676f3977e4ebc88ee936b64.tar.gz
gcc-19c29b2fc41bad4e3676f3977e4ebc88ee936b64.tar.bz2
cp-tree.h (initialize_artificial_var): Declare.
* cp-tree.h (initialize_artificial_var): Declare. * decl.c (initialize_artifical_var): New function. * class.c (initialize_array): Remove. (initialize_vtable): Use initialize_artificial_var. (build_vtt): Likewise. (build_ctor_vtbl_group): Likewise. From-SVN: r86809
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 272c4d6..21bdfdd 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -170,7 +170,6 @@ static void dump_vtt (tree, tree);
static void dump_thunk (FILE *, int, tree);
static tree build_vtable (tree, tree, tree);
static void initialize_vtable (tree, tree);
-static void initialize_array (tree, tree);
static void layout_nonempty_base_or_field (record_layout_info,
tree, tree, splay_tree);
static tree end_of_class (tree, int);
@@ -6681,20 +6680,10 @@ initialize_vtable (tree binfo, tree inits)
layout_vtable_decl (binfo, list_length (inits));
decl = get_vtbl_decl_for_binfo (binfo);
- initialize_array (decl, inits);
+ initialize_artificial_var (decl, inits);
dump_vtable (BINFO_TYPE (binfo), binfo, decl);
}
-/* Initialize DECL (a declaration for a namespace-scope array) with
- the INITS. */
-
-static void
-initialize_array (tree decl, tree inits)
-{
- DECL_INITIAL (decl) = build_constructor (NULL_TREE, inits);
- cp_finish_decl (decl, DECL_INITIAL (decl), NULL_TREE, 0);
-}
-
/* Build the VTT (virtual table table) for T.
A class requires a VTT if it has virtual bases.
@@ -6731,7 +6720,7 @@ build_vtt (tree t)
/* Now, build the VTT object itself. */
vtt = build_vtable (t, get_vtt_name (t), type);
- initialize_array (vtt, inits);
+ initialize_artificial_var (vtt, inits);
/* Add the VTT to the vtables list. */
TREE_CHAIN (vtt) = TREE_CHAIN (CLASSTYPE_VTABLES (t));
TREE_CHAIN (CLASSTYPE_VTABLES (t)) = vtt;
@@ -7018,7 +7007,7 @@ build_ctor_vtbl_group (tree binfo, tree t)
/* Initialize the construction vtable. */
CLASSTYPE_VTABLES (t) = chainon (CLASSTYPE_VTABLES (t), vtbl);
- initialize_array (vtbl, inits);
+ initialize_artificial_var (vtbl, inits);
dump_vtable (t, binfo, vtbl);
}