aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog14
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/init.c4
-rw-r--r--gcc/cp/pt.c9
-rw-r--r--gcc/cp/rtti.c15
-rw-r--r--gcc/cp/semantics.c3
-rw-r--r--gcc/cp/typeck.c2
-rw-r--r--gcc/cp/typeck2.c11
10 files changed, 37 insertions, 27 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1b13649..40a2810 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,19 @@
2003-04-12 Zack Weinberg <zack@codesourcery.com>
+ * class.c (initialize_array)
+ * decl.c (reshape_init)
+ * decl2.c (build_expr_from_tree)
+ * init.c (build_zero_init)
+ * pt.c (tsubst_copy, tsubst_copy_and_build)
+ * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
+ (ptm_initializer, class_initializer, get_pseudo_ti_init)
+ * semantics.c (finish_compound_literal)
+ * typeck.c (build_ptrmemfunc1)
+ * typeck2.c (store_init_value, process_init_constructor)
+ (build_functional_cast): Use build_constructor.
+
+2003-04-12 Zack Weinberg <zack@codesourcery.com>
+
* call.c (print_z_candidates): Use gcc_gettext_width, not
strlen, to determine how much padding to use.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index ed0824a..382519e 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6843,7 +6843,7 @@ initialize_array (tree decl, tree inits)
context = DECL_CONTEXT (decl);
DECL_CONTEXT (decl) = NULL_TREE;
- DECL_INITIAL (decl) = build_nt (CONSTRUCTOR, NULL_TREE, inits);
+ DECL_INITIAL (decl) = build_constructor (NULL_TREE, inits);
TREE_HAS_CONSTRUCTOR (DECL_INITIAL (decl)) = 1;
cp_finish_decl (decl, DECL_INITIAL (decl), NULL_TREE, 0);
DECL_CONTEXT (decl) = context;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 28d1493..f5ee1a3 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7520,7 +7520,7 @@ reshape_init (tree type, tree *initp)
else
{
/* Build a CONSTRUCTOR to hold the contents of the aggregate. */
- new_init = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
+ new_init = build_constructor (type, NULL_TREE);
TREE_HAS_CONSTRUCTOR (new_init) = 1;
if (CLASS_TYPE_P (type))
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 0f8617c..57050d7 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3272,7 +3272,7 @@ build_expr_from_tree (t)
r = tree_cons (purpose, value, r);
}
- r = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (r));
+ r = build_constructor (NULL_TREE, nreverse (r));
TREE_HAS_CONSTRUCTOR (r) = TREE_HAS_CONSTRUCTOR (t);
if (type)
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index d854283..3083412 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -204,7 +204,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
tree inits;
/* Build a constructor to contain the initializations. */
- init = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
+ init = build_constructor (type, NULL_TREE);
/* Iterate over the fields, building initializations. */
inits = NULL_TREE;
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
@@ -236,7 +236,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
tree inits;
/* Build a constructor to contain the initializations. */
- init = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
+ init = build_constructor (type, NULL_TREE);
/* Iterate over the array elements, building initializations. */
inits = NULL_TREE;
max_index = nelts ? nelts : array_type_nelts (type);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index b373329..c8e7c40 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7534,10 +7534,9 @@ tsubst_copy (t, args, complain, in_decl)
case CONSTRUCTOR:
{
- r = build
- (CONSTRUCTOR, tsubst (TREE_TYPE (t), args, complain, in_decl),
- NULL_TREE, tsubst_copy (CONSTRUCTOR_ELTS (t), args,
- complain, in_decl));
+ r = build_constructor
+ (tsubst (TREE_TYPE (t), args, complain, in_decl),
+ tsubst_copy (CONSTRUCTOR_ELTS (t), args, complain, in_decl));
TREE_HAS_CONSTRUCTOR (r) = TREE_HAS_CONSTRUCTOR (t);
return r;
}
@@ -8348,7 +8347,7 @@ tsubst_copy_and_build (t, args, complain, in_decl)
r = tree_cons (purpose, value, r);
}
- r = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (r));
+ r = build_constructor (NULL_TREE, nreverse (r));
TREE_HAS_CONSTRUCTOR (r) = TREE_HAS_CONSTRUCTOR (t);
if (type)
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 24ba0fd..8283acb 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -811,7 +811,7 @@ tinfo_base_init (tree desc, tree target)
init = tree_cons (NULL_TREE, decay_conversion (name_decl), init);
- init = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, nreverse (init));
+ init = build_constructor (NULL_TREE, nreverse (init));
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
init = tree_cons (NULL_TREE, init, NULL_TREE);
@@ -827,7 +827,7 @@ generic_initializer (tree desc, tree target)
{
tree init = tinfo_base_init (desc, target);
- init = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, init);
+ init = build_constructor (NULL_TREE, init);
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
return init;
}
@@ -854,7 +854,7 @@ ptr_initializer (tree desc, tree target, bool *non_public_ptr)
get_tinfo_ptr (TYPE_MAIN_VARIANT (to)),
init);
- init = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, nreverse (init));
+ init = build_constructor (NULL_TREE, nreverse (init));
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
return init;
}
@@ -891,7 +891,7 @@ ptm_initializer (tree desc, tree target, bool *non_public_ptr)
get_tinfo_ptr (klass),
init);
- init = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, nreverse (init));
+ init = build_constructor (NULL_TREE, nreverse (init));
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
return init;
}
@@ -959,7 +959,7 @@ class_initializer (tree desc, tree target, tree trail)
tree init = tinfo_base_init (desc, target);
TREE_CHAIN (init) = trail;
- init = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, init);
+ init = build_constructor (NULL_TREE, init);
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
return init;
}
@@ -1078,12 +1078,11 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
build_int_2 (flags, 0));
base_init = tree_cons (NULL_TREE, offset, base_init);
base_init = tree_cons (NULL_TREE, tinfo, base_init);
- base_init = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, base_init);
+ base_init = build_constructor (NULL_TREE, base_init);
TREE_HAS_CONSTRUCTOR (base_init) = 1;
base_inits = tree_cons (NULL_TREE, base_init, base_inits);
}
- base_inits = build (CONSTRUCTOR,
- NULL_TREE, NULL_TREE, base_inits);
+ base_inits = build_constructor (NULL_TREE, base_inits);
TREE_HAS_CONSTRUCTOR (base_inits) = 1;
base_inits = tree_cons (NULL_TREE, base_inits, NULL_TREE);
/* Prepend the number of bases. */
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index a5b7c50..7c7af3e 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1600,8 +1600,7 @@ finish_compound_literal (type, initializer_list)
tree compound_literal;
/* Build a CONSTRUCTOR for the INITIALIZER_LIST. */
- compound_literal = build_nt (CONSTRUCTOR, NULL_TREE,
- initializer_list);
+ compound_literal = build_constructor (NULL_TREE, initializer_list);
/* Mark it as a compound-literal. */
TREE_HAS_CONSTRUCTOR (compound_literal) = 1;
if (processing_template_decl)
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 45d528f..8e2682f 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5781,7 +5781,7 @@ build_ptrmemfunc1 (type, delta, pfn)
/* Finish creating the initializer. */
u = tree_cons (pfn_field, pfn,
build_tree_list (delta_field, delta));
- u = build (CONSTRUCTOR, type, NULL_TREE, u);
+ u = build_constructor (type, u);
TREE_CONSTANT (u) = TREE_CONSTANT (pfn) && TREE_CONSTANT (delta);
TREE_STATIC (u) = (TREE_CONSTANT (u)
&& (initializer_constant_valid_p (pfn, TREE_TYPE (pfn))
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index c454048..2df882a 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -336,7 +336,7 @@ store_init_value (decl, init)
if (TREE_CODE (init) == TREE_LIST)
{
error ("constructor syntax used, but no constructor declared for type `%T'", type);
- init = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (init));
+ init = build_constructor (NULL_TREE, nreverse (init));
}
}
else if (TREE_CODE (init) == TREE_LIST
@@ -704,7 +704,7 @@ process_init_constructor (type, init, elts)
if (IS_AGGR_TYPE (TREE_TYPE (type)))
next1 = build_functional_cast (TREE_TYPE (type), NULL_TREE);
else
- next1 = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, NULL_TREE);
+ next1 = build_constructor (NULL_TREE, NULL_TREE);
next1 = digest_init (TREE_TYPE (type), next1, 0);
}
else if (! zero_init_p (TREE_TYPE (type)))
@@ -797,8 +797,7 @@ process_init_constructor (type, init, elts)
NULL_TREE);
else
{
- next1 = build (CONSTRUCTOR, NULL_TREE, NULL_TREE,
- NULL_TREE);
+ next1 = build_constructor (NULL_TREE, NULL_TREE);
if (init)
TREE_HAS_CONSTRUCTOR (next1)
= TREE_HAS_CONSTRUCTOR (init);
@@ -926,7 +925,7 @@ process_init_constructor (type, init, elts)
if (erroneous)
return error_mark_node;
- result = build (CONSTRUCTOR, type, NULL_TREE, nreverse (members));
+ result = build_constructor (type, nreverse (members));
if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == NULL_TREE)
complete_array_type (type, result, /*do_default=*/0);
if (init)
@@ -1232,7 +1231,7 @@ build_functional_cast (exp, parms)
if (parms == NULL_TREE && !TYPE_NEEDS_CONSTRUCTING (type)
&& TYPE_HAS_DEFAULT_CONSTRUCTOR (type))
{
- exp = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
+ exp = build_constructor (type, NULL_TREE);
return get_target_expr (exp);
}