Commit 9d6a019c by Nathan Froyd Committed by Nathan Froyd

class.c (struct vtbl_init_data_s): Remove last_init field.

	* class.c (struct vtbl_init_data_s): Remove last_init field.
	(struct secondary_vptr_vtt_init_data_s): Change type of inits field
	to a VEC.
	(finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
	initializers.
	(build_vtt): Likewise.
	(initialize_vtable): Take a VEC instead of a tree.
	(build_vtt_inits): Change return type to void.  Take a VEC **
	instead of a tree *; accumulate results into said VEC.
	(build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
	accumulated initializers.  Pass the vtable to accumulate_vtbl_inits.
	(accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
	instead of a tree.
	(dfs_accumulate_vtbl_inits): Likewise.  Change return type to void.
	(build_vtbl_initializer): Add VEC parameter; accumulate initializers
	into it.
	(dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
	rather than tree_cons.
	(build_vbase_offset_vtbl_entries): Likewise.
	(add_vcall_offset): Likewise.
	(build_rtti_vtbl_entries): Likewise.
	* cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
	* decl.c (initialize_artificial_var): Use build_constructor instead
	of build_constructor_from_list.

From-SVN: r160233
parent 8eee0b8f
2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
* class.c (struct vtbl_init_data_s): Remove last_init field.
(struct secondary_vptr_vtt_init_data_s): Change type of inits field
to a VEC.
(finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
initializers.
(build_vtt): Likewise.
(initialize_vtable): Take a VEC instead of a tree.
(build_vtt_inits): Change return type to void. Take a VEC **
instead of a tree *; accumulate results into said VEC.
(build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
(accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
instead of a tree.
(dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
(build_vtbl_initializer): Add VEC parameter; accumulate initializers
into it.
(dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
rather than tree_cons.
(build_vbase_offset_vtbl_entries): Likewise.
(add_vcall_offset): Likewise.
(build_rtti_vtbl_entries): Likewise.
* cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
* decl.c (initialize_artificial_var): Use build_constructor instead
of build_constructor_from_list.
2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
PR c++/44294
......
......@@ -4743,7 +4743,7 @@ extern tree check_elaborated_type_specifier (enum tag_types, tree, bool);
extern void warn_extern_redeclared_static (tree, tree);
extern tree cxx_comdat_group (tree);
extern bool cp_missing_noreturn_ok_p (tree);
extern void initialize_artificial_var (tree, tree);
extern void initialize_artificial_var (tree, VEC(constructor_elt,gc) *);
extern tree check_var_type (tree, tree);
extern tree reshape_init (tree, tree);
extern tree next_initializable_field (tree);
......
......@@ -5542,16 +5542,15 @@ initialize_local_var (tree decl, tree init)
/* DECL is a VAR_DECL for a compiler-generated variable with static
storage duration (like a virtual table) whose initializer is a
compile-time constant. INIT must be either a TREE_LIST of values,
or a CONSTRUCTOR. Initialize the variable and provide it to the
compile-time constant. Initialize the variable and provide it to the
back end. */
void
initialize_artificial_var (tree decl, tree init)
initialize_artificial_var (tree decl, VEC(constructor_elt,gc) *v)
{
tree init;
gcc_assert (DECL_ARTIFICIAL (decl));
if (TREE_CODE (init) == TREE_LIST)
init = build_constructor_from_list (TREE_TYPE (decl), init);
init = build_constructor (TREE_TYPE (decl), v);
gcc_assert (TREE_CODE (init) == CONSTRUCTOR);
DECL_INITIAL (decl) = init;
DECL_INITIALIZED_P (decl) = 1;
......
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