aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2003-04-13 01:45:35 +0000
committerZack Weinberg <zack@gcc.gnu.org>2003-04-13 01:45:35 +0000
commitdcf92453c80642d3b98252f21a64ce8277cca8c5 (patch)
treed3a49132e8246b9fe0b8818a628270a745927d80 /gcc/ada
parent71707889ed275ce5ab2cc6e085b91f5a9324fbe4 (diff)
downloadgcc-dcf92453c80642d3b98252f21a64ce8277cca8c5.zip
gcc-dcf92453c80642d3b98252f21a64ce8277cca8c5.tar.gz
gcc-dcf92453c80642d3b98252f21a64ce8277cca8c5.tar.bz2
tree.c (build_constructor): New function.
* tree.c (build_constructor): New function. * tree.h: Prototype it. * c-typeck.c (build_c_cast, pop_init_level) * profile.c (build_function_info_value, build_gcov_info_value) (create_profiler): Use build_constructor. * builtins.c (expand_builtin_args_info): Remove #if 0 blocks. * objc/objc-act.c (build_constructor): Rename objc_build_constructor. Use build_constructor. (build_objc_string_object, objc_add_static_instance) (init_def_list, init_objc_symtab, init_module_descriptor) (generate_static_references, build_selector_translation_table) (build_descriptor_table_initializer, generate_descriptor_table) (build_protocol_initializer, build_ivar_list_initializer) (generate_ivars_list, build_dispatch_table_initializer) (generate_dispatch_table, generate_protocol_list) (build_category_initializer, build_shared_structure_initializer): Update to match. ada: * gigi.h, utils2.c (build_constructor): Rename gnat_build_constructor. Use build_constructor. * decl.c (gnat_to_gnu_entity) * trans.c (tree_transform, pos_to_constructor, extract_values) * ada/utils.c (build_template, convert_to_fat_pointer, convert) (unchecked_convert) * ada/utils2.c (build_binary_op, build_call_raise, build_allocator) (fill_vms_descriptor): Update to match. cp: * 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. f: * com.c (ffecom_build_complex_constant_, ffecom_expr_) (ffecom_init_zero_, ffecom_transform_namelist_, ffecom_vardesc_) (ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_2) * ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_) (ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_): Use build_constructor. java: * class.c (make_field_value, make_method_value, get_dispatch_table) (make_class_data, emit_offset_symbol_table) * constants.c (build_constants_constructor) * java-tree.h (START_RECORD_CONSTRUCTOR) * parse.y (maybe_build_array_element_wfl): Use build_constructor. From-SVN: r65539
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog12
-rw-r--r--gcc/ada/decl.c4
-rw-r--r--gcc/ada/gigi.h5
-rw-r--r--gcc/ada/trans.c12
-rw-r--r--gcc/ada/utils.c14
-rw-r--r--gcc/ada/utils2.c10
6 files changed, 35 insertions, 22 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1993f76..038b18f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,15 @@
+2003-04-12 Zack Weinberg <zack@codesourcery.com>
+
+ * gigi.h, utils2.c (build_constructor):
+ Rename gnat_build_constructor. Use build_constructor.
+ * decl.c (gnat_to_gnu_entity)
+ * trans.c (tree_transform, pos_to_constructor, extract_values)
+ * ada/utils.c (build_template, convert_to_fat_pointer, convert)
+ (unchecked_convert)
+ * ada/utils2.c (build_binary_op, build_call_raise, build_allocator)
+ (fill_vms_descriptor):
+ Update to match.
+
2003-04-06 Zack Weinberg <zack@codesourcery.com>
* ada-tree.def: Make fourth element for GNAT_LOOP_ID zero.
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index adf6481..1225ba1 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -812,7 +812,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
&& TYPE_CONTAINS_TEMPLATE_P (gnu_type)
&& gnu_expr == 0)
gnu_expr
- = build_constructor
+ = gnat_build_constructor
(gnu_type,
tree_cons
(TYPE_FIELDS (gnu_type),
@@ -957,7 +957,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
if (gnu_expr != 0)
gnu_expr
- = build_constructor (gnu_new_type,
+ = gnat_build_constructor (gnu_new_type,
tree_cons (TYPE_FIELDS (gnu_new_type),
gnu_expr, NULL_TREE));
set_lineno (gnat_entity, 1);
diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h
index a91b98c..4094f49 100644
--- a/gcc/ada/gigi.h
+++ b/gcc/ada/gigi.h
@@ -691,8 +691,9 @@ extern tree build_call_0_expr PARAMS((tree));
name, if requested. MSG says which exception function to call. */
extern tree build_call_raise PARAMS((int));
-/* Return a CONSTRUCTOR of TYPE whose list is LIST. */
-extern tree build_constructor PARAMS((tree, tree));
+/* Return a CONSTRUCTOR of TYPE whose list is LIST. This is not the
+ same as build_constructor in the language-independent tree.c. */
+extern tree gnat_build_constructor PARAMS((tree, tree));
/* Return a COMPONENT_REF to access a field that is given by COMPONENT,
an IDENTIFIER_NODE giving the name of the field, FIELD, a FIELD_DECL,
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index 68bb09e..4155eec 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -647,7 +647,7 @@ tree_transform (gnat_node)
gnu_list);
gnu_result
- = build_constructor (gnu_result_type, nreverse (gnu_list));
+ = gnat_build_constructor (gnu_result_type, nreverse (gnu_list));
}
break;
@@ -1620,7 +1620,7 @@ tree_transform (gnat_node)
= TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_result_type)));
if (Null_Record_Present (gnat_node))
- gnu_result = build_constructor (gnu_aggr_type, NULL_TREE);
+ gnu_result = gnat_build_constructor (gnu_aggr_type, NULL_TREE);
else if (TREE_CODE (gnu_aggr_type) == RECORD_TYPE)
gnu_result
@@ -2454,7 +2454,7 @@ tree_transform (gnat_node)
gnu_ret_val = TREE_VALUE (TYPE_CI_CO_LIST (gnu_subprog_type));
else
gnu_ret_val
- = build_constructor (TREE_TYPE (gnu_subprog_type),
+ = gnat_build_constructor (TREE_TYPE (gnu_subprog_type),
TYPE_CI_CO_LIST (gnu_subprog_type));
}
@@ -2696,7 +2696,7 @@ tree_transform (gnat_node)
if (list_length (gnu_cico_list) == 1)
gnu_retval = TREE_VALUE (gnu_cico_list);
else
- gnu_retval = build_constructor (TREE_TYPE (gnu_subprog_type),
+ gnu_retval = gnat_build_constructor (TREE_TYPE (gnu_subprog_type),
gnu_cico_list);
if (DECL_P (gnu_retval) && DECL_BY_REF_P (gnu_retval))
@@ -5011,7 +5011,7 @@ pos_to_constructor (gnat_expr, gnu_array_type, gnat_component_type)
gnu_expr_list);
}
- return build_constructor (gnu_array_type, nreverse (gnu_expr_list));
+ return gnat_build_constructor (gnu_array_type, nreverse (gnu_expr_list));
}
/* Subroutine of assoc_to_constructor: VALUES is a list of field associations,
@@ -5062,7 +5062,7 @@ extract_values (values, record_type)
result = tree_cons (field, value, result);
}
- return build_constructor (record_type, nreverse (result));
+ return gnat_build_constructor (record_type, nreverse (result));
}
/* EXP is to be treated as an array or record. Handle the cases when it is
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index a5d2860..fa58936 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -2206,7 +2206,7 @@ build_template (template_type, array_type, expr)
tree_cons (field, min, template_elts));
}
- return build_constructor (template_type, nreverse (template_elts));
+ return gnat_build_constructor (template_type, nreverse (template_elts));
}
/* Build a VMS descriptor from a Mechanism_Type, which must specify
@@ -2681,7 +2681,7 @@ convert_to_fat_pointer (type, expr)
pointer to the template and array. */
if (integer_zerop (expr))
return
- build_constructor
+ gnat_build_constructor
(type,
tree_cons (TYPE_FIELDS (type),
convert (TREE_TYPE (TYPE_FIELDS (type)), expr),
@@ -2715,7 +2715,7 @@ convert_to_fat_pointer (type, expr)
/* The result is a CONSTRUCTOR for the fat pointer. */
return
- build_constructor (type,
+ gnat_build_constructor (type,
tree_cons (TYPE_FIELDS (type), expr,
tree_cons (TREE_CHAIN (TYPE_FIELDS (type)),
template_addr, NULL_TREE)));
@@ -2818,7 +2818,7 @@ convert (type, expr)
else
return
- build_constructor (type,
+ gnat_build_constructor (type,
tree_cons (TYPE_FIELDS (type),
convert (TREE_TYPE
(TYPE_FIELDS (type)),
@@ -2849,7 +2849,7 @@ convert (type, expr)
tree obj_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type)));
return
- build_constructor
+ gnat_build_constructor
(type,
tree_cons (TYPE_FIELDS (type),
build_template (TREE_TYPE (TYPE_FIELDS (type)),
@@ -3017,7 +3017,7 @@ convert (type, expr)
case RECORD_TYPE:
if (TYPE_LEFT_JUSTIFIED_MODULAR_P (type) && ! AGGREGATE_TYPE_P (etype))
return
- build_constructor
+ gnat_build_constructor
(type, tree_cons (TYPE_FIELDS (type),
convert (TREE_TYPE (TYPE_FIELDS (type)), expr),
NULL_TREE));
@@ -3263,7 +3263,7 @@ unchecked_convert (type, expr)
TYPE_FIELDS (rec_type) = field;
layout_type (rec_type);
- expr = build_constructor (rec_type, build_tree_list (field, expr));
+ expr = gnat_build_constructor (rec_type, build_tree_list (field, expr));
expr = unchecked_convert (type, expr);
}
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 131aeec..21d32f9 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -929,7 +929,7 @@ build_binary_op (op_code, result_type, left_operand, right_operand)
just compare the data pointer. */
else if (TYPE_FAT_POINTER_P (left_base_type)
&& TREE_CODE (right_operand) == CONSTRUCTOR
- && integer_zerop (TREE_VALUE (TREE_OPERAND (right_operand, 1))))
+ && integer_zerop (TREE_VALUE (CONSTRUCTOR_ELTS (right_operand))))
{
right_operand = build_component_ref (left_operand, NULL_TREE,
TYPE_FIELDS (left_base_type));
@@ -1514,7 +1514,7 @@ build_call_raise (msg)
/* Return a CONSTRUCTOR of TYPE whose list is LIST. */
tree
-build_constructor (type, list)
+gnat_build_constructor (type, list)
tree type;
tree list;
{
@@ -1566,7 +1566,7 @@ build_constructor (type, list)
}
}
- result = build (CONSTRUCTOR, type, NULL_TREE, list);
+ result = build_constructor (type, list);
TREE_CONSTANT (result) = allconstant;
TREE_STATIC (result) = allconstant;
TREE_SIDE_EFFECTS (result) = side_effects;
@@ -1896,7 +1896,7 @@ build_allocator (type, init, result_type, gnat_proc, gnat_pool)
(MODIFY_EXPR, storage_type,
build_unary_op (INDIRECT_REF, NULL_TREE,
convert (storage_ptr_type, storage)),
- build_constructor (storage_type, template_cons)),
+ gnat_build_constructor (storage_type, template_cons)),
convert (storage_ptr_type, storage)));
}
else
@@ -2008,7 +2008,7 @@ fill_vms_descriptor (expr, gnat_formal)
const_list);
}
- return build_constructor (record_type, nreverse (const_list));
+ return gnat_build_constructor (record_type, nreverse (const_list));
}
/* Indicate that we need to make the address of EXPR_NODE and it therefore