aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
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/java
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/java')
-rw-r--r--gcc/java/ChangeLog9
-rw-r--r--gcc/java/class.c22
-rw-r--r--gcc/java/constants.c7
-rw-r--r--gcc/java/java-tree.h2
-rw-r--r--gcc/java/parse.y2
5 files changed, 24 insertions, 18 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index fe99c0a..4ee59ee 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,12 @@
+2003-04-12 Zack Weinberg <zack@codesourcery.com>
+
+ * 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.
+
2003-04-10 Eric Blake <ebb9@email.byu.edu>
PR java/10253:
diff --git a/gcc/java/class.c b/gcc/java/class.c
index f121f0e..fff4247 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -1076,7 +1076,7 @@ make_field_value (tree fdecl)
PUSH_FIELD_VALUE
(finit, "info",
- build (CONSTRUCTOR, field_info_union_node, NULL_TREE,
+ build_constructor (field_info_union_node,
build_tree_list
((FIELD_STATIC (fdecl)
? TREE_CHAIN (TYPE_FIELDS (field_info_union_node))
@@ -1145,7 +1145,7 @@ make_method_value (tree mdecl)
table = tree_cons (NULL_TREE, utf8, table);
}
type = build_prim_array_type (ptr_type_node, length);
- table = build (CONSTRUCTOR, type, NULL_TREE, table);
+ table = build_constructor (type, table);
/* Compute something unique enough. */
sprintf (buf, "_methods%d", method_name_count++);
array = build_decl (VAR_DECL, get_identifier (buf), type);
@@ -1267,9 +1267,8 @@ get_dispatch_table (tree type, tree this_class_addr)
if (TARGET_VTABLE_USES_DESCRIPTORS)
arraysize *= TARGET_VTABLE_USES_DESCRIPTORS;
arraysize += 2;
- return build (CONSTRUCTOR,
- build_prim_array_type (nativecode_ptr_type_node, arraysize),
- NULL_TREE, list);
+ return build_constructor (build_prim_array_type (nativecode_ptr_type_node,
+ arraysize), list);
}
static int
@@ -1352,8 +1351,8 @@ make_class_data (tree type)
field_array_type = build_prim_array_type (field_type_node, field_count);
fields_decl = build_decl (VAR_DECL, mangled_classname ("_FL_", type),
field_array_type);
- DECL_INITIAL (fields_decl) = build (CONSTRUCTOR, field_array_type,
- NULL_TREE, static_fields);
+ DECL_INITIAL (fields_decl) = build_constructor (field_array_type,
+ static_fields);
TREE_STATIC (fields_decl) = 1;
DECL_ARTIFICIAL (fields_decl) = 1;
DECL_IGNORED_P (fields_decl) = 1;
@@ -1378,8 +1377,8 @@ make_class_data (tree type)
method_array_type = build_prim_array_type (method_type_node, method_count);
methods_decl = build_decl (VAR_DECL, mangled_classname ("_MT_", type),
method_array_type);
- DECL_INITIAL (methods_decl) = build (CONSTRUCTOR, method_array_type,
- NULL_TREE, nreverse (methods));
+ DECL_INITIAL (methods_decl) = build_constructor (method_array_type,
+ nreverse (methods));
TREE_STATIC (methods_decl) = 1;
DECL_ARTIFICIAL (methods_decl) = 1;
DECL_IGNORED_P (methods_decl) = 1;
@@ -1451,8 +1450,7 @@ make_class_data (tree type)
}
init = tree_cons (NULL_TREE, index, init);
}
- DECL_INITIAL (idecl) = build (CONSTRUCTOR, interface_array_type,
- NULL_TREE, init);
+ DECL_INITIAL (idecl) = build_constructor (interface_array_type, init);
TREE_STATIC (idecl) = 1;
DECL_ARTIFICIAL (idecl) = 1;
DECL_IGNORED_P (idecl) = 1;
@@ -2099,7 +2097,7 @@ emit_offset_symbol_table (void)
/* Put the list in the right order and make it a constructor. */
list = nreverse (list);
- table = build (CONSTRUCTOR, method_symbols_array_type, NULL_TREE, list);
+ table = build_constructor (method_symbols_array_type, list);
/* Make it the initial value for otable_syms and emit the decl. */
DECL_INITIAL (otable_syms_decl) = table;
diff --git a/gcc/java/constants.c b/gcc/java/constants.c
index 1a56df0..274a8bf 100644
--- a/gcc/java/constants.c
+++ b/gcc/java/constants.c
@@ -442,8 +442,8 @@ build_constants_constructor (void)
data_decl = TREE_OPERAND (build_constant_data_ref (), 0);
TREE_TYPE (data_decl) = build_array_type (ptr_type_node, index_type),
- DECL_INITIAL (data_decl) = build (CONSTRUCTOR, TREE_TYPE (data_decl),
- NULL_TREE, data_list);
+ DECL_INITIAL (data_decl) = build_constructor (TREE_TYPE (data_decl),
+ data_list);
DECL_SIZE (data_decl) = TYPE_SIZE (TREE_TYPE (data_decl));
DECL_SIZE_UNIT (data_decl) = TYPE_SIZE_UNIT (TREE_TYPE (data_decl));
rest_of_decl_compilation (data_decl, (char *) 0, 1, 0);
@@ -454,8 +454,7 @@ build_constants_constructor (void)
current_class),
tags_type);
TREE_STATIC (tags_decl) = 1;
- DECL_INITIAL (tags_decl) = build (CONSTRUCTOR, tags_type,
- NULL_TREE, tags_list);
+ DECL_INITIAL (tags_decl) = build_constructor (tags_type, tags_list);
rest_of_decl_compilation (tags_decl, (char*) 0, 1, 0);
tags_value = build_address_of (tags_decl);
}
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index adfd77e..62d2452 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -1650,7 +1650,7 @@ extern tree *type_map;
/* Start building a RECORD_TYPE constructor with a given TYPE in CONS. */
#define START_RECORD_CONSTRUCTOR(CONS, CTYPE) { \
- CONS = build (CONSTRUCTOR, CTYPE, NULL_TREE, NULL_TREE);\
+ CONS = build_constructor (CTYPE, NULL_TREE);\
TREE_CHAIN(CONS) = TYPE_FIELDS (CTYPE); }
/* Append a field initializer to CONS for the dummy field for the inherited
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index b5808d4..df60f9e 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -14499,7 +14499,7 @@ maybe_build_array_element_wfl (tree node)
static tree
build_new_array_init (int location, tree values)
{
- tree constructor = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, values);
+ tree constructor = build_constructor (NULL_TREE, values);
tree to_return = build1 (NEW_ARRAY_INIT, NULL_TREE, constructor);
EXPR_WFL_LINECOL (to_return) = location;
return to_return;