From 712d22976c2f8c0053865790f0e0674337864ab9 Mon Sep 17 00:00:00 2001 From: manu Date: Tue, 7 Jul 2009 02:55:59 +0000 Subject: =?UTF-8?q?2009-07-07=20=20Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez=20?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * cgraphunit.c: Replace %J by an explicit location. Update all calls. * c-decl.c: Likewise. * function.c: Likewise. * varasm.c: Likewise. * tree-ssa.c: Likewise. * c-common.c: Likewise. * tree-cfg.c: Likewise. * config/spu/spu.c: Likewise. * config/ia64/ia64.c: Likewise. * config/v850/v850.c: Likewise. java/ * class.c: Replace %J by an explicit location. Update all calls. objc/ * objc-act.c: Replace %J by an explicit location. Update all calls. cp/ * init.c: Replace %J by an explicit location. Update all calls. * decl.c: Likewise. * typeck2.c: Likewise. * pt.c: Likewise. * name-lookup.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149312 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 1b594e5ca84..db9c8a8e88c 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1609,7 +1609,8 @@ get_dispatch_table (tree type, tree this_class_addr) if (METHOD_ABSTRACT (method)) { if (! abstract_p) - warning (0, "%Jabstract method in non-abstract class", method); + warning_at (DECL_SOURCE_LOCATION (method), 0, + "abstract method in non-abstract class"); if (TARGET_VTABLE_USES_DESCRIPTORS) for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j) -- cgit v1.2.1 From 3eafef1ab2554978e8e09caa01cce033143513ac Mon Sep 17 00:00:00 2001 From: froydnj Date: Fri, 14 May 2010 20:47:39 +0000 Subject: PR 44103 * java-tree.h (START_RECORD_CONSTRUCTOR): Change first argument to a vector. Move call to build_constructor... (FINISH_RECORD_CONSTRUCTOR): ...here. Add necessary arguments. Clear TREE_CONSTANT on the constructor. (PUSH_SUPER_VALUE): Change first argument to a vector. (PUSH_FIELD_VALUE): Likewise. * resource.c (compile_resource_data): Update calls to above macros. * constants.c (build_constants_constructor): Likewise. * class.c (build_utf8_ref): Likewise. (make_field_value): Likewise. (make_method_value): Likewise. (add_table_and_syms): New function. (make_class_data): Call it. Update calls to above macros. (build_symbol_table_entry): New function. (build_symbol_entry): Call it. Update calls to above macros. (emit_symbol_table): Likewise. (make_catch_class_record): Update calls to above macros. (build_assertion_table_entry): New function. (add_assertion_table_entry): Call it. (emit_assertion_table): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159414 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 299 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 155 insertions(+), 144 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index db9c8a8e88c..7e9659b1598 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -942,6 +942,7 @@ build_utf8_ref (tree name) int name_hash; tree ref = IDENTIFIER_UTF8_REF (name); tree decl; + VEC(constructor_elt,gc) *v = NULL; if (ref != NULL_TREE) return ref; @@ -956,14 +957,14 @@ build_utf8_ref (tree name) ctype, field, "length", unsigned_short_type_node); PUSH_FIELD (input_location, ctype, field, "data", str_type); FINISH_RECORD (ctype); - START_RECORD_CONSTRUCTOR (cinit, ctype); + START_RECORD_CONSTRUCTOR (v, ctype); name_hash = hashUtf8String (name_ptr, name_len) & 0xFFFF; - PUSH_FIELD_VALUE (cinit, "hash", build_int_cst (NULL_TREE, name_hash)); - PUSH_FIELD_VALUE (cinit, "length", build_int_cst (NULL_TREE, name_len)); + PUSH_FIELD_VALUE (v, "hash", build_int_cst (NULL_TREE, name_hash)); + PUSH_FIELD_VALUE (v, "length", build_int_cst (NULL_TREE, name_len)); string = build_string (name_len, name_ptr); TREE_TYPE (string) = str_type; - PUSH_FIELD_VALUE (cinit, "data", string); - FINISH_RECORD_CONSTRUCTOR (cinit); + PUSH_FIELD_VALUE (v, "data", string); + FINISH_RECORD_CONSTRUCTOR (cinit, v, ctype); TREE_CONSTANT (cinit) = 1; /* Generate a unique-enough identifier. */ @@ -1425,9 +1426,10 @@ make_field_value (tree fdecl) int flags; tree type = TREE_TYPE (fdecl); int resolved = is_compiled_class (type) && ! flag_indirect_dispatch; + VEC(constructor_elt,gc) *v = NULL; - START_RECORD_CONSTRUCTOR (finit, field_type_node); - PUSH_FIELD_VALUE (finit, "name", build_utf8_ref (DECL_NAME (fdecl))); + START_RECORD_CONSTRUCTOR (v, field_type_node); + PUSH_FIELD_VALUE (v, "name", build_utf8_ref (DECL_NAME (fdecl))); if (resolved) type = build_class_ref (type); else @@ -1438,14 +1440,14 @@ make_field_value (tree fdecl) (IDENTIFIER_POINTER (signature), IDENTIFIER_LENGTH (signature))); } - PUSH_FIELD_VALUE (finit, "type", type); + PUSH_FIELD_VALUE (v, "type", type); flags = get_access_flags_from_decl (fdecl); if (! resolved) flags |= 0x8000 /* FIELD_UNRESOLVED_FLAG */; - PUSH_FIELD_VALUE (finit, "accflags", build_int_cst (NULL_TREE, flags)); - PUSH_FIELD_VALUE (finit, "bsize", TYPE_SIZE_UNIT (TREE_TYPE (fdecl))); + PUSH_FIELD_VALUE (v, "accflags", build_int_cst (NULL_TREE, flags)); + PUSH_FIELD_VALUE (v, "bsize", TYPE_SIZE_UNIT (TREE_TYPE (fdecl))); { tree field_address = integer_zero_node; @@ -1454,7 +1456,7 @@ make_field_value (tree fdecl) field_address = build_address_of (fdecl); PUSH_FIELD_VALUE - (finit, "info", + (v, "info", build_constructor_from_list (field_info_union_node, build_tree_list ((FIELD_STATIC (fdecl) @@ -1465,7 +1467,7 @@ make_field_value (tree fdecl) : byte_position (fdecl))))); } - FINISH_RECORD_CONSTRUCTOR (finit); + FINISH_RECORD_CONSTRUCTOR (finit, v, field_type_node); return finit; } @@ -1481,6 +1483,7 @@ make_method_value (tree mdecl) tree class_decl; #define ACC_TRANSLATED 0x4000 int accflags = get_access_flags_from_decl (mdecl) | ACC_TRANSLATED; + VEC(constructor_elt,gc) *v = NULL; class_decl = DECL_CONTEXT (mdecl); /* For interfaces, the index field contains the dispatch index. */ @@ -1499,22 +1502,22 @@ make_method_value (tree mdecl) else code = build1 (ADDR_EXPR, nativecode_ptr_type_node, make_local_function_alias (mdecl)); - START_RECORD_CONSTRUCTOR (minit, method_type_node); - PUSH_FIELD_VALUE (minit, "name", + START_RECORD_CONSTRUCTOR (v, method_type_node); + PUSH_FIELD_VALUE (v, "name", build_utf8_ref (DECL_CONSTRUCTOR_P (mdecl) ? init_identifier_node : DECL_NAME (mdecl))); { tree signature = build_java_signature (TREE_TYPE (mdecl)); - PUSH_FIELD_VALUE (minit, "signature", + PUSH_FIELD_VALUE (v, "signature", (build_utf8_ref (unmangle_classname (IDENTIFIER_POINTER(signature), IDENTIFIER_LENGTH(signature))))); } - PUSH_FIELD_VALUE (minit, "accflags", build_int_cst (NULL_TREE, accflags)); - PUSH_FIELD_VALUE (minit, "index", index); - PUSH_FIELD_VALUE (minit, "ncode", code); + PUSH_FIELD_VALUE (v, "accflags", build_int_cst (NULL_TREE, accflags)); + PUSH_FIELD_VALUE (v, "index", index); + PUSH_FIELD_VALUE (v, "ncode", code); { /* Compute the `throws' information for the method. */ @@ -1551,10 +1554,10 @@ make_method_value (tree mdecl) table = build1 (ADDR_EXPR, ptr_type_node, array); } - PUSH_FIELD_VALUE (minit, "throws", table); + PUSH_FIELD_VALUE (v, "throws", table); } - FINISH_RECORD_CONSTRUCTOR (minit); + FINISH_RECORD_CONSTRUCTOR (minit, v, method_type_node); return minit; } @@ -1717,6 +1720,29 @@ supers_all_compiled (tree type) return 1; } +static void +add_table_and_syms (VEC(constructor_elt,gc) **v, + tree method_slot, + const char *table_name, tree table_slot, tree table_type, + const char *syms_name, tree syms_slot) +{ + if (method_slot == NULL_TREE) + { + PUSH_FIELD_VALUE (*v, table_name, null_pointer_node); + PUSH_FIELD_VALUE (*v, syms_name, null_pointer_node); + } + else + { + pushdecl_top_level (syms_slot); + PUSH_FIELD_VALUE (*v, table_name, + build1 (ADDR_EXPR, table_type, table_slot)); + PUSH_FIELD_VALUE (*v, syms_name, + build1 (ADDR_EXPR, symbols_array_ptr_type, + syms_slot)); + TREE_CONSTANT (table_slot) = 1; + } +} + void make_class_data (tree type) { @@ -1748,6 +1774,8 @@ make_class_data (tree type) tree dtable_start_offset = size_int (2 * POINTER_SIZE / BITS_PER_UNIT); VEC(int, heap) *field_indexes; tree first_real_field; + VEC(constructor_elt,gc) *v1 = NULL, *v2 = NULL; + tree reflection_data; this_class_addr = build_static_class_ref (type); decl = TREE_OPERAND (this_class_addr, 0); @@ -2032,8 +2060,8 @@ make_class_data (tree type) TYPE_CTABLE_DECL (type) = emit_catch_table (type); - START_RECORD_CONSTRUCTOR (temp, object_type_node); - PUSH_FIELD_VALUE (temp, "vtable", + START_RECORD_CONSTRUCTOR (v1, object_type_node); + PUSH_FIELD_VALUE (v1, "vtable", (flag_indirect_classes ? null_pointer_node : build2 (POINTER_PLUS_EXPR, dtable_ptr_type, @@ -2041,115 +2069,77 @@ make_class_data (tree type) class_dtable_decl), dtable_start_offset))); if (! flag_hash_synchronization) - PUSH_FIELD_VALUE (temp, "sync_info", null_pointer_node); - FINISH_RECORD_CONSTRUCTOR (temp); - START_RECORD_CONSTRUCTOR (cons, class_type_node); - PUSH_SUPER_VALUE (cons, temp); - PUSH_FIELD_VALUE (cons, "next_or_version", gcj_abi_version); - PUSH_FIELD_VALUE (cons, "name", build_utf8_ref (DECL_NAME (type_decl))); - PUSH_FIELD_VALUE (cons, "accflags", + PUSH_FIELD_VALUE (v1, "sync_info", null_pointer_node); + FINISH_RECORD_CONSTRUCTOR (temp, v1, object_type_node); + START_RECORD_CONSTRUCTOR (v2, class_type_node); + PUSH_SUPER_VALUE (v2, temp); + PUSH_FIELD_VALUE (v2, "next_or_version", gcj_abi_version); + PUSH_FIELD_VALUE (v2, "name", build_utf8_ref (DECL_NAME (type_decl))); + PUSH_FIELD_VALUE (v2, "accflags", build_int_cst (NULL_TREE, get_access_flags_from_decl (type_decl))); - PUSH_FIELD_VALUE (cons, "superclass", + PUSH_FIELD_VALUE (v2, "superclass", CLASS_INTERFACE (type_decl) ? null_pointer_node : super); - PUSH_FIELD_VALUE (cons, "constants", constant_pool_constructor); - PUSH_FIELD_VALUE (cons, "methods", + PUSH_FIELD_VALUE (v2, "constants", constant_pool_constructor); + PUSH_FIELD_VALUE (v2, "methods", methods_decl == NULL_TREE ? null_pointer_node : build1 (ADDR_EXPR, method_ptr_type_node, methods_decl)); - PUSH_FIELD_VALUE (cons, "method_count", + PUSH_FIELD_VALUE (v2, "method_count", build_int_cst (NULL_TREE, method_count)); - if (flag_indirect_dispatch) - PUSH_FIELD_VALUE (cons, "vtable_method_count", integer_minus_one_node); - else - PUSH_FIELD_VALUE (cons, "vtable_method_count", TYPE_NVIRTUALS (type)); + PUSH_FIELD_VALUE (v2, "vtable_method_count", + (flag_indirect_dispatch + ? integer_minus_one_node + : TYPE_NVIRTUALS (type))); - PUSH_FIELD_VALUE (cons, "fields", + PUSH_FIELD_VALUE (v2, "fields", fields_decl == NULL_TREE ? null_pointer_node : build1 (ADDR_EXPR, field_ptr_type_node, fields_decl)); /* If we're using the binary compatibility ABI we don't know the size until load time. */ - PUSH_FIELD_VALUE (cons, "size_in_bytes", + PUSH_FIELD_VALUE (v2, "size_in_bytes", (flag_indirect_dispatch ? integer_minus_one_node : size_in_bytes (type))); - PUSH_FIELD_VALUE (cons, "field_count", + PUSH_FIELD_VALUE (v2, "field_count", build_int_cst (NULL_TREE, field_count)); - PUSH_FIELD_VALUE (cons, "static_field_count", + PUSH_FIELD_VALUE (v2, "static_field_count", build_int_cst (NULL_TREE, static_field_count)); - if (flag_indirect_dispatch) - PUSH_FIELD_VALUE (cons, "vtable", null_pointer_node); - else - PUSH_FIELD_VALUE (cons, "vtable", - dtable_decl == NULL_TREE ? null_pointer_node - : build2 (POINTER_PLUS_EXPR, dtable_ptr_type, + PUSH_FIELD_VALUE (v2, "vtable", + (flag_indirect_dispatch || dtable_decl == NULL_TREE + ? null_pointer_node + : build2 (POINTER_PLUS_EXPR, dtable_ptr_type, build1 (ADDR_EXPR, dtable_ptr_type, dtable_decl), - dtable_start_offset)); - if (TYPE_OTABLE_METHODS (type) == NULL_TREE) - { - PUSH_FIELD_VALUE (cons, "otable", null_pointer_node); - PUSH_FIELD_VALUE (cons, "otable_syms", null_pointer_node); - } - else - { - pushdecl_top_level (TYPE_OTABLE_SYMS_DECL (type)); - PUSH_FIELD_VALUE (cons, "otable", - build1 (ADDR_EXPR, otable_ptr_type, TYPE_OTABLE_DECL (type))); - PUSH_FIELD_VALUE (cons, "otable_syms", - build1 (ADDR_EXPR, symbols_array_ptr_type, - TYPE_OTABLE_SYMS_DECL (type))); - TREE_CONSTANT (TYPE_OTABLE_DECL (type)) = 1; - } - if (TYPE_ATABLE_METHODS(type) == NULL_TREE) - { - PUSH_FIELD_VALUE (cons, "atable", null_pointer_node); - PUSH_FIELD_VALUE (cons, "atable_syms", null_pointer_node); - } - else - { - pushdecl_top_level (TYPE_ATABLE_SYMS_DECL (type)); - PUSH_FIELD_VALUE (cons, "atable", - build1 (ADDR_EXPR, atable_ptr_type, TYPE_ATABLE_DECL (type))); - PUSH_FIELD_VALUE (cons, "atable_syms", - build1 (ADDR_EXPR, symbols_array_ptr_type, - TYPE_ATABLE_SYMS_DECL (type))); - TREE_CONSTANT (TYPE_ATABLE_DECL (type)) = 1; - } - if (TYPE_ITABLE_METHODS(type) == NULL_TREE) - { - PUSH_FIELD_VALUE (cons, "itable", null_pointer_node); - PUSH_FIELD_VALUE (cons, "itable_syms", null_pointer_node); - } - else - { - pushdecl_top_level (TYPE_ITABLE_SYMS_DECL (type)); - PUSH_FIELD_VALUE (cons, "itable", - build1 (ADDR_EXPR, itable_ptr_type, TYPE_ITABLE_DECL (type))); - PUSH_FIELD_VALUE (cons, "itable_syms", - build1 (ADDR_EXPR, symbols_array_ptr_type, - TYPE_ITABLE_SYMS_DECL (type))); - TREE_CONSTANT (TYPE_ITABLE_DECL (type)) = 1; - } + dtable_start_offset))); + add_table_and_syms (&v2, TYPE_OTABLE_METHODS (type), + "otable", TYPE_OTABLE_DECL (type), otable_ptr_type, + "otable_syms", TYPE_OTABLE_SYMS_DECL (type)); + add_table_and_syms (&v2, TYPE_ATABLE_METHODS (type), + "atable", TYPE_ATABLE_DECL (type), atable_ptr_type, + "atable_syms", TYPE_ATABLE_SYMS_DECL (type)); + add_table_and_syms (&v2, TYPE_ITABLE_METHODS (type), + "itable", TYPE_ITABLE_DECL (type), itable_ptr_type, + "itable_syms", TYPE_ITABLE_SYMS_DECL (type)); - PUSH_FIELD_VALUE (cons, "catch_classes", + PUSH_FIELD_VALUE (v2, "catch_classes", build1 (ADDR_EXPR, ptr_type_node, TYPE_CTABLE_DECL (type))); - PUSH_FIELD_VALUE (cons, "interfaces", interfaces); - PUSH_FIELD_VALUE (cons, "loader", null_pointer_node); - PUSH_FIELD_VALUE (cons, "interface_count", + PUSH_FIELD_VALUE (v2, "interfaces", interfaces); + PUSH_FIELD_VALUE (v2, "loader", null_pointer_node); + PUSH_FIELD_VALUE (v2, "interface_count", build_int_cst (NULL_TREE, interface_len)); - PUSH_FIELD_VALUE (cons, "state", + PUSH_FIELD_VALUE (v2, "state", convert (byte_type_node, build_int_cst (NULL_TREE, JV_STATE_PRELOADING))); - PUSH_FIELD_VALUE (cons, "thread", null_pointer_node); - PUSH_FIELD_VALUE (cons, "depth", integer_zero_node); - PUSH_FIELD_VALUE (cons, "ancestors", null_pointer_node); - PUSH_FIELD_VALUE (cons, "idt", null_pointer_node); - PUSH_FIELD_VALUE (cons, "arrayclass", null_pointer_node); - PUSH_FIELD_VALUE (cons, "protectionDomain", null_pointer_node); + PUSH_FIELD_VALUE (v2, "thread", null_pointer_node); + PUSH_FIELD_VALUE (v2, "depth", integer_zero_node); + PUSH_FIELD_VALUE (v2, "ancestors", null_pointer_node); + PUSH_FIELD_VALUE (v2, "idt", null_pointer_node); + PUSH_FIELD_VALUE (v2, "arrayclass", null_pointer_node); + PUSH_FIELD_VALUE (v2, "protectionDomain", null_pointer_node); { tree assertion_table_ref; @@ -2160,13 +2150,13 @@ make_class_data (tree type) build_pointer_type (assertion_table_type), emit_assertion_table (type)); - PUSH_FIELD_VALUE (cons, "assertion_table", assertion_table_ref); + PUSH_FIELD_VALUE (v2, "assertion_table", assertion_table_ref); } - PUSH_FIELD_VALUE (cons, "hack_signers", null_pointer_node); - PUSH_FIELD_VALUE (cons, "chain", null_pointer_node); - PUSH_FIELD_VALUE (cons, "aux_info", null_pointer_node); - PUSH_FIELD_VALUE (cons, "engine", null_pointer_node); + PUSH_FIELD_VALUE (v2, "hack_signers", null_pointer_node); + PUSH_FIELD_VALUE (v2, "chain", null_pointer_node); + PUSH_FIELD_VALUE (v2, "aux_info", null_pointer_node); + PUSH_FIELD_VALUE (v2, "engine", null_pointer_node); if (TYPE_REFLECTION_DATA (current_class)) { @@ -2202,16 +2192,17 @@ make_class_data (tree type) TREE_READONLY (array) = 1; TREE_CONSTANT (DECL_INITIAL (array)) = 1; rest_of_decl_compilation (array, 1, 0); - - PUSH_FIELD_VALUE (cons, "reflection_data", build_address_of (array)); + + reflection_data = build_address_of (array); free (data); TYPE_REFLECTION_DATA (current_class) = NULL; } else - PUSH_FIELD_VALUE (cons, "reflection_data", null_pointer_node); + reflection_data = null_pointer_node; - FINISH_RECORD_CONSTRUCTOR (cons); + PUSH_FIELD_VALUE (v2, "reflection_data", reflection_data); + FINISH_RECORD_CONSTRUCTOR (cons, v2, class_type_node); DECL_INITIAL (decl) = cons; @@ -2846,12 +2837,30 @@ emit_register_classes (tree *list_p) } } +/* Build a constructor for an entry in the symbol table. */ + +static tree +build_symbol_table_entry (tree clname, tree name, tree signature) +{ + tree symbol; + VEC(constructor_elt,gc) *v = NULL; + + START_RECORD_CONSTRUCTOR (v, symbol_type); + PUSH_FIELD_VALUE (v, "clname", clname); + PUSH_FIELD_VALUE (v, "name", name); + PUSH_FIELD_VALUE (v, "signature", signature); + FINISH_RECORD_CONSTRUCTOR (symbol, v, symbol_type); + TREE_CONSTANT (symbol) = 1; + + return symbol; +} + /* Make a symbol_type (_Jv_MethodSymbol) node for DECL. */ static tree build_symbol_entry (tree decl, tree special) { - tree clname, name, signature, sym; + tree clname, name, signature; clname = build_utf8_ref (DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl)))); /* ??? Constructors are given the name foo.foo all the way through the compiler, but in the method table they're all renamed @@ -2872,15 +2881,8 @@ build_symbol_entry (tree decl, tree special) if (special != NULL_TREE) signature = build2 (POINTER_PLUS_EXPR, TREE_TYPE (signature), signature, fold_convert (sizetype, special)); - - START_RECORD_CONSTRUCTOR (sym, symbol_type); - PUSH_FIELD_VALUE (sym, "clname", clname); - PUSH_FIELD_VALUE (sym, "name", name); - PUSH_FIELD_VALUE (sym, "signature", signature); - FINISH_RECORD_CONSTRUCTOR (sym); - TREE_CONSTANT (sym) = 1; - - return sym; + + return build_symbol_table_entry (clname, name, signature); } /* Emit a symbol table: used by -findirect-dispatch. */ @@ -2913,12 +2915,9 @@ emit_symbol_table (tree name, tree the_table, tree decl_list, } /* Terminate the list with a "null" entry. */ - START_RECORD_CONSTRUCTOR (null_symbol, symbol_type); - PUSH_FIELD_VALUE (null_symbol, "clname", null_pointer_node); - PUSH_FIELD_VALUE (null_symbol, "name", null_pointer_node); - PUSH_FIELD_VALUE (null_symbol, "signature", null_pointer_node); - FINISH_RECORD_CONSTRUCTOR (null_symbol); - TREE_CONSTANT (null_symbol) = 1; + null_symbol = build_symbol_table_entry (null_pointer_node, + null_pointer_node, + null_pointer_node); list = tree_cons (NULL_TREE, null_symbol, list); /* Put the list in the right order and make it a constructor. */ @@ -2953,10 +2952,11 @@ make_catch_class_record (tree catch_class, tree classname) { tree entry; tree type = TREE_TYPE (TREE_TYPE (TYPE_CTABLE_DECL (output_class))); - START_RECORD_CONSTRUCTOR (entry, type); - PUSH_FIELD_VALUE (entry, "address", catch_class); - PUSH_FIELD_VALUE (entry, "classname", classname); - FINISH_RECORD_CONSTRUCTOR (entry); + VEC(constructor_elt,gc) *v = NULL; + START_RECORD_CONSTRUCTOR (v, type); + PUSH_FIELD_VALUE (v, "address", catch_class); + PUSH_FIELD_VALUE (v, "classname", classname); + FINISH_RECORD_CONSTRUCTOR (entry, v, type); return entry; } @@ -3010,6 +3010,23 @@ build_signature_for_libgcj (tree type) return ref; } +/* Build an entry in the type assertion table. */ + +static tree +build_assertion_table_entry (tree code, tree op1, tree op2) +{ + VEC(constructor_elt,gc) *v = NULL; + tree entry; + + START_RECORD_CONSTRUCTOR (v, assertion_entry_type); + PUSH_FIELD_VALUE (v, "assertion_code", code); + PUSH_FIELD_VALUE (v, "op1", op1); + PUSH_FIELD_VALUE (v, "op2", op2); + FINISH_RECORD_CONSTRUCTOR (entry, v, assertion_entry_type); + + return entry; +} + /* Add an entry to the type assertion table. Callback used during hashtable traversal. */ @@ -3032,12 +3049,8 @@ add_assertion_table_entry (void **htab_entry, void *ptr) op2_utf8 = null_pointer_node; else op2_utf8 = build_signature_for_libgcj (as->op2); - - START_RECORD_CONSTRUCTOR (entry, assertion_entry_type); - PUSH_FIELD_VALUE (entry, "assertion_code", code_val); - PUSH_FIELD_VALUE (entry, "op1", op1_utf8); - PUSH_FIELD_VALUE (entry, "op2", op2_utf8); - FINISH_RECORD_CONSTRUCTOR (entry); + + entry = build_assertion_table_entry (code_val, op1_utf8, op2_utf8); *list = tree_cons (NULL_TREE, entry, *list); return true; @@ -3056,11 +3069,9 @@ emit_assertion_table (tree klass) htab_traverse (assertions_htab, add_assertion_table_entry, &list); /* Finish with a null entry. */ - START_RECORD_CONSTRUCTOR (null_entry, assertion_entry_type); - PUSH_FIELD_VALUE (null_entry, "assertion_code", integer_zero_node); - PUSH_FIELD_VALUE (null_entry, "op1", null_pointer_node); - PUSH_FIELD_VALUE (null_entry, "op2", null_pointer_node); - FINISH_RECORD_CONSTRUCTOR (null_entry); + null_entry = build_assertion_table_entry (integer_zero_node, + null_pointer_node, + null_pointer_node); list = tree_cons (NULL_TREE, null_entry, list); -- cgit v1.2.1 From 3484143b5879162ba1779358e3da4622e8930d7f Mon Sep 17 00:00:00 2001 From: steven Date: Sun, 23 May 2010 17:48:41 +0000 Subject: * java-gimplify.c: Do not include tm.h, toplev.h. * typeck.c: Do not include tm.h. * mangle_name.c: Do not include tm.h. * jcf-dump.c: Do not include tm.h, ggc.h. * class.c: Do not include rtl.h, tm_p.h, target.h, except.h, cgraph.h. * decl.c: Do not include tm.h, rtl.h, function.h, expr.h, except.h, and timevar.h. * jcf-parse.c: Do not include tm.h and tm_p.h. * resource.c: Do not include tm.h, rtl.h, flags.h, obstack.h, target.h, and expr.h. * except.c: Do not include tm.h, rtl.h, function.h. * builtins.c: Do not include convert.h. Explain why RTL headers have to be included here. * verify-glue.c: Do not include tm.h. * jcf-depend.c: Do not include tm.h. * jcf-reader.c: Include ggc.h. * jcf-io.c: Do not include tm.h, toplev.h. * expr.c: Do not include tm.h, rtl.h, expr.h, except.h, tm_p.h, gimple.h. * lang.c: Do not include rtl.h, expr.h. * Make-lang.in: Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159764 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 7e9659b1598..83759a56bec 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -27,9 +27,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "config.h" #include "system.h" #include "coretypes.h" -#include "tm.h" #include "tree.h" -#include "rtl.h" #include "flags.h" #include "java-tree.h" #include "jcf.h" @@ -38,15 +36,12 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "output.h" #include "parse.h" #include "function.h" -#include "tm_p.h" #include "ggc.h" #include "stdio.h" -#include "target.h" -#include "except.h" #include "cgraph.h" #include "tree-iterator.h" -#include "cgraph.h" #include "vecprim.h" +#include "tm.h" /* FIXME: For gcc_obstack_init from defaults.h. */ /* DOS brain-damage */ #ifndef O_BINARY -- cgit v1.2.1 From 8faccfb9f69195ab30cced8423b3047677f92e10 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 25 May 2010 16:19:11 +0000 Subject: PR debug/43260 * java-tree.h (pending_static_fields): New extern declaration. (java_write_globals): New prototype. * lang.c (LANG_HOOKS_WRITE_GLOBALS): Define. * decl.c (java_mark_class_local): When clearing DECL_EXTERNAL of a static field push it into pending_static_fields vector. * class.c (pending_static_fields): New variable. (add_field): If static field is not DECL_EXTERNAL, push it into pending_static_fields vector. (java_write_globals): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159828 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 83759a56bec..919d698de0f 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1,6 +1,6 @@ /* Functions related to building classes and their related objects. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -109,6 +109,10 @@ static GTY(()) VEC(tree,gc) *registered_class; currently being compiled. */ static GTY(()) tree this_classdollar; +/* A list of static class fields. This is to emit proper debug + info for them. */ +VEC(tree,gc) *pending_static_fields; + /* Return the node that most closely represents the class whose name is IDENT. Start the search from NODE (followed by its siblings). Return NULL if an appropriate node does not exist. */ @@ -873,6 +877,8 @@ add_field (tree klass, tree name, tree field_type, int flags) /* Considered external unless we are compiling it into this object file. */ DECL_EXTERNAL (field) = (is_compiled_class (klass) != 2); + if (!DECL_EXTERNAL (field)) + VEC_safe_push (tree, gc, pending_static_fields, field); } return field; @@ -3224,4 +3230,17 @@ in_same_package (tree name1, tree name2) return (pkg1 == pkg2); } +/* lang_hooks.decls.final_write_globals: perform final processing on + global variables. */ + +void +java_write_globals (void) +{ + tree *vec = VEC_address (tree, pending_static_fields); + int len = VEC_length (tree, pending_static_fields); + write_global_declarations (); + emit_debug_global_declarations (vec, len); + VEC_free (tree, gc, pending_static_fields); +} + #include "gt-java-class.h" -- cgit v1.2.1 From 43d03f3adddb1a5785e730b84ede1e1e85f90334 Mon Sep 17 00:00:00 2001 From: froydnj Date: Wed, 26 May 2010 13:55:30 +0000 Subject: * class.c (utf8_decl_list): Delete. (build_utf8_ref): Remove references to it. * java-tree.h (all_class_list): Delete. (predef_filenames): Delete. (enum java_tree_index) [JTI ALL_CLASS_LIST,JTI_PREDEF_FILENAMES]: Delete. * jcf-parse.c (parse_roots): Decrease size to 2. (current_file_list): Convert to a VEC. (all_class_list): Declare. (jcf_parse): Adjust for new type of all_class_list. (java_layout_seen_class_methods): Likewise. (predefined_filenames): Declare. (add_predefined_file): Use it. (predefined_filename_p): Likewise. (java_parse_file): Adjust for new type of current_file_list. * git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159870 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 919d698de0f..5f91ddc32d1 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -930,8 +930,6 @@ hashUtf8String (const char *str, int len) return hash; } -static GTY(()) tree utf8_decl_list = NULL_TREE; - tree build_utf8_ref (tree name) { @@ -996,14 +994,12 @@ build_utf8_ref (tree name) } } - TREE_CHAIN (decl) = utf8_decl_list; layout_decl (decl, 0); DECL_SIZE (decl) = TYPE_SIZE (ctype); DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (ctype); pushdecl (decl); rest_of_decl_compilation (decl, global_bindings_p (), 0); varpool_mark_needed_node (varpool_node (decl)); - utf8_decl_list = decl; ref = build1 (ADDR_EXPR, utf8const_ptr_type, decl); IDENTIFIER_UTF8_REF (name) = ref; return ref; -- cgit v1.2.1 From 3d5bf92fb5aa822ce8c705c602afb3b66382b81f Mon Sep 17 00:00:00 2001 From: froydnj Date: Wed, 26 May 2010 19:27:58 +0000 Subject: * java-tree.h (struct lang_decl_func): Change type of throws_list field to a VEC. * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): Adjust for changed type of DECL_FUNCTION_THROWS. * class.c (make_method_value): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159899 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 5f91ddc32d1..49299b885cd 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1519,18 +1519,19 @@ make_method_value (tree mdecl) { /* Compute the `throws' information for the method. */ tree table = null_pointer_node; - if (DECL_FUNCTION_THROWS (mdecl) != NULL_TREE) + if (DECL_FUNCTION_THROWS (mdecl) != NULL) { - int length = 1 + list_length (DECL_FUNCTION_THROWS (mdecl)); - tree iter, type, array; + int length = 1 + VEC_length (tree, DECL_FUNCTION_THROWS (mdecl)); + tree t, type, array; char buf[60]; + unsigned ix; table = tree_cons (NULL_TREE, table, NULL_TREE); - for (iter = DECL_FUNCTION_THROWS (mdecl); - iter != NULL_TREE; - iter = TREE_CHAIN (iter)) + for (ix = 0; + VEC_iterate (tree, DECL_FUNCTION_THROWS (mdecl), ix, t); + ix++) { - tree sig = DECL_NAME (TYPE_NAME (TREE_VALUE (iter))); + tree sig = DECL_NAME (TYPE_NAME (t)); tree utf8 = build_utf8_ref (unmangle_classname (IDENTIFIER_POINTER (sig), IDENTIFIER_LENGTH (sig))); -- cgit v1.2.1 From c9d228b7caffdcdd8753641944c5af49ad360513 Mon Sep 17 00:00:00 2001 From: froydnj Date: Fri, 28 May 2010 13:41:55 +0000 Subject: * java-tree.h (method_entry): Declare. Declare VECs containing it. (struct lang_type): Change type of otable_methods, atable_methods, and itable_methods to VECs. Fix comment for atable_methods. (emit_symbol_table): Take a VEC instead of a tree. (get_symbol_table_index): Take a VEC * instead of a tree *. * class.c (add_table_and_syms): Take a VEC instead of a tree. (emit_symbol_table): Update for changed parameter type. * expr.c (get_symbol_table_index): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159974 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 49299b885cd..f346ad420f7 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1720,11 +1720,11 @@ supers_all_compiled (tree type) static void add_table_and_syms (VEC(constructor_elt,gc) **v, - tree method_slot, + VEC(method_entry,gc) *methods, const char *table_name, tree table_slot, tree table_type, const char *syms_name, tree syms_slot) { - if (method_slot == NULL_TREE) + if (methods == NULL) { PUSH_FIELD_VALUE (*v, table_name, null_pointer_node); PUSH_FIELD_VALUE (*v, syms_name, null_pointer_node); @@ -2886,31 +2886,27 @@ build_symbol_entry (tree decl, tree special) /* Emit a symbol table: used by -findirect-dispatch. */ tree -emit_symbol_table (tree name, tree the_table, tree decl_list, +emit_symbol_table (tree name, tree the_table, + VEC(method_entry,gc) *decl_table, tree the_syms_decl, tree the_array_element_type, int element_size) { - tree method_list, method, table, list, null_symbol; + tree table, list, null_symbol; tree table_size, the_array_type; - int index; + unsigned index; + method_entry *e; /* Only emit a table if this translation unit actually made any references via it. */ - if (decl_list == NULL_TREE) + if (decl_table == NULL) return the_table; /* Build a list of _Jv_MethodSymbols for each entry in otable_methods. */ - index = 0; - method_list = decl_list; - list = NULL_TREE; - while (method_list != NULL_TREE) - { - tree special = TREE_PURPOSE (method_list); - method = TREE_VALUE (method_list); - list = tree_cons (NULL_TREE, build_symbol_entry (method, special), list); - method_list = TREE_CHAIN (method_list); - index++; - } + list = NULL_TREE; + for (index = 0; VEC_iterate (method_entry, decl_table, index, e); index++) + list = tree_cons (NULL_TREE, + build_symbol_entry (e->method, e->special), + list); /* Terminate the list with a "null" entry. */ null_symbol = build_symbol_table_entry (null_pointer_node, -- cgit v1.2.1 From ba72912a012b97cad825eebee3f5f22253d0afe4 Mon Sep 17 00:00:00 2001 From: lauras Date: Tue, 8 Jun 2010 07:25:24 +0000 Subject: gcc/ada: 2010-06-08 Laurynas Biveinis * gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC allocation. (init_dummy_type): Likewise. (gnat_pushlevel): Likewise. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. (extract_encoding): Likewise. (decode_name): Likewise. * gcc-interface/misc.c (gnat_printable_name): Likewise. * gcc-interface/decl.c (annotate_value): Likewise. * gcc-interface/ada-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. (SET_TYPE_LANG_SPECIFIC): Use typed GC allocation. (SET_DECL_LANG_SPECIFIC): Likewise. gcc/c-family: 2010-06-08 Laurynas Biveinis * c-pragma.c (push_alignment): Use typed GC allocation. (handle_pragma_push_options): Likewise. * c-common.c (parse_optimize_options): Likewise. * c-common.h (struct sorted_fields_type): Add variable_size GTY option. gcc/cp: 2010-06-08 Laurynas Biveinis * typeck2.c (abstract_virtuals_error): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class): Likewise. (push_tinst_level): Likewise. * parser.c (cp_lexer_new_main): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * decl.c (make_label_decl): Likewise. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * class.c (finish_struct_1): Likewise. * cp-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * parser.c (cp_parser_new): Update comment to not reference ggc_alloc. gcc/fortran: 2010-06-08 Laurynas Biveinis * trans-types.c (gfc_get_nodesc_array_type): Use typed GC allocation. (gfc_get_array_type_bounds): Likewise. * trans-decl.c (gfc_allocate_lang_decl): Likewise. (gfc_find_module): Likewise. * f95-lang.c (pushlevel): Likewise. * trans.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. gcc/java: 2010-06-08 Laurynas Biveinis * jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation. * jcf-parse.c (java_parse_file): Likewise. (process_zip_dir): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise. * expr.c (add_type_assertion): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * class.c (add_method_1): Likewise. (java_treetreehash_new): Likewise. * java-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * jch.h (struct cpool_entry): Likewise. * java-tree.h (java_treetreehash_create): Remove parameter ggc. * except.c (prepare_eh_table_type): Update java_treetreehash_create call. * class.c (add_method_1): Update java_treetreehash_create call. (java_treetreehash_create): Remove parameter gc. Use htab_create_ggc. gcc/lto: 2010-06-08 Laurynas Biveinis * lto.c (lto_read_in_decl_state): Use typed GC allocation. (lto_file_read): Likewise. (new_partition): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objc: 2010-06-08 Laurynas Biveinis * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. * objc-act.c (objc_volatilize_decl): Likewise. (objc_build_string_object): Likewise. (hash_init): Likewise. (hash_enter): Likewise. (hash_add_attr): Likewise. (add_class): Likewise. (start_class): Likewise. gcc/objcp: 2010-06-08 Laurynas Biveinis * objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. gcc: 2010-06-08 Laurynas Biveinis * doc/tm.texi (Per-Function Data): Do not reference ggc_alloc. * doc/gty.texi (GTY Options): Document typed GC allocation and variable_size GTY option. * ggc-internal.h: New. * ggc.h: Update copyright year. (digit_string): Move to stringpool.c. (ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots) (gt_pch_save_stringpool, gt_pch_fixup_stringpool) (gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object) (init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size) (ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write) (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read) (ggc_force_collect, ggc_get_size, ggc_statistics) (ggc_print_common_statistics): Move to ggc-internal.h. (digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat) (ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW) (GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec) (ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic) (ggc_min_heapsize_heuristic, ggc_alloc_zone) (ggc_alloc_zone_pass_stat): Remove. (ggc_internal_alloc_stat, ggc_internal_alloc) (ggc_internal_cleared_alloc_stat): New. (GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine. (ggc_internal_vec_alloc_stat) (ggc_internal_cleared_vec_alloc_stat) (ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc) (ggc_alloc_atomic_stat, ggc_alloc_atomic) (ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args) (ggc_cleared_alloc_ptr_array_two_args): New. (htab_create_ggc, splay_tree_new_ggc): Redefine. (ggc_splay_alloc): Change the type of the first argument to enum gt_types_enum. (ggc_alloc_string): Make macro. (ggc_alloc_string_stat): New. (ggc_strdup): Redefine. (rtl_zone, tree_zone, tree_id_zone): Declare unconditionally. (ggc_alloc_rtvec_sized): New. (ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat) (ggc_internal_cleared_alloc_zone_stat) (ggc_internal_zone_alloc_stat) (ggc_internal_zone_cleared_alloc_stat) (ggc_internal_zone_vec_alloc_stat) (ggc_alloc_zone_rtx_def_stat) (ggc_alloc_zone_tree_node_stat) (ggc_alloc_zone_cleared_tree_node_stat) (ggc_alloc_cleared_gimple_statement_d_stat): New. * ggc-common.c: Include ggc-internal.h. (ggc_internal_cleared_alloc_stat): Rename from ggc_alloc_cleared_stat. (ggc_realloc_stat): Use ggc_internal_alloc_stat. (ggc_calloc): Remove. (ggc_cleared_alloc_htab_ignore_args): New. (ggc_cleared_alloc_ptr_array_two_args): New. (ggc_splay_alloc): Add obj_type parameter. (init_ggc_heuristics): Formatting fixes. * ggc-none.c: Update copyright year. (ggc_alloc_stat): Rename to ggc_alloc_stat. (ggc_alloc_cleared_stat): Rename to ggc_internal_cleared_alloc_stat. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-page.c: Update copyright year. Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_typed_stat): Call ggc_internal_alloc_stat. (ggc_alloc_stat): Rename to ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-zone.c: Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat): New. (ggc_internal_cleared_alloc_zone_stat): New. (ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat. (ggc_alloc_stat): Rename ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. * stringpool.c: Update copyright year. Include ggc-internal.h (digit_vector): Make static. (digit_string): Moved from ggc.h. (stringpool_ggc_alloc): Use ggc_alloc_atomic. (ggc_alloc_string): Rename to ggc_alloc_string_stat. * Makefile.in (GGC_INTERNAL_H): New. (ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add $(GGC_INTERNAL_H) to dependencies. * gentype.c: Update copyright year. (walk_type): Accept variable_size GTY option. (USED_BY_TYPED_GC_P): New macro. (write_enum_defn): Use USED_BY_TYPED_GC_P. Do not output whitespace at the end of strings. (get_type_specifier, variable_size_p): New functions. (alloc_quantity, alloc_zone): New enums. (write_typed_alloc_def): New function. (write_typed_struct_alloc_def): Likewise. (write_typed_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (output_typename, write_splay_tree_allocator_def): Likewise. (write_splay_tree_allocators): Likewise. (main): Call write_typed_alloc_defns and write_splay_tree_allocators. * lto-streamer.h (lto_file_decl_data_ptr): New. * passes.c (order): Define using cgraph_node_ptr. * strinpool.c (struct string_pool_data): Declare nested_ptr using ht_identifier_ptr. * gimple.h (union gimple_statement_d): Likewise. * rtl.h (struct rtx_def): Likewise. (struct rtvec_def): Likewise. * tree.h (union tree_node): Likewise. * tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise. * cfgloop.c (record_loop_exits): Use htab_create_ggc. * tree-scalar-evolution.c (scev_initialize): Likewise. * alias.c (record_alias_subset): Update splay_tree_new_ggc call. * dwarf2asm.c (dw2_force_const_mem): Likewise. * omp-low.c (lower_omp_critical): Likewise. * bitmap.h (struct bitmap_head_def): Update comment to not reference ggc_alloc. * config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC. * ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC. * ipa-prop.c (duplicate_ggc_array): Rename to duplicate_ipa_jump_func_array. Use typed GC allocation. (ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array. * gimple.c (gimple_alloc_stat): Use ggc_alloc_cleared_gimple_statement_d_stat. * varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def. * tree.c (make_node_stat): Use ggc_alloc_zone_cleared_tree_node_stat. (make_tree_vec_stat): Likewise. (build_vl_exp_stat): Likewise. (copy_node_stat): Use ggc_alloc_zone_tree_node_stat. (make_tree_binfo_stat): Likewise. (tree_cons_stat): Likewise. * rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat. (shallow_copy_rtx_stat): Likewise. (make_node_stat): Likewise. * lto-symtab.c: Fix comment. * tree-cfg.c (create_bb): Update comment to not reference ggc_alloc_cleared. * tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is value. * varpool.c (varpool_node): Use typed GC allocation. (varpool_extra_name_alias): Likewise. * varasm.c (emutls_decl): Likewise. (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. * tree.c (build_vl_exp_stat): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise. * tree-ssa.c (init_tree_ssa): Likewise. * tree-ssa-structalias.c (heapvar_insert): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-alias.c (get_ptr_info): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-phinodes.c (allocate_phi_node): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-dfa.c (create_var_ann): Likewise. * tree-cfg.c (create_bb): Likewise. * toplev.c (alloc_for_identifier_to_locale): Likewise. (general_init): Likewise. * stringpool.c (stringpool_ggc_alloc): Likewise. (gt_pch_save_stringpool): Likewise. * sese.c (if_region_set_false_region): Likewise. * passes.c (do_per_function_toporder): Likewise. * optabs.c (set_optab_libfunc): Likewise. (set_conv_libfunc): Likewise. * lto-symtab.c (lto_symtab_register_decl): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (make_new_block): Likewise. (unpack_ts_real_cst_value_fields): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * lambda.h (lambda_vector_new): Likewise. * lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise. * ira.c (update_equiv_regs): Likewise. * ipa.c (cgraph_node_set_new): Likewise. (cgraph_node_set_add): Likewise. (varpool_node_set_new): Likewise. (varpool_node_set_add): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise. (duplicate_ipa_jump_func_array): Likewise. (ipa_read_node_info): Likewise. * ipa-cp.c (ipcp_create_replace_map): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * gimple.c (gimple_alloc_stat): Likewise. (gimple_build_omp_for): Likewise. (gimple_seq_alloc): Likewise. (gimple_copy): Likewise. * gimple-iterator.c (gsi_insert_before_without_update): Likewise. (gsi_insert_after_without_update): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (allocate_struct_function): Likewise. (types_used_by_var_decl_insert): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * emit-rtl.c (get_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. * dwarf2out.c (new_cfi): Likewise. (queue_reg_save): Likewise. (dwarf2out_frame_init): Likewise. (new_loc_descr): Likewise. (find_AT_string): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (loc_descriptor): Likewise. (add_loc_descr_to_each): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (add_comp_dir_attribute): Likewise. (add_name_and_src_coords_attributes): Likewise. (lookup_filename): Likewise. (store_vcall_insn): Likewise. (dwarf2out_init): Likewise. * dbxout.c (dbxout_init): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/score/score7.c (score7_output_external): Likewise. * config/score/score3.c (score3_output_external): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (get_deferred_plabel): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_need_linkage): Likewise. (alpha_use_linkage): Likewise. * cgraph.c (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_indirect_edge): Likewise. (cgraph_add_asm_node): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cfgloop.c (alloc_loop): Likewise. (rescan_loop_exit): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * c-parser.c (c_parse_init): Likewise. (c_parse_file): Likewise. * c-decl.c (bind): Likewise. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (c_push_function_context): Likewise. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * alias.c (record_alias_subset): Likewise. (init_alias_analysis): Likewise. include: 2010-06-08 Laurynas Biveinis * splay-tree.h: Update copyright years. (splay_tree_s): Document fields. (splay_tree_new_typed_alloc): New. * hashtab.h: Update copyright years. (htab_create_typed_alloc): New. libcpp: 2010-06-08 Laurynas Biveinis * include/symtab.h (ht_identifier_ptr): New. libiberty: 2010-06-08 Laurynas Biveinis * splay-tree.c: Update copyright years. (splay_tree_new_typed_alloc): New. (splay_tree_new_with_allocator): Use it. * hashtab.c: Update copyright years. (htab_create_typed_alloc): New. (htab_create_alloc): Use it. * functions.texi: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160425 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index f346ad420f7..47b721cd7d0 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -763,13 +763,12 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type) DECL_CONTEXT (fndecl) = this_class; DECL_LANG_SPECIFIC (fndecl) - = GGC_CNEW (struct lang_decl); + = ggc_alloc_cleared_lang_decl(sizeof (struct lang_decl)); DECL_LANG_SPECIFIC (fndecl)->desc = LANG_DECL_FUNC; /* Initialize the static initializer test table. */ - - DECL_FUNCTION_INIT_TEST_TABLE (fndecl) = - java_treetreehash_create (10, 1); + + DECL_FUNCTION_INIT_TEST_TABLE (fndecl) = java_treetreehash_create (10); /* Initialize the initialized (static) class table. */ if (access_flags & ACC_STATIC) @@ -3144,7 +3143,7 @@ java_treetreehash_new (htab_t ht, tree t) e = htab_find_slot_with_hash (ht, t, hv, INSERT); if (*e == NULL) { - tthe = (struct treetreehash_entry *) (*ht->alloc_f) (1, sizeof (*tthe)); + tthe = ggc_alloc_cleared_treetreehash_entry (); tthe->key = t; *e = tthe; } @@ -3154,14 +3153,10 @@ java_treetreehash_new (htab_t ht, tree t) } htab_t -java_treetreehash_create (size_t size, int gc) +java_treetreehash_create (size_t size) { - if (gc) - return htab_create_ggc (size, java_treetreehash_hash, - java_treetreehash_compare, NULL); - else - return htab_create_alloc (size, java_treetreehash_hash, - java_treetreehash_compare, free, xcalloc, free); + return htab_create_ggc (size, java_treetreehash_hash, + java_treetreehash_compare, NULL); } /* Break down qualified IDENTIFIER into package and class-name components. -- cgit v1.2.1 From 0c4db5ff3e6dc0c3f4b6e5d74471cf8170133401 Mon Sep 17 00:00:00 2001 From: froydnj Date: Mon, 28 Jun 2010 12:06:52 +0000 Subject: * java-tree.h (struct lang_type) [catch_classes]: Change type to a VEC. * except.c (prepare_eh_table_type): Call CONSTRUCTOR_APPEND_ELT instead of tree_cons. * class.c (make_class): Add dummy entry to TYPE_CATCH_CLASSES. (emit_catch_table): Adjust for new type of TYPE_CATCH_CLASSES. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161487 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 47b721cd7d0..7d90a032a81 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -382,6 +382,12 @@ make_class (void) loading works. */ TYPE_BINFO (type) = make_tree_binfo (0); MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC (type); + TYPE_CATCH_CLASSES (type) = NULL; + /* Push a dummy entry; we can't call make_catch_class_record here + because other infrastructure may not be set up yet. We'll come + back and fill it in later once said infrastructure is + initialized. */ + CONSTRUCTOR_APPEND_ELT (TYPE_CATCH_CLASSES (type), NULL_TREE, NULL_TREE); return type; } @@ -2960,18 +2966,17 @@ tree emit_catch_table (tree this_class) { tree table, table_size, array_type; - TYPE_CATCH_CLASSES (this_class) = - tree_cons (NULL, - make_catch_class_record (null_pointer_node, null_pointer_node), - TYPE_CATCH_CLASSES (this_class)); - TYPE_CATCH_CLASSES (this_class) = nreverse (TYPE_CATCH_CLASSES (this_class)); - TYPE_CATCH_CLASSES (this_class) = - tree_cons (NULL, - make_catch_class_record (null_pointer_node, null_pointer_node), - TYPE_CATCH_CLASSES (this_class)); - table_size = build_index_type - (build_int_cst (NULL_TREE, - list_length (TYPE_CATCH_CLASSES (this_class)))); + int n_catch_classes; + constructor_elt *e; + /* Fill in the dummy entry that make_class created. */ + e = VEC_index (constructor_elt, TYPE_CATCH_CLASSES (this_class), 0); + e->value = make_catch_class_record (null_pointer_node, null_pointer_node); + CONSTRUCTOR_APPEND_ELT (TYPE_CATCH_CLASSES (this_class), NULL_TREE, + make_catch_class_record (null_pointer_node, + null_pointer_node)); + n_catch_classes = VEC_length (constructor_elt, + TYPE_CATCH_CLASSES (this_class)); + table_size = build_index_type (build_int_cst (NULL_TREE, n_catch_classes)); array_type = build_array_type (TREE_TYPE (TREE_TYPE (TYPE_CTABLE_DECL (this_class))), table_size); @@ -2979,7 +2984,7 @@ emit_catch_table (tree this_class) build_decl (input_location, VAR_DECL, DECL_NAME (TYPE_CTABLE_DECL (this_class)), array_type); DECL_INITIAL (table) = - build_constructor_from_list (array_type, TYPE_CATCH_CLASSES (this_class)); + build_constructor (array_type, TYPE_CATCH_CLASSES (this_class)); TREE_STATIC (table) = 1; TREE_READONLY (table) = 1; DECL_IGNORED_P (table) = 1; -- cgit v1.2.1 From 2a48831125500430e0d17d354d983360eeac064d Mon Sep 17 00:00:00 2001 From: froydnj Date: Mon, 5 Jul 2010 14:49:04 +0000 Subject: * constants.c (build_constants_constructor): Use build_constructor instead of build_constructor_from_list. * class.c (make_method_value): Likewise. (get_dispatch_table): Likewise. (make_class_data): Likewise. (emit_indirect_register_classes): Likewise. (emit_symbol_table): Likewise. (add_assertion_table_entry): Likewise. (emit_assertion_table): Likewise. (make_field_value): Use build_constructor_single instead of build_constructor_from_list. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161839 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 177 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 95 insertions(+), 82 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 7d90a032a81..3380af2fe8d 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1453,20 +1453,21 @@ make_field_value (tree fdecl) { tree field_address = integer_zero_node; + tree index, value; if ((DECL_INITIAL (fdecl) || ! flag_indirect_classes) && FIELD_STATIC (fdecl)) field_address = build_address_of (fdecl); - PUSH_FIELD_VALUE - (v, "info", - build_constructor_from_list (field_info_union_node, - build_tree_list - ((FIELD_STATIC (fdecl) + index = (FIELD_STATIC (fdecl) ? TREE_CHAIN (TYPE_FIELDS (field_info_union_node)) - : TYPE_FIELDS (field_info_union_node)), - (FIELD_STATIC (fdecl) + : TYPE_FIELDS (field_info_union_node)); + value = (FIELD_STATIC (fdecl) ? field_address - : byte_position (fdecl))))); + : byte_position (fdecl)); + + PUSH_FIELD_VALUE + (v, "info", + build_constructor_single (field_info_union_node, index, value)); } FINISH_RECORD_CONSTRUCTOR (finit, v, field_type_node); @@ -1524,14 +1525,23 @@ make_method_value (tree mdecl) { /* Compute the `throws' information for the method. */ tree table = null_pointer_node; - if (DECL_FUNCTION_THROWS (mdecl) != NULL) + + if (!VEC_empty (tree, DECL_FUNCTION_THROWS (mdecl))) { int length = 1 + VEC_length (tree, DECL_FUNCTION_THROWS (mdecl)); tree t, type, array; char buf[60]; - unsigned ix; + VEC(constructor_elt,gc) *v = NULL; + int idx = length - 1; + unsigned ix; + constructor_elt *e; + + v = VEC_alloc (constructor_elt, gc, length); + VEC_safe_grow_cleared (constructor_elt, gc, v, length); + + e = VEC_index (constructor_elt, v, idx--); + e->value = null_pointer_node; - table = tree_cons (NULL_TREE, table, NULL_TREE); for (ix = 0; VEC_iterate (tree, DECL_FUNCTION_THROWS (mdecl), ix, t); ix++) @@ -1540,10 +1550,12 @@ make_method_value (tree mdecl) tree utf8 = build_utf8_ref (unmangle_classname (IDENTIFIER_POINTER (sig), IDENTIFIER_LENGTH (sig))); - table = tree_cons (NULL_TREE, utf8, table); + e = VEC_index (constructor_elt, v, idx--); + e->value = utf8; } + gcc_assert (idx == -1); type = build_prim_array_type (ptr_type_node, length); - table = build_constructor_from_list (type, table); + table = build_constructor (type, v); /* Compute something unique enough. */ sprintf (buf, "_methods%d", method_name_count++); array = build_decl (input_location, @@ -1604,11 +1616,22 @@ get_dispatch_table (tree type, tree this_class_addr) int abstract_p = CLASS_ABSTRACT (TYPE_NAME (type)); tree vtable = get_dispatch_vector (type); int i, j; - tree list = NULL_TREE; int nvirtuals = TREE_VEC_LENGTH (vtable); int arraysize; tree gc_descr; + VEC(constructor_elt,gc) *v = NULL; + constructor_elt *e; + tree arraytype; + + arraysize = (TARGET_VTABLE_USES_DESCRIPTORS? nvirtuals + 1 : nvirtuals + 2); + if (TARGET_VTABLE_USES_DESCRIPTORS) + arraysize *= TARGET_VTABLE_USES_DESCRIPTORS; + arraysize += 2; + VEC_safe_grow_cleared (constructor_elt, gc, v, arraysize); + e = VEC_index (constructor_elt, v, arraysize - 1); + +#define CONSTRUCTOR_PREPEND_VALUE(E, V) E->value = V, E-- for (i = nvirtuals; --i >= 0; ) { tree method = TREE_VEC_ELT (vtable, i); @@ -1620,9 +1643,9 @@ get_dispatch_table (tree type, tree this_class_addr) if (TARGET_VTABLE_USES_DESCRIPTORS) for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j) - list = tree_cons (NULL_TREE, null_pointer_node, list); + CONSTRUCTOR_PREPEND_VALUE (e, null_pointer_node); else - list = tree_cons (NULL_TREE, null_pointer_node, list); + CONSTRUCTOR_PREPEND_VALUE (e, null_pointer_node); } else { @@ -1632,13 +1655,13 @@ get_dispatch_table (tree type, tree this_class_addr) tree fdesc = build2 (FDESC_EXPR, nativecode_ptr_type_node, method, build_int_cst (NULL_TREE, j)); TREE_CONSTANT (fdesc) = 1; - list = tree_cons (NULL_TREE, fdesc, list); + CONSTRUCTOR_PREPEND_VALUE (e, fdesc); } else - list = tree_cons (NULL_TREE, - build1 (ADDR_EXPR, nativecode_ptr_type_node, - method), - list); + CONSTRUCTOR_PREPEND_VALUE (e, + build1 (ADDR_EXPR, + nativecode_ptr_type_node, + method)); } } @@ -1651,23 +1674,21 @@ get_dispatch_table (tree type, tree this_class_addr) pointer, and subsequent words (usually one) contain the GC descriptor. In all other cases, we reserve two extra vtable slots. */ gc_descr = get_boehm_type_descriptor (type); - list = tree_cons (NULL_TREE, gc_descr, list); + CONSTRUCTOR_PREPEND_VALUE (e, gc_descr); for (j = 1; j < TARGET_VTABLE_USES_DESCRIPTORS-1; ++j) - list = tree_cons (NULL_TREE, gc_descr, list); - list = tree_cons (NULL_TREE, this_class_addr, list); + CONSTRUCTOR_PREPEND_VALUE (e, gc_descr); + CONSTRUCTOR_PREPEND_VALUE (e, this_class_addr); /** Pointer to type_info object (to be implemented), according to g++ ABI. */ - list = tree_cons (NULL_TREE, null_pointer_node, list); + CONSTRUCTOR_PREPEND_VALUE (e, null_pointer_node); /** Offset to start of whole object. Always (ptrdiff_t)0 for Java. */ - list = tree_cons (integer_zero_node, null_pointer_node, list); + gcc_assert (e == VEC_address (constructor_elt, v)); + e->index = integer_zero_node; + e->value = null_pointer_node; +#undef CONSTRUCTOR_PREPEND_VALUE - arraysize = (TARGET_VTABLE_USES_DESCRIPTORS? nvirtuals + 1 : nvirtuals + 2); - if (TARGET_VTABLE_USES_DESCRIPTORS) - arraysize *= TARGET_VTABLE_USES_DESCRIPTORS; - arraysize += 2; - return build_constructor_from_list - (build_prim_array_type (nativecode_ptr_type_node, - arraysize), list); + arraytype = build_prim_array_type (nativecode_ptr_type_node, arraysize); + return build_constructor (arraytype, v); } @@ -1751,14 +1772,11 @@ make_class_data (tree type) { tree decl, cons, temp; tree field, fields_decl; - tree static_fields = NULL_TREE; - tree instance_fields = NULL_TREE; HOST_WIDE_INT static_field_count = 0; HOST_WIDE_INT instance_field_count = 0; HOST_WIDE_INT field_count; tree field_array_type; tree method; - tree methods = NULL_TREE; tree dtable_decl = NULL_TREE; HOST_WIDE_INT method_count = 0; tree method_array_type; @@ -1779,6 +1797,9 @@ make_class_data (tree type) tree first_real_field; VEC(constructor_elt,gc) *v1 = NULL, *v2 = NULL; tree reflection_data; + VEC(constructor_elt,gc) *static_fields = NULL; + VEC(constructor_elt,gc) *instance_fields = NULL; + VEC(constructor_elt,gc) *methods = NULL; this_class_addr = build_static_class_ref (type); decl = TREE_OPERAND (this_class_addr, 0); @@ -1882,7 +1903,7 @@ make_class_data (tree type) as it is used in the creation of the field itself. */ tree init = make_field_value (field); tree initial = DECL_INITIAL (field); - static_fields = tree_cons (NULL_TREE, init, static_fields); + CONSTRUCTOR_APPEND_ELT (static_fields, NULL_TREE, init); /* If the initial value is a string constant, prevent output_constant from trying to assemble the value. */ if (initial != NULL_TREE @@ -1894,22 +1915,25 @@ make_class_data (tree type) else if (uses_jv_markobj || !flag_reduced_reflection) { tree init = make_field_value (field); - instance_fields = tree_cons (NULL_TREE, init, instance_fields); + CONSTRUCTOR_APPEND_ELT (instance_fields, NULL_TREE, init); } } } + gcc_assert (static_field_count + == VEC_length (constructor_elt, static_fields)); + gcc_assert (instance_field_count + == VEC_length (constructor_elt, instance_fields)); + if (field_count > 0) { - static_fields = nreverse (static_fields); - instance_fields = nreverse (instance_fields); - static_fields = chainon (static_fields, instance_fields); + VEC_safe_splice (constructor_elt, gc, static_fields, instance_fields); field_array_type = build_prim_array_type (field_type_node, field_count); fields_decl = build_decl (input_location, VAR_DECL, mangled_classname ("_FL_", type), field_array_type); - DECL_INITIAL (fields_decl) = build_constructor_from_list - (field_array_type, 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; @@ -1958,15 +1982,14 @@ make_class_data (tree type) { init = make_method_value (method); method_count++; - methods = tree_cons (NULL_TREE, init, methods); + CONSTRUCTOR_APPEND_ELT (methods, NULL_TREE, init); } } method_array_type = build_prim_array_type (method_type_node, method_count); methods_decl = build_decl (input_location, VAR_DECL, mangled_classname ("_MT_", type), method_array_type); - DECL_INITIAL (methods_decl) = build_constructor_from_list - (method_array_type, nreverse (methods)); + DECL_INITIAL (methods_decl) = build_constructor (method_array_type, methods); TREE_STATIC (methods_decl) = 1; DECL_ARTIFICIAL (methods_decl) = 1; DECL_IGNORED_P (methods_decl) = 1; @@ -2004,16 +2027,17 @@ make_class_data (tree type) if (interface_len > 0) { - tree init = NULL_TREE; int i; tree interface_array_type, idecl; + VEC(constructor_elt,gc) *init = VEC_alloc (constructor_elt, gc, + interface_len); interface_array_type = build_prim_array_type (class_ptr_type, interface_len); idecl = build_decl (input_location, VAR_DECL, mangled_classname ("_IF_", type), interface_array_type); - for (i = interface_len; i > 0; i--) + for (i = 1; i <= interface_len; i++) { tree child = BINFO_BASE_BINFO (TYPE_BINFO (type), i); tree iclass = BINFO_TYPE (child); @@ -2027,10 +2051,9 @@ make_class_data (tree type) int int_index = alloc_class_constant (iclass); index = build_int_cst (ptr_type_node, int_index); } - init = tree_cons (NULL_TREE, index, init); + CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, index); } - DECL_INITIAL (idecl) = build_constructor_from_list (interface_array_type, - init); + DECL_INITIAL (idecl) = build_constructor (interface_array_type, init); TREE_STATIC (idecl) = 1; DECL_ARTIFICIAL (idecl) = 1; DECL_IGNORED_P (idecl) = 1; @@ -2729,8 +2752,8 @@ emit_indirect_register_classes (tree *list_p) tree klass, t, register_class_fn; int i; - tree init = NULL_TREE; int size = VEC_length (tree, registered_class) * 2 + 1; + VEC(constructor_elt,gc) *init = VEC_alloc (constructor_elt, gc, size); tree class_array_type = build_prim_array_type (ptr_type_node, size); tree cdecl = build_decl (input_location, @@ -2739,18 +2762,14 @@ emit_indirect_register_classes (tree *list_p) tree reg_class_list; for (i = 0; VEC_iterate (tree, registered_class, i, klass); ++i) { - init = tree_cons (NULL_TREE, - fold_convert (ptr_type_node, - build_static_class_ref (klass)), init); - init = tree_cons - (NULL_TREE, - fold_convert (ptr_type_node, - build_address_of (build_classdollar_field (klass))), - init); - } - init = tree_cons (NULL_TREE, integer_zero_node, init); - DECL_INITIAL (cdecl) = build_constructor_from_list (class_array_type, - nreverse (init)); + t = fold_convert (ptr_type_node, build_static_class_ref (klass)); + CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, t); + t = fold_convert (ptr_type_node, + build_address_of (build_classdollar_field (klass))); + CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, t); + } + CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, integer_zero_node); + DECL_INITIAL (cdecl) = build_constructor (class_array_type, init); TREE_CONSTANT (DECL_INITIAL (cdecl)) = 1; TREE_STATIC (cdecl) = 1; DECL_ARTIFICIAL (cdecl) = 1; @@ -2896,10 +2915,10 @@ emit_symbol_table (tree name, tree the_table, tree the_syms_decl, tree the_array_element_type, int element_size) { - tree table, list, null_symbol; - tree table_size, the_array_type; + tree table, null_symbol, table_size, the_array_type; unsigned index; method_entry *e; + VEC(constructor_elt,gc) *v = NULL; /* Only emit a table if this translation unit actually made any references via it. */ @@ -2907,21 +2926,17 @@ emit_symbol_table (tree name, tree the_table, return the_table; /* Build a list of _Jv_MethodSymbols for each entry in otable_methods. */ - list = NULL_TREE; for (index = 0; VEC_iterate (method_entry, decl_table, index, e); index++) - list = tree_cons (NULL_TREE, - build_symbol_entry (e->method, e->special), - list); + CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, + build_symbol_entry (e->method, e->special)); /* Terminate the list with a "null" entry. */ null_symbol = build_symbol_table_entry (null_pointer_node, null_pointer_node, null_pointer_node); - list = tree_cons (NULL_TREE, null_symbol, list); + CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, null_symbol); - /* Put the list in the right order and make it a constructor. */ - list = nreverse (list); - table = build_constructor_from_list (symbols_array_type, list); + table = build_constructor (symbols_array_type, v); /* Make it the initial value for otable_syms and emit the decl. */ DECL_INITIAL (the_syms_decl) = table; @@ -3033,7 +3048,7 @@ add_assertion_table_entry (void **htab_entry, void *ptr) { tree entry; tree code_val, op1_utf8, op2_utf8; - tree *list = (tree *) ptr; + VEC(constructor_elt,gc) **v = (VEC(constructor_elt,gc) **) ptr; type_assertion *as = (type_assertion *) *htab_entry; code_val = build_int_cst (NULL_TREE, as->assertion_code); @@ -3050,7 +3065,7 @@ add_assertion_table_entry (void **htab_entry, void *ptr) entry = build_assertion_table_entry (code_val, op1_utf8, op2_utf8); - *list = tree_cons (NULL_TREE, entry, *list); + CONSTRUCTOR_APPEND_ELT (*v, NULL_TREE, entry); return true; } @@ -3060,22 +3075,20 @@ static tree emit_assertion_table (tree klass) { tree null_entry, ctor, table_decl; - tree list = NULL_TREE; htab_t assertions_htab = TYPE_ASSERTIONS (klass); + VEC(constructor_elt,gc) *v = NULL; /* Iterate through the hash table. */ - htab_traverse (assertions_htab, add_assertion_table_entry, &list); + htab_traverse (assertions_htab, add_assertion_table_entry, &v); /* Finish with a null entry. */ null_entry = build_assertion_table_entry (integer_zero_node, null_pointer_node, null_pointer_node); - list = tree_cons (NULL_TREE, null_entry, list); + CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, null_entry); - /* Put the list in the right order and make it a constructor. */ - list = nreverse (list); - ctor = build_constructor_from_list (assertion_table_type, list); + ctor = build_constructor (assertion_table_type, v); table_decl = build_decl (input_location, VAR_DECL, mangled_classname ("_type_assert_", klass), -- cgit v1.2.1 From 95518808efcc9733044ec89f74dd0e9c106f78fd Mon Sep 17 00:00:00 2001 From: froydnj Date: Mon, 5 Jul 2010 22:19:22 +0000 Subject: PR bootstrap/44825 * class.c (make_class_data): Cast result of VEC_length calls to int. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161856 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 3380af2fe8d..c409d0984d9 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1921,9 +1921,9 @@ make_class_data (tree type) } gcc_assert (static_field_count - == VEC_length (constructor_elt, static_fields)); + == (int) VEC_length (constructor_elt, static_fields)); gcc_assert (instance_field_count - == VEC_length (constructor_elt, instance_fields)); + == (int) VEC_length (constructor_elt, instance_fields)); if (field_count > 0) { -- cgit v1.2.1 From 0b205f4ca112a643f4f1b9c9886648b569e0b380 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 8 Jul 2010 04:22:54 +0000 Subject: =?UTF-8?q?2010-07-08=20=20Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez=20?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * toplev.h: Do not include diagnostic-core.h. Include diagnostic-core.h in every file that includes toplev.h. * c-tree.h: Do not include toplev.h. * pretty-print.h: Update comment. * Makefile.in: Update dependencies. * alias.c: Include diagnostic-core.h in every file that includes toplev.h. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/pe.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/cris/cris.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/host-darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/netware.c: Likewise. * config/i386/nwld.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/picochip/picochip.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/score/score3.c: Likewise. * config/score/score7.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-base.c: Likewise. * config/sh/symbian-c.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sol2-c.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * convert.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * dominance.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * gimple-low.c: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * integrate.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-iv.c: Likewise. * lto-opts.c: Likewise. * lto-symtab.c: Likewise. * main.c: Likewise. * modulo-sched.c: Likewise. * optabs.c: Likewise. * params.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * targhooks.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-nomudflap.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-phinodes.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * varasm.c: Likewise. * vec.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. c-family/ * c-common.h: Include diagnostic-core.h. Error if already included. * c-semantics.c: Do not define GCC_DIAG_STYLE here. cp/ * cp-tree.h: Do not include toplev.h. java/ * boehm.c: Include diagnostic-core.h in every file that includes toplev.h. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. ada/ * gcc-interface/utils.c: Include diagnostic-core.h in every file that includes toplev.h. lto/ * lto-coff.c: Include diagnostic-core.h in every file that includes toplev.h. * lto-elf.c: Likewise. * lto-lang.c: Likewise. * lto-macho.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161943 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index c409d0984d9..7734c5961f2 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -32,6 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "java-tree.h" #include "jcf.h" #include "obstack.h" +#include "diagnostic-core.h" #include "toplev.h" #include "output.h" #include "parse.h" -- cgit v1.2.1 From 1767a056f10a2ccbc900df04d01193da73a3d272 Mon Sep 17 00:00:00 2001 From: froydnj Date: Thu, 15 Jul 2010 14:31:28 +0000 Subject: gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162223 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/class.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index 7734c5961f2..78f77ab2d26 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -782,7 +782,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type) DECL_FUNCTION_INITIALIZED_CLASS_TABLE (fndecl) = htab_create_ggc (50, htab_hash_pointer, htab_eq_pointer, NULL); - TREE_CHAIN (fndecl) = TYPE_METHODS (this_class); + DECL_CHAIN (fndecl) = TYPE_METHODS (this_class); TYPE_METHODS (this_class) = fndecl; /* If pointers to member functions use the least significant bit to @@ -853,7 +853,7 @@ add_field (tree klass, tree name, tree field_type, int flags) tree field; field = build_decl (input_location, is_static ? VAR_DECL : FIELD_DECL, name, field_type); - TREE_CHAIN (field) = TYPE_FIELDS (klass); + DECL_CHAIN (field) = TYPE_FIELDS (klass); TYPE_FIELDS (klass) = field; DECL_CONTEXT (field) = klass; MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (field); @@ -1460,7 +1460,7 @@ make_field_value (tree fdecl) field_address = build_address_of (fdecl); index = (FIELD_STATIC (fdecl) - ? TREE_CHAIN (TYPE_FIELDS (field_info_union_node)) + ? DECL_CHAIN (TYPE_FIELDS (field_info_union_node)) : TYPE_FIELDS (field_info_union_node)); value = (FIELD_STATIC (fdecl) ? field_address @@ -1599,7 +1599,7 @@ get_dispatch_vector (tree type) } for (method = TYPE_METHODS (type); method != NULL_TREE; - method = TREE_CHAIN (method)) + method = DECL_CHAIN (method)) { tree method_index = get_method_index (method); if (method_index != NULL_TREE @@ -1842,13 +1842,13 @@ make_class_data (tree type) /* Build Field array. */ field = TYPE_FIELDS (type); while (field && DECL_ARTIFICIAL (field)) - field = TREE_CHAIN (field); /* Skip dummy fields. */ + field = DECL_CHAIN (field); /* Skip dummy fields. */ if (field && DECL_NAME (field) == NULL_TREE) - field = TREE_CHAIN (field); /* Skip dummy field for inherited data. */ + field = DECL_CHAIN (field); /* Skip dummy field for inherited data. */ first_real_field = field; /* First count static and instance fields. */ - for ( ; field != NULL_TREE; field = TREE_CHAIN (field)) + for ( ; field != NULL_TREE; field = DECL_CHAIN (field)) { if (! DECL_ARTIFICIAL (field)) { @@ -1877,7 +1877,7 @@ make_class_data (tree type) for (i = 0, field = first_real_field; field != NULL_TREE; - field = TREE_CHAIN (field), i++) + field = DECL_CHAIN (field), i++) { if (! DECL_ARTIFICIAL (field)) { @@ -1894,7 +1894,7 @@ make_class_data (tree type) } for (field = first_real_field; field != NULL_TREE; - field = TREE_CHAIN (field)) + field = DECL_CHAIN (field)) { if (! DECL_ARTIFICIAL (field)) { @@ -1945,7 +1945,7 @@ make_class_data (tree type) /* Build Method array. */ for (method = TYPE_METHODS (type); - method != NULL_TREE; method = TREE_CHAIN (method)) + method != NULL_TREE; method = DECL_CHAIN (method)) { tree init; if (METHOD_PRIVATE (method) @@ -2390,7 +2390,7 @@ push_super_field (tree this_class, tree super_class) base_decl = build_decl (input_location, FIELD_DECL, NULL_TREE, super_class); DECL_IGNORED_P (base_decl) = 1; - TREE_CHAIN (base_decl) = TYPE_FIELDS (this_class); + DECL_CHAIN (base_decl) = TYPE_FIELDS (this_class); TYPE_FIELDS (this_class) = base_decl; DECL_SIZE (base_decl) = TYPE_SIZE (super_class); DECL_SIZE_UNIT (base_decl) = TYPE_SIZE_UNIT (super_class); @@ -2550,7 +2550,7 @@ add_miranda_methods (tree base_class, tree search_class) will be correct. This code must match similar layout code in the runtime. */ for (method_decl = TYPE_METHODS (elt); - method_decl; method_decl = TREE_CHAIN (method_decl)) + method_decl; method_decl = DECL_CHAIN (method_decl)) { tree sig, override; @@ -2614,7 +2614,7 @@ layout_class_methods (tree this_class) TYPE_METHODS (this_class) = nreverse (TYPE_METHODS (this_class)); for (method_decl = TYPE_METHODS (this_class); - method_decl; method_decl = TREE_CHAIN (method_decl)) + method_decl; method_decl = DECL_CHAIN (method_decl)) dtable_count = layout_class_method (this_class, super_class, method_decl, dtable_count); @@ -2629,7 +2629,7 @@ get_interface_method_index (tree method, tree interface) tree meth; int i = 1; - for (meth = TYPE_METHODS (interface); ; meth = TREE_CHAIN (meth)) + for (meth = TYPE_METHODS (interface); ; meth = DECL_CHAIN (meth)) { if (meth == method) return i; -- cgit v1.2.1