diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 20 | ||||
-rw-r--r-- | gcc/cp/call.c | 6 | ||||
-rw-r--r-- | gcc/cp/class.c | 98 | ||||
-rw-r--r-- | gcc/cp/cp-gimplify.c | 12 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 48 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 20 | ||||
-rw-r--r-- | gcc/cp/init.c | 14 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 8 | ||||
-rw-r--r-- | gcc/cp/method.c | 22 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 12 | ||||
-rw-r--r-- | gcc/cp/optimize.c | 18 | ||||
-rw-r--r-- | gcc/cp/parser.c | 8 | ||||
-rw-r--r-- | gcc/cp/pt.c | 48 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 6 | ||||
-rw-r--r-- | gcc/cp/search.c | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 16 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 4 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 2 |
19 files changed, 195 insertions, 175 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ea3e9b5..8b1399c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,23 @@ +2010-07-15 Nathan Froyd <froydnj@codesourcery.com> + + * 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. + 2010-07-14 Jason Merrill <jason@redhat.com> * init.c (sort_mem_initializers): Rename "field_type" to "ctx". diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 1c64149..8e259ee 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -641,7 +641,7 @@ build_aggr_conv (tree type, tree ctor, int flags) tree field = next_initializable_field (TYPE_FIELDS (type)); tree empty_ctor = NULL_TREE; - for (; field; field = next_initializable_field (TREE_CHAIN (field))) + for (; field; field = next_initializable_field (DECL_CHAIN (field))) { if (i < CONSTRUCTOR_NELTS (ctor)) { @@ -6095,7 +6095,7 @@ build_java_interface_fn_ref (tree fn, tree instance) /* Determine the itable index of FN. */ i = 1; - for (method = TYPE_METHODS (iface); method; method = TREE_CHAIN (method)) + for (method = TYPE_METHODS (iface); method; method = DECL_CHAIN (method)) { if (!DECL_VIRTUAL_P (method)) continue; @@ -6227,7 +6227,7 @@ build_special_member_call (tree instance, tree name, VEC(tree,gc) **args, /* If the current function is a complete object constructor or destructor, then we fetch the VTT directly. Otherwise, we look it up using the VTT we were given. */ - vtt = TREE_CHAIN (CLASSTYPE_VTABLES (current_class_type)); + vtt = DECL_CHAIN (CLASSTYPE_VTABLES (current_class_type)); vtt = decay_conversion (vtt); vtt = build3 (COND_EXPR, TREE_TYPE (vtt), build2 (EQ_EXPR, boolean_type_node, diff --git a/gcc/cp/class.c b/gcc/cp/class.c index a572af8..79b5a26 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -469,7 +469,7 @@ build_simple_base_path (tree expr, tree binfo) expr = build_simple_base_path (expr, d_binfo); for (field = TYPE_FIELDS (BINFO_TYPE (d_binfo)); - field; field = TREE_CHAIN (field)) + field; field = DECL_CHAIN (field)) /* Is this the base field created by build_base_field? */ if (TREE_CODE (field) == FIELD_DECL && DECL_FIELD_IS_BASE (field) @@ -1262,7 +1262,7 @@ check_bases (tree t, seen_non_virtual_nearly_empty_base_p = 0; if (!CLASSTYPE_NON_STD_LAYOUT (t)) - for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field)) if (TREE_CODE (field) == FIELD_DECL) break; @@ -1351,7 +1351,7 @@ check_bases (tree t, members, or has no base classes with non-static data members */ for (basefield = TYPE_FIELDS (basetype); basefield; - basefield = TREE_CHAIN (basefield)) + basefield = DECL_CHAIN (basefield)) if (TREE_CODE (basefield) == FIELD_DECL) { if (field) @@ -1609,7 +1609,7 @@ maybe_warn_about_overly_private_class (tree t) functions are private. (Since there are no friends or non-private statics, we can't ever call any of the private member functions.) */ - for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn)) + for (fn = TYPE_METHODS (t); fn; fn = DECL_CHAIN (fn)) /* We're not interested in compiler-generated methods; they don't provide any way to call private members. */ if (!DECL_ARTIFICIAL (fn)) @@ -1814,7 +1814,7 @@ finish_struct_methods (tree t) /* Clear DECL_IN_AGGR_P for all functions. */ for (fn_fields = TYPE_METHODS (t); fn_fields; - fn_fields = TREE_CHAIN (fn_fields)) + fn_fields = DECL_CHAIN (fn_fields)) DECL_IN_AGGR_P (fn_fields) = 0; /* Issue warnings about private constructors and such. If there are @@ -2545,7 +2545,7 @@ finish_struct_anon (tree t) { tree field; - for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field)) { if (TREE_STATIC (field)) continue; @@ -2557,7 +2557,7 @@ finish_struct_anon (tree t) { bool is_union = TREE_CODE (TREE_TYPE (field)) == UNION_TYPE; tree elt = TYPE_FIELDS (TREE_TYPE (field)); - for (; elt; elt = TREE_CHAIN (elt)) + for (; elt; elt = DECL_CHAIN (elt)) { /* We're generally only interested in entities the user declared, but we also find nested classes by noticing @@ -2750,7 +2750,7 @@ count_fields (tree fields) { tree x; int n_fields = 0; - for (x = fields; x; x = TREE_CHAIN (x)) + for (x = fields; x; x = DECL_CHAIN (x)) { if (TREE_CODE (x) == FIELD_DECL && ANON_AGGR_TYPE_P (TREE_TYPE (x))) n_fields += count_fields (TYPE_FIELDS (TREE_TYPE (x))); @@ -2767,7 +2767,7 @@ static int add_fields_to_record_type (tree fields, struct sorted_fields_type *field_vec, int idx) { tree x; - for (x = fields; x; x = TREE_CHAIN (x)) + for (x = fields; x; x = DECL_CHAIN (x)) { if (TREE_CODE (x) == FIELD_DECL && ANON_AGGR_TYPE_P (TREE_TYPE (x))) idx = add_fields_to_record_type (TYPE_FIELDS (TREE_TYPE (x)), field_vec, idx); @@ -2874,7 +2874,7 @@ check_field_decl (tree field, { tree fields; - for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields)) + for (fields = TYPE_FIELDS (type); fields; fields = DECL_CHAIN (fields)) if (TREE_CODE (fields) == FIELD_DECL && !DECL_C_BIT_FIELD (field)) check_field_decl (fields, t, cant_have_const_ctor, no_const_asn_ref, any_default_members, @@ -2999,12 +2999,12 @@ check_field_decls (tree t, tree *access_decls, tree type = TREE_TYPE (x); int this_field_access; - next = &TREE_CHAIN (x); + next = &DECL_CHAIN (x); if (TREE_CODE (x) == USING_DECL) { /* Prune the access declaration from the list of fields. */ - *field = TREE_CHAIN (x); + *field = DECL_CHAIN (x); /* Save the access declarations for our caller. */ *access_decls = tree_cons (NULL_TREE, x, *access_decls); @@ -3439,7 +3439,7 @@ walk_subobject_offsets (tree type, } /* Iterate through the fields of TYPE. */ - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) if (TREE_CODE (field) == FIELD_DECL && !DECL_ARTIFICIAL (field)) { tree field_offset; @@ -3788,9 +3788,9 @@ build_base_field (record_layout_info rli, tree binfo, objects of the same type at the same address. */ layout_nonempty_base_or_field (rli, decl, binfo, offsets); /* Add the new FIELD_DECL to the list of fields for T. */ - TREE_CHAIN (decl) = *next_field; + DECL_CHAIN (decl) = *next_field; *next_field = decl; - next_field = &TREE_CHAIN (decl); + next_field = &DECL_CHAIN (decl); } } else @@ -3902,7 +3902,7 @@ check_methods (tree t) { tree x; - for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x)) + for (x = TYPE_METHODS (t); x; x = DECL_CHAIN (x)) { check_for_override (x, t); if (DECL_PURE_VIRTUAL_P (x) && ! DECL_VINDEX (x)) @@ -3941,8 +3941,8 @@ build_clone (tree fn, tree name) /* Remember where this function came from. */ DECL_ABSTRACT_ORIGIN (clone) = fn; /* Make it easy to find the CLONE given the FN. */ - TREE_CHAIN (clone) = TREE_CHAIN (fn); - TREE_CHAIN (fn) = clone; + DECL_CHAIN (clone) = DECL_CHAIN (fn); + DECL_CHAIN (fn) = clone; /* If this is a template, do the rest on the DECL_TEMPLATE_RESULT. */ if (TREE_CODE (clone) == TEMPLATE_DECL) @@ -4006,8 +4006,8 @@ build_clone (tree fn, tree name) /* Remove the in-charge parameter. */ if (DECL_HAS_IN_CHARGE_PARM_P (clone)) { - TREE_CHAIN (DECL_ARGUMENTS (clone)) - = TREE_CHAIN (TREE_CHAIN (DECL_ARGUMENTS (clone))); + DECL_CHAIN (DECL_ARGUMENTS (clone)) + = DECL_CHAIN (DECL_CHAIN (DECL_ARGUMENTS (clone))); DECL_HAS_IN_CHARGE_PARM_P (clone) = 0; } /* And the VTT parm, in a complete [cd]tor. */ @@ -4017,13 +4017,13 @@ build_clone (tree fn, tree name) DECL_HAS_VTT_PARM_P (clone) = 1; else { - TREE_CHAIN (DECL_ARGUMENTS (clone)) - = TREE_CHAIN (TREE_CHAIN (DECL_ARGUMENTS (clone))); + DECL_CHAIN (DECL_ARGUMENTS (clone)) + = DECL_CHAIN (DECL_CHAIN (DECL_ARGUMENTS (clone))); DECL_HAS_VTT_PARM_P (clone) = 0; } } - for (parms = DECL_ARGUMENTS (clone); parms; parms = TREE_CHAIN (parms)) + for (parms = DECL_ARGUMENTS (clone); parms; parms = DECL_CHAIN (parms)) { DECL_CONTEXT (parms) = clone; cxx_dup_lang_specific_decl (parms); @@ -4086,8 +4086,8 @@ clone_function_decl (tree fn, int update_method_vec_p) tree clone; /* Avoid inappropriate cloning. */ - if (TREE_CHAIN (fn) - && DECL_CLONED_FUNCTION_P (TREE_CHAIN (fn))) + if (DECL_CHAIN (fn) + && DECL_CLONED_FUNCTION_P (DECL_CHAIN (fn))) return; if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn)) @@ -4144,8 +4144,8 @@ adjust_clone_args (tree decl) { tree clone; - for (clone = TREE_CHAIN (decl); clone && DECL_CLONED_FUNCTION_P (clone); - clone = TREE_CHAIN (clone)) + for (clone = DECL_CHAIN (decl); clone && DECL_CLONED_FUNCTION_P (clone); + clone = DECL_CHAIN (clone)) { tree orig_clone_parms = TYPE_ARG_TYPES (TREE_TYPE (clone)); tree orig_decl_parms = TYPE_ARG_TYPES (TREE_TYPE (decl)); @@ -4416,9 +4416,9 @@ remove_zero_width_bit_fields (tree t) check_bitfield_decl eventually sets DECL_SIZE (*fieldsp) to that width. */ && integer_zerop (DECL_SIZE (*fieldsp))) - *fieldsp = TREE_CHAIN (*fieldsp); + *fieldsp = DECL_CHAIN (*fieldsp); else - fieldsp = &TREE_CHAIN (*fieldsp); + fieldsp = &DECL_CHAIN (*fieldsp); } } @@ -4577,7 +4577,7 @@ check_bases_and_members (tree t) { tree field; - for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field)) { tree type; @@ -4605,7 +4605,7 @@ check_bases_and_members (tree t) /* Check defaulted declarations here so we have cant_have_const_ctor and don't need to worry about clones. */ - for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn)) + for (fn = TYPE_METHODS (t); fn; fn = DECL_CHAIN (fn)) if (DECL_DEFAULTED_IN_CLASS_P (fn)) { int copy = copy_fn_p (fn); @@ -4671,7 +4671,7 @@ create_vtable_ptr (tree t, tree* virtuals_p) tree fn; /* Collect the virtual functions declared in T. */ - for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn)) + for (fn = TYPE_METHODS (t); fn; fn = DECL_CHAIN (fn)) if (DECL_VINDEX (fn) && !DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn) && TREE_CODE (DECL_VINDEX (fn)) != INTEGER_CST) { @@ -4806,7 +4806,7 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets) bases will go after the last extant field to date. */ next_field = &TYPE_FIELDS (t); while (*next_field) - next_field = &TREE_CHAIN (*next_field); + next_field = &DECL_CHAIN (*next_field); /* Go through the virtual bases, allocating space for each virtual base that is not already a primary base class. These are @@ -5047,9 +5047,9 @@ layout_class_type (tree t, tree *virtuals_p) /* The vptr is always the first thing in the class. */ if (vptr) { - TREE_CHAIN (vptr) = TYPE_FIELDS (t); + DECL_CHAIN (vptr) = TYPE_FIELDS (t); TYPE_FIELDS (t) = vptr; - next_field = &TREE_CHAIN (vptr); + next_field = &DECL_CHAIN (vptr); place_field (rli, vptr); } else @@ -5061,7 +5061,7 @@ layout_class_type (tree t, tree *virtuals_p) build_base_fields (rli, empty_base_offsets, next_field); /* Layout the non-static data members. */ - for (field = non_static_data_members; field; field = TREE_CHAIN (field)) + for (field = non_static_data_members; field; field = DECL_CHAIN (field)) { tree type; tree padding; @@ -5342,7 +5342,7 @@ layout_class_type (tree t, tree *virtuals_p) /* Copy the fields from T. */ next_field = &TYPE_FIELDS (base_t); - for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field)) if (TREE_CODE (field) == FIELD_DECL) { *next_field = build_decl (input_location, @@ -5355,7 +5355,7 @@ layout_class_type (tree t, tree *virtuals_p) = DECL_FIELD_BIT_OFFSET (field); DECL_SIZE (*next_field) = DECL_SIZE (field); DECL_MODE (*next_field) = DECL_MODE (field); - next_field = &TREE_CHAIN (*next_field); + next_field = &DECL_CHAIN (*next_field); } /* Record the base version of the type. */ @@ -5402,7 +5402,7 @@ layout_class_type (tree t, tree *virtuals_p) warn_about_ambiguous_bases (t); /* Now that we're done with layout, give the base fields the real types. */ - for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field)) if (DECL_ARTIFICIAL (field) && IS_FAKE_BASE_TYPE (TREE_TYPE (field))) TREE_TYPE (field) = TYPE_CONTEXT (TREE_TYPE (field)); @@ -5434,7 +5434,7 @@ determine_key_method (tree type) key function may not be inline; those targets should not call this function until the end of the translation unit. */ for (method = TYPE_METHODS (type); method != NULL_TREE; - method = TREE_CHAIN (method)) + method = DECL_CHAIN (method)) if (DECL_VINDEX (method) != NULL_TREE && ! DECL_DECLARED_INLINE_P (method) && ! DECL_PURE_VIRTUAL_P (method)) @@ -5558,7 +5558,7 @@ finish_struct_1 (tree t) /* Complete the rtl for any static member objects of the type we're working on. */ - for (x = TYPE_FIELDS (t); x; x = TREE_CHAIN (x)) + for (x = TYPE_FIELDS (t); x; x = DECL_CHAIN (x)) if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x) && TREE_TYPE (x) != error_mark_node && same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (x)), t)) @@ -5655,13 +5655,13 @@ unreverse_member_declarations (tree t) x && TREE_CODE (x) != TYPE_DECL; x = next) { - next = TREE_CHAIN (x); - TREE_CHAIN (x) = prev; + next = DECL_CHAIN (x); + DECL_CHAIN (x) = prev; prev = x; } if (prev) { - TREE_CHAIN (TYPE_FIELDS (t)) = x; + DECL_CHAIN (TYPE_FIELDS (t)) = x; if (prev) TYPE_FIELDS (t) = prev; } @@ -5698,7 +5698,7 @@ finish_struct (tree t, tree attributes) CLASSTYPE_PURE_VIRTUALS contains the list of the inline friends (see CLASSTYPE_INLINE_FRIENDS) so we need to clear it. */ CLASSTYPE_PURE_VIRTUALS (t) = NULL; - for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x)) + for (x = TYPE_METHODS (t); x; x = DECL_CHAIN (x)) if (DECL_PURE_VIRTUAL_P (x)) VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x); complete_vars (t); @@ -6798,7 +6798,7 @@ is_really_empty_class (tree type) BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) if (!is_really_empty_class (BINFO_TYPE (base_binfo))) return false; - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) if (TREE_CODE (field) == FIELD_DECL && !DECL_ARTIFICIAL (field) && !is_really_empty_class (TREE_TYPE (field))) @@ -7251,8 +7251,8 @@ build_vtt (tree t) vtt = build_vtable (t, mangle_vtt_for_type (t), type); initialize_artificial_var (vtt, inits); /* Add the VTT to the vtables list. */ - TREE_CHAIN (vtt) = TREE_CHAIN (CLASSTYPE_VTABLES (t)); - TREE_CHAIN (CLASSTYPE_VTABLES (t)) = vtt; + DECL_CHAIN (vtt) = DECL_CHAIN (CLASSTYPE_VTABLES (t)); + DECL_CHAIN (CLASSTYPE_VTABLES (t)) = vtt; dump_vtt (t, vtt); } @@ -8082,7 +8082,7 @@ add_vcall_offset_vtbl_entries_1 (tree binfo, vtbl_init_data* vid) order. G++ 3.2 used the order in the vtable. */ for (orig_fn = TYPE_METHODS (BINFO_TYPE (binfo)); orig_fn; - orig_fn = TREE_CHAIN (orig_fn)) + orig_fn = DECL_CHAIN (orig_fn)) if (DECL_VINDEX (orig_fn)) add_vcall_offset (orig_fn, binfo, vid); } diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index fa897bf..abd5bf3 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -51,7 +51,7 @@ static tree begin_bc_block (enum bc_t bc) { tree label = create_artificial_label (input_location); - TREE_CHAIN (label) = bc_label[bc]; + DECL_CHAIN (label) = bc_label[bc]; bc_label[bc] = label; return label; } @@ -73,8 +73,8 @@ finish_bc_block (enum bc_t bc, tree label, gimple_seq body) gimple_seq_add_stmt (&body, gimple_build_label (label)); } - bc_label[bc] = TREE_CHAIN (label); - TREE_CHAIN (label) = NULL_TREE; + bc_label[bc] = DECL_CHAIN (label); + DECL_CHAIN (label) = NULL_TREE; return body; } @@ -893,7 +893,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data) IMPORTED_DECL_ASSOCIATED_DECL (using_directive) = TREE_OPERAND (stmt, 0); - TREE_CHAIN (using_directive) = BLOCK_VARS (block); + DECL_CHAIN (using_directive) = BLOCK_VARS (block); BLOCK_VARS (block) = using_directive; } /* The USING_STMT won't appear in GENERIC. */ @@ -921,7 +921,7 @@ cp_genericize (tree fndecl) struct cp_genericize_data wtd; /* Fix up the types of parms passed by invisible reference. */ - for (t = DECL_ARGUMENTS (fndecl); t; t = TREE_CHAIN (t)) + for (t = DECL_ARGUMENTS (fndecl); t; t = DECL_CHAIN (t)) if (TREE_ADDRESSABLE (TREE_TYPE (t))) { /* If a function's arguments are copied to create a thunk, @@ -1178,7 +1178,7 @@ cxx_omp_predetermined_sharing (tree decl) tree var; if (outer) - for (var = BLOCK_VARS (outer); var; var = TREE_CHAIN (var)) + for (var = BLOCK_VARS (outer); var; var = DECL_CHAIN (var)) if (DECL_NAME (decl) == DECL_NAME (var) && (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (var)))) diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 8b076d3..70915cb 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2092,9 +2092,9 @@ struct GTY((variable_size)) lang_decl { if (TREE_CODE (FN) == FUNCTION_DECL \ && (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (FN) \ || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (FN))) \ - for (CLONE = TREE_CHAIN (FN); \ + for (CLONE = DECL_CHAIN (FN); \ CLONE && DECL_CLONED_FUNCTION_P (CLONE); \ - CLONE = TREE_CHAIN (CLONE)) + CLONE = DECL_CHAIN (CLONE)) /* Nonzero if NODE has DECL_DISCRIMINATOR and not DECL_ACCESS. */ #define DECL_DISCRIMINATOR_P(NODE) \ diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1491720..0a9f255 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -393,7 +393,7 @@ pop_labels_1 (void **slot, void *data) /* Put the labels into the "variables" of the top-level block, so debugger can see them. */ - TREE_CHAIN (ent->label_decl) = BLOCK_VARS (block); + DECL_CHAIN (ent->label_decl) = BLOCK_VARS (block); BLOCK_VARS (block) = ent->label_decl; htab_clear_slot (named_labels, slot); @@ -474,7 +474,7 @@ poplevel_named_label_1 (void **slot, void *data) { tree decl; - for (decl = ent->names_in_scope; decl; decl = TREE_CHAIN (decl)) + for (decl = ent->names_in_scope; decl; decl = DECL_CHAIN (decl)) if (decl_jump_unsafe (decl)) VEC_safe_push (tree, gc, ent->bad_decls, decl); @@ -749,7 +749,7 @@ poplevel (int keep, int reverse, int functionbody) if (TREE_CODE (*d) == TREE_LIST) *d = TREE_CHAIN (*d); else - d = &TREE_CHAIN (*d); + d = &DECL_CHAIN (*d); } } @@ -822,7 +822,7 @@ walk_namespaces_r (tree name_space, walk_namespaces_fn f, void* data) result |= (*f) (name_space, data); - for (; current; current = TREE_CHAIN (current)) + for (; current; current = DECL_CHAIN (current)) result |= walk_namespaces_r (current, f, data); return result; @@ -1726,7 +1726,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) DECL_ARGUMENTS (old_result) = DECL_ARGUMENTS (new_result); for (parm = DECL_ARGUMENTS (old_result); parm; - parm = TREE_CHAIN (parm)) + parm = DECL_CHAIN (parm)) DECL_CONTEXT (parm) = old_result; } } @@ -1976,7 +1976,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) for (oldarg = DECL_ARGUMENTS(olddecl), newarg = DECL_ARGUMENTS(newdecl); oldarg && newarg; - oldarg = TREE_CHAIN(oldarg), newarg = TREE_CHAIN(newarg)) { + oldarg = DECL_CHAIN(oldarg), newarg = DECL_CHAIN(newarg)) { DECL_ATTRIBUTES (newarg) = (*targetm.merge_decl_attributes) (oldarg, newarg); DECL_ATTRIBUTES (oldarg) = DECL_ATTRIBUTES (newarg); @@ -2040,7 +2040,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) /* Update newdecl's parms to point at olddecl. */ for (parm = DECL_ARGUMENTS (newdecl); parm; - parm = TREE_CHAIN (parm)) + parm = DECL_CHAIN (parm)) DECL_CONTEXT (parm) = olddecl; if (! types_match) @@ -2586,7 +2586,7 @@ check_previous_goto_1 (tree decl, struct cp_binding_level* level, tree names, tree new_decls, old_decls = (b == level ? names : NULL_TREE); for (new_decls = b->names; new_decls != old_decls; - new_decls = TREE_CHAIN (new_decls)) + new_decls = DECL_CHAIN (new_decls)) { int problem = decl_jump_unsafe (new_decls); if (! problem) @@ -3885,7 +3885,7 @@ fixup_anonymous_aggr (tree t) if (DECL_ARTIFICIAL (*q)) *q = TREE_CHAIN (*q); else - q = &TREE_CHAIN (*q); + q = &DECL_CHAIN (*q); } /* ISO C++ 9.5.3. Anonymous unions may not have function members. */ @@ -3909,7 +3909,7 @@ fixup_anonymous_aggr (tree t) { tree field, type; - for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field)) if (TREE_CODE (field) == FIELD_DECL) { type = TREE_TYPE (field); @@ -4811,7 +4811,7 @@ next_initializable_field (tree field) && (TREE_CODE (field) != FIELD_DECL || (DECL_C_BIT_FIELD (field) && !DECL_NAME (field)) || DECL_ARTIFICIAL (field))) - field = TREE_CHAIN (field); + field = DECL_CHAIN (field); return field; } @@ -4981,7 +4981,7 @@ reshape_init_class (tree type, reshape_iter *d, bool first_initializer_p) if (TREE_CODE (type) == UNION_TYPE) break; - field = next_initializable_field (TREE_CHAIN (field)); + field = next_initializable_field (DECL_CHAIN (field)); } return new_init; @@ -6776,11 +6776,11 @@ grokfndecl (tree ctype, { tree parm; parm = build_this_parm (type, quals); - TREE_CHAIN (parm) = parms; + DECL_CHAIN (parm) = parms; parms = parm; } DECL_ARGUMENTS (decl) = parms; - for (t = parms; t; t = TREE_CHAIN (t)) + for (t = parms; t; t = DECL_CHAIN (t)) DECL_CONTEXT (t) = decl; /* Propagate volatile out from type to decl. */ if (TYPE_VOLATILE (type)) @@ -7280,7 +7280,7 @@ build_ptrmemfunc_type (tree type) field = build_decl (input_location, FIELD_DECL, delta_identifier, delta_type_node); - TREE_CHAIN (field) = fields; + DECL_CHAIN (field) = fields; fields = field; finish_builtin_struct (t, "__ptrmemfunc_type", fields, ptr_type_node); @@ -9204,7 +9204,7 @@ grokdeclarator (const cp_declarator *declarator, { tree decl = cp_build_parm_decl (NULL_TREE, TREE_VALUE (args)); - TREE_CHAIN (decl) = decls; + DECL_CHAIN (decl) = decls; decls = decl; } @@ -9836,7 +9836,7 @@ grokdeclarator (const cp_declarator *declarator, static void require_complete_types_for_parms (tree parms) { - for (; parms; parms = TREE_CHAIN (parms)) + for (; parms; parms = DECL_CHAIN (parms)) { if (dependent_type_p (TREE_TYPE (parms))) continue; @@ -10106,7 +10106,7 @@ grokparms (tree parmlist, tree *parms) && TREE_CHAIN (parm) != void_list_node) error ("parameter packs must be at the end of the parameter list"); - TREE_CHAIN (decl) = decls; + DECL_CHAIN (decl) = decls; decls = decl; result = tree_cons (init, type, result); } @@ -12111,11 +12111,11 @@ start_preparsed_function (tree decl1, tree attrs, int flags) /* Constructors and destructors need to know whether they're "in charge" of initializing virtual base classes. */ - t = TREE_CHAIN (t); + t = DECL_CHAIN (t); if (DECL_HAS_IN_CHARGE_PARM_P (decl1)) { current_in_charge_parm = t; - t = TREE_CHAIN (t); + t = DECL_CHAIN (t); } if (DECL_HAS_VTT_PARM_P (decl1)) { @@ -12326,7 +12326,7 @@ store_parm_decls (tree current_function_parms) for (parm = specparms; parm; parm = next) { - next = TREE_CHAIN (parm); + next = DECL_CHAIN (parm); if (TREE_CODE (parm) == PARM_DECL) { if (DECL_NAME (parm) == NULL_TREE @@ -12762,7 +12762,7 @@ finish_function (int flags) for (decl = DECL_ARGUMENTS (fndecl); decl; - decl = TREE_CHAIN (decl)) + decl = DECL_CHAIN (decl)) if (TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL && !DECL_READ_P (decl) @@ -12905,7 +12905,7 @@ grokmethod (cp_decl_specifier_seq *declspecs, if (! DECL_FRIEND_P (fndecl)) { - if (TREE_CHAIN (fndecl)) + if (DECL_CHAIN (fndecl)) { fndecl = copy_node (fndecl); TREE_CHAIN (fndecl) = NULL_TREE; @@ -13101,7 +13101,7 @@ revert_static_member_fn (tree decl) error ("static member function %q#D declared with type qualifiers", decl); if (DECL_ARGUMENTS (decl)) - DECL_ARGUMENTS (decl) = TREE_CHAIN (DECL_ARGUMENTS (decl)); + DECL_ARGUMENTS (decl) = DECL_CHAIN (DECL_ARGUMENTS (decl)); DECL_STATIC_FUNCTION_P (decl) = 1; } diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index ce54c79..a768877 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -242,7 +242,7 @@ maybe_retrofit_in_chrg (tree fn) basetype = TREE_TYPE (TREE_VALUE (arg_types)); arg_types = TREE_CHAIN (arg_types); - parms = TREE_CHAIN (DECL_ARGUMENTS (fn)); + parms = DECL_CHAIN (DECL_ARGUMENTS (fn)); /* If this is a subobject constructor or destructor, our caller will pass us a pointer to our VTT. */ @@ -251,7 +251,7 @@ maybe_retrofit_in_chrg (tree fn) parm = build_artificial_parm (vtt_parm_identifier, vtt_parm_type); /* First add it to DECL_ARGUMENTS between 'this' and the real args... */ - TREE_CHAIN (parm) = parms; + DECL_CHAIN (parm) = parms; parms = parm; /* ...and then to TYPE_ARG_TYPES. */ @@ -262,12 +262,12 @@ maybe_retrofit_in_chrg (tree fn) /* Then add the in-charge parm (before the VTT parm). */ parm = build_artificial_parm (in_charge_identifier, integer_type_node); - TREE_CHAIN (parm) = parms; + DECL_CHAIN (parm) = parms; parms = parm; arg_types = hash_tree_chain (integer_type_node, arg_types); /* Insert our new parameter(s) into the list. */ - TREE_CHAIN (DECL_ARGUMENTS (fn)) = parms; + DECL_CHAIN (DECL_ARGUMENTS (fn)) = parms; /* And rebuild the function type. */ fntype = build_method_type_directly (basetype, TREE_TYPE (TREE_TYPE (fn)), @@ -1321,7 +1321,7 @@ build_anon_union_vars (tree type, tree object) for (field = TYPE_FIELDS (type); field != NULL_TREE; - field = TREE_CHAIN (field)) + field = DECL_CHAIN (field)) { tree decl; tree ref; @@ -1826,7 +1826,7 @@ maybe_emit_vtables (tree ctype) determine_key_method (ctype); /* See if any of the vtables are needed. */ - for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = TREE_CHAIN (vtbl)) + for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = DECL_CHAIN (vtbl)) { import_export_decl (vtbl); if (DECL_NOT_REALLY_EXTERN (vtbl) && decl_needed_p (vtbl)) @@ -1845,7 +1845,7 @@ maybe_emit_vtables (tree ctype) /* The ABI requires that we emit all of the vtables if we emit any of them. */ - for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = TREE_CHAIN (vtbl)) + for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = DECL_CHAIN (vtbl)) { /* Mark entities references from the virtual table as used. */ mark_vtable_entries (vtbl); @@ -2242,7 +2242,7 @@ constrain_class_visibility (tree type) if (CLASSTYPE_VISIBILITY_SPECIFIED (type)) vis = VISIBILITY_INTERNAL; - for (t = TYPE_FIELDS (type); t; t = TREE_CHAIN (t)) + for (t = TYPE_FIELDS (type); t; t = DECL_CHAIN (t)) if (TREE_CODE (t) == FIELD_DECL && TREE_TYPE (t) != error_mark_node) { tree ftype = strip_pointer_or_array_types (TREE_TYPE (t)); @@ -2868,7 +2868,7 @@ start_static_storage_duration_function (unsigned count) DECL_CONTEXT (priority_decl) = ssdf_decl; TREE_USED (priority_decl) = 1; - TREE_CHAIN (initialize_p_decl) = priority_decl; + DECL_CHAIN (initialize_p_decl) = priority_decl; DECL_ARGUMENTS (ssdf_decl) = initialize_p_decl; /* Put the function in the global scope. */ @@ -2966,7 +2966,7 @@ fix_temporary_vars_context_r (tree *node, { tree var; - for (var = BIND_EXPR_VARS (*node); var; var = TREE_CHAIN (var)) + for (var = BIND_EXPR_VARS (*node); var; var = DECL_CHAIN (var)) if (TREE_CODE (var) == VAR_DECL && !DECL_NAME (var) && DECL_ARTIFICIAL (var) diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 98a45cd..507da92 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -184,7 +184,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p) VEC(constructor_elt,gc) *v = NULL; /* Iterate over the fields, building initializations. */ - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) { if (TREE_CODE (field) != FIELD_DECL) continue; @@ -337,7 +337,7 @@ build_value_init_noctor (tree type) VEC(constructor_elt,gc) *v = NULL; /* Iterate over the fields, building initializations. */ - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) { tree ftype, value; @@ -562,7 +562,7 @@ build_field_list (tree t, tree list, int *uses_unions_p) if (TREE_CODE (t) == UNION_TYPE) *uses_unions_p = 1; - for (fields = TYPE_FIELDS (t); fields; fields = TREE_CHAIN (fields)) + for (fields = TYPE_FIELDS (t); fields; fields = DECL_CHAIN (fields)) { tree fieldtype; @@ -1030,7 +1030,7 @@ construct_virtual_base (tree vbase, tree arguments) in the outer block.) We trust the back end to figure out that the FLAG will not change across initializations, and avoid doing multiple tests. */ - flag = TREE_CHAIN (DECL_ARGUMENTS (current_function_decl)); + flag = DECL_CHAIN (DECL_ARGUMENTS (current_function_decl)); inner_if_stmt = begin_if_stmt (); finish_if_stmt_cond (flag, inner_if_stmt); @@ -1815,7 +1815,7 @@ diagnose_uninitialized_cst_or_ref_member_1 (tree type, tree origin, if (type_has_user_provided_constructor (type)) return 0; - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) { tree field_type; @@ -2578,7 +2578,7 @@ build_java_class_ref (tree type) /* Mangle the class$ field. */ { tree field; - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) if (DECL_NAME (field) == CL_suffix) { mangle_decl (field); @@ -3383,7 +3383,7 @@ push_base_cleanups (void) return; for (member = TYPE_FIELDS (current_class_type); member; - member = TREE_CHAIN (member)) + member = DECL_CHAIN (member)) { tree this_type = TREE_TYPE (member); if (this_type == error_mark_node diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 9390a92..a47dfa8 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1289,7 +1289,7 @@ nested_anon_class_index (tree type) { int index = 0; tree member = TYPE_FIELDS (TYPE_CONTEXT (type)); - for (; member; member = TREE_CHAIN (member)) + for (; member; member = DECL_CHAIN (member)) if (DECL_IMPLICIT_TYPEDEF_P (member)) { tree memtype = TREE_TYPE (member); @@ -1719,7 +1719,7 @@ write_local_name (tree function, const tree local_entity, { tree t; int i = 0; - for (t = DECL_ARGUMENTS (function); t; t = TREE_CHAIN (t)) + for (t = DECL_ARGUMENTS (function); t; t = DECL_CHAIN (t)) { if (t == parm) i = 1; @@ -2303,12 +2303,12 @@ write_method_parms (tree parm_types, const int method_p, const tree decl) if (method_p) { parm_types = TREE_CHAIN (parm_types); - parm_decl = parm_decl ? TREE_CHAIN (parm_decl) : NULL_TREE; + parm_decl = parm_decl ? DECL_CHAIN (parm_decl) : NULL_TREE; while (parm_decl && DECL_ARTIFICIAL (parm_decl)) { parm_types = TREE_CHAIN (parm_types); - parm_decl = TREE_CHAIN (parm_decl); + parm_decl = DECL_CHAIN (parm_decl); } } diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 9876af2..b9511f5 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -103,7 +103,7 @@ make_thunk (tree function, bool this_adjusting, /* See if we already have the thunk in question. For this_adjusting thunks VIRTUAL_OFFSET will be an INTEGER_CST, for covariant thunks it will be a BINFO. */ - for (thunk = DECL_THUNKS (function); thunk; thunk = TREE_CHAIN (thunk)) + for (thunk = DECL_THUNKS (function); thunk; thunk = DECL_CHAIN (thunk)) if (DECL_THIS_THUNK_P (thunk) == this_adjusting && THUNK_FIXED_OFFSET (thunk) == d && !virtual_offset == !THUNK_VIRTUAL_OFFSET (thunk) @@ -156,7 +156,7 @@ make_thunk (tree function, bool this_adjusting, DECL_TEMPLATE_INFO (thunk) = NULL; /* Add it to the list of thunks associated with FUNCTION. */ - TREE_CHAIN (thunk) = DECL_THUNKS (function); + DECL_CHAIN (thunk) = DECL_THUNKS (function); DECL_THUNKS (function) = thunk; return thunk; @@ -188,7 +188,7 @@ finish_thunk (tree thunk) tree cov_probe; for (cov_probe = DECL_THUNKS (function); - cov_probe; cov_probe = TREE_CHAIN (cov_probe)) + cov_probe; cov_probe = DECL_CHAIN (cov_probe)) if (DECL_NAME (cov_probe) == name) { gcc_assert (!DECL_THUNKS (thunk)); @@ -364,10 +364,10 @@ use_thunk (tree thunk_fndecl, bool emit_p) /* Set up cloned argument trees for the thunk. */ t = NULL_TREE; - for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a)) + for (a = DECL_ARGUMENTS (function); a; a = DECL_CHAIN (a)) { tree x = copy_node (a); - TREE_CHAIN (x) = t; + DECL_CHAIN (x) = t; DECL_CONTEXT (x) = thunk_fndecl; SET_DECL_RTL (x, NULL); DECL_HAS_VALUE_EXPR_P (x) = 0; @@ -529,7 +529,7 @@ do_build_copy_constructor (tree fndecl) member_init_list); } - for (; fields; fields = TREE_CHAIN (fields)) + for (; fields; fields = DECL_CHAIN (fields)) { tree field = fields; tree expr_type; @@ -579,7 +579,7 @@ do_build_copy_constructor (tree fndecl) static void do_build_copy_assign (tree fndecl) { - tree parm = TREE_CHAIN (DECL_ARGUMENTS (fndecl)); + tree parm = DECL_CHAIN (DECL_ARGUMENTS (fndecl)); tree compound_stmt; bool move_p = move_fn_p (fndecl); bool trivial = trivial_fn_p (fndecl); @@ -630,7 +630,7 @@ do_build_copy_assign (tree fndecl) /* Assign to each of the non-static data members. */ for (fields = TYPE_FIELDS (current_class_type); fields; - fields = TREE_CHAIN (fields)) + fields = DECL_CHAIN (fields)) { tree comp = current_class_ref; tree init = parm; @@ -953,7 +953,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk, int flags, tsubst_flags_t complain) { tree field; - for (field = fields; field; field = TREE_CHAIN (field)) + for (field = fields; field; field = DECL_CHAIN (field)) { tree mem_type, argtype, rval; @@ -1432,7 +1432,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p) } /* Add the "this" parameter. */ this_parm = build_this_parm (fn_type, TYPE_UNQUALIFIED); - TREE_CHAIN (this_parm) = DECL_ARGUMENTS (fn); + DECL_CHAIN (this_parm) = DECL_ARGUMENTS (fn); DECL_ARGUMENTS (fn) = this_parm; grokclassfn (type, fn, kind == sfk_destructor ? DTOR_FLAG : NO_SPECIAL); @@ -1625,7 +1625,7 @@ lazily_declare_fn (special_function_kind sfk, tree type) "and may change in a future version of GCC due to " "implicit virtual destructor", type); - TREE_CHAIN (fn) = TYPE_METHODS (type); + DECL_CHAIN (fn) = TYPE_METHODS (type); TYPE_METHODS (type) = fn; } maybe_add_class_template_decl_list (type, fn, /*friend_p=*/0); diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 153bdfd..c6e31c29 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -542,7 +542,7 @@ add_decl_to_level (tree decl, cxx_scope *b) if (TREE_CODE (decl) == NAMESPACE_DECL && !DECL_NAMESPACE_ALIAS (decl)) { - TREE_CHAIN (decl) = b->namespaces; + DECL_CHAIN (decl) = b->namespaces; b->namespaces = decl; } else @@ -1993,7 +1993,7 @@ push_using_decl (tree scope, tree name) timevar_push (TV_NAME_LOOKUP); gcc_assert (TREE_CODE (scope) == NAMESPACE_DECL); gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); - for (decl = current_binding_level->usings; decl; decl = TREE_CHAIN (decl)) + for (decl = current_binding_level->usings; decl; decl = DECL_CHAIN (decl)) if (USING_DECL_SCOPE (decl) == scope && DECL_NAME (decl) == name) break; if (decl) @@ -2001,7 +2001,7 @@ push_using_decl (tree scope, tree name) namespace_bindings_p () ? decl : NULL_TREE); decl = build_lang_decl (USING_DECL, name, NULL_TREE); USING_DECL_SCOPE (decl) = scope; - TREE_CHAIN (decl) = current_binding_level->usings; + DECL_CHAIN (decl) = current_binding_level->usings; current_binding_level->usings = decl; POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl); } @@ -2157,7 +2157,7 @@ push_overloaded_decl (tree decl, int flags, bool is_friend) for (d = &IDENTIFIER_BINDING (name)->scope->names; *d; - d = &TREE_CHAIN (*d)) + d = &DECL_CHAIN (*d)) if (*d == old || (TREE_CODE (*d) == TREE_LIST && TREE_VALUE (*d) == old)) @@ -2168,7 +2168,7 @@ push_overloaded_decl (tree decl, int flags, bool is_friend) else /* Build a TREE_LIST to wrap the OVERLOAD. */ *d = tree_cons (NULL_TREE, new_binding, - TREE_CHAIN (*d)); + DECL_CHAIN (*d)); /* And update the cxx_binding node. */ IDENTIFIER_BINDING (name)->value = new_binding; @@ -2726,7 +2726,7 @@ pushdecl_class_level (tree x) aggregate, for naming purposes. */ tree f; - for (f = TYPE_FIELDS (TREE_TYPE (x)); f; f = TREE_CHAIN (f)) + for (f = TYPE_FIELDS (TREE_TYPE (x)); f; f = DECL_CHAIN (f)) { location_t save_location = input_location; input_location = DECL_SOURCE_LOCATION (f); diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 7ec2034..302a133 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -282,16 +282,16 @@ maybe_clone_body (tree fn) clone_parm = DECL_ARGUMENTS (clone); /* Update the `this' parameter, which is always first. */ update_cloned_parm (parm, clone_parm, first); - parm = TREE_CHAIN (parm); - clone_parm = TREE_CHAIN (clone_parm); + parm = DECL_CHAIN (parm); + clone_parm = DECL_CHAIN (clone_parm); if (DECL_HAS_IN_CHARGE_PARM_P (fn)) - parm = TREE_CHAIN (parm); + parm = DECL_CHAIN (parm); if (DECL_HAS_VTT_PARM_P (fn)) - parm = TREE_CHAIN (parm); + parm = DECL_CHAIN (parm); if (DECL_HAS_VTT_PARM_P (clone)) - clone_parm = TREE_CHAIN (clone_parm); + clone_parm = DECL_CHAIN (clone_parm); for (; parm; - parm = TREE_CHAIN (parm), clone_parm = TREE_CHAIN (clone_parm)) + parm = DECL_CHAIN (parm), clone_parm = DECL_CHAIN (clone_parm)) /* Update this parameter. */ update_cloned_parm (parm, clone_parm, first); @@ -348,7 +348,7 @@ maybe_clone_body (tree fn) clone_parm = DECL_ARGUMENTS (clone); parm; ++parmno, - parm = TREE_CHAIN (parm)) + parm = DECL_CHAIN (parm)) { /* Map the in-charge parameter to an appropriate constant. */ if (DECL_HAS_IN_CHARGE_PARM_P (fn) && parmno == 1) @@ -367,7 +367,7 @@ maybe_clone_body (tree fn) { DECL_ABSTRACT_ORIGIN (clone_parm) = parm; *pointer_map_insert (decl_map, parm) = clone_parm; - clone_parm = TREE_CHAIN (clone_parm); + clone_parm = DECL_CHAIN (clone_parm); } /* Otherwise, map the VTT parameter to `NULL'. */ else @@ -379,7 +379,7 @@ maybe_clone_body (tree fn) else { *pointer_map_insert (decl_map, parm) = clone_parm; - clone_parm = TREE_CHAIN (clone_parm); + clone_parm = DECL_CHAIN (clone_parm); } } diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index b35d9a5..19a158f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -2650,7 +2650,7 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, base_type = CLASSTYPE_PRIMARY_TEMPLATE_TYPE (base_type); for (field = TYPE_FIELDS (base_type); field; - field = TREE_CHAIN (field)) + field = DECL_CHAIN (field)) if (TREE_CODE (field) == TYPE_DECL && DECL_NAME (field) == id) { @@ -7706,7 +7706,7 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr) /* The function parameters must be in scope all the way until after the trailing-return-type in case of decltype. */ - for (t = current_binding_level->names; t; t = TREE_CHAIN (t)) + for (t = current_binding_level->names; t; t = DECL_CHAIN (t)) pop_binding (DECL_NAME (t), t); leave_scope (); @@ -14378,7 +14378,7 @@ cp_parser_direct_declarator (cp_parser* parser, } /* Remove the function parms from scope. */ - for (t = current_binding_level->names; t; t = TREE_CHAIN (t)) + for (t = current_binding_level->names; t; t = DECL_CHAIN (t)) pop_binding (DECL_NAME (t), t); leave_scope(); @@ -19676,7 +19676,7 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn) parmdecl = DECL_ARGUMENTS (fn); parm && parm != void_list_node; parm = TREE_CHAIN (parm), - parmdecl = TREE_CHAIN (parmdecl)) + parmdecl = DECL_CHAIN (parmdecl)) { cp_token_cache *tokens; tree default_arg = TREE_PURPOSE (parm); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 80cf7d2..ef6e8e9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2553,7 +2553,7 @@ check_explicit_specialization (tree declarator, definition, not in the original declaration. */ DECL_ARGUMENTS (result) = DECL_ARGUMENTS (decl); for (parm = DECL_ARGUMENTS (result); parm; - parm = TREE_CHAIN (parm)) + parm = DECL_CHAIN (parm)) DECL_CONTEXT (parm) = result; } return register_specialization (tmpl, gen_tmpl, targs, @@ -4417,7 +4417,7 @@ push_template_decl_real (tree decl, bool is_friend) TREE_VALUE (argtype) = error_mark_node; } - arg = TREE_CHAIN (arg); + arg = DECL_CHAIN (arg); argtype = TREE_CHAIN (argtype); } @@ -8196,7 +8196,7 @@ instantiate_class_template (tree type) any member functions. We don't do this earlier because the default arguments may reference members of the class. */ if (!PRIMARY_TEMPLATE_P (templ)) - for (t = TYPE_METHODS (type); t; t = TREE_CHAIN (t)) + for (t = TYPE_METHODS (type); t; t = DECL_CHAIN (t)) if (TREE_CODE (t) == FUNCTION_DECL /* Implicitly generated member functions will not have template information; they are not instantiations, but instead are @@ -8261,7 +8261,7 @@ make_fnparm_pack (tree spec_parm) /* Fill in PARMVEC and PARMTYPEVEC with all of the parameters. */ parmvec = make_tree_vec (len); parmtypevec = make_tree_vec (len); - for (i = 0; i < len; i++, spec_parm = TREE_CHAIN (spec_parm)) + for (i = 0; i < len; i++, spec_parm = DECL_CHAIN (spec_parm)) { TREE_VEC_ELT (parmvec, i) = spec_parm; TREE_VEC_ELT (parmtypevec, i) = TREE_TYPE (spec_parm); @@ -8541,7 +8541,7 @@ get_pattern_parm (tree parm, tree tmpl) if (DECL_ARTIFICIAL (parm)) { for (patparm = DECL_ARGUMENTS (pattern); - patparm; patparm = TREE_CHAIN (patparm)) + patparm; patparm = DECL_CHAIN (patparm)) if (DECL_ARTIFICIAL (patparm) && DECL_NAME (parm) == DECL_NAME (patparm)) break; @@ -8936,7 +8936,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) RETURN (error_mark_node); r = copy_decl (t); - TREE_CHAIN (r) = NULL_TREE; + DECL_CHAIN (r) = NULL_TREE; TREE_TYPE (r) = new_type; DECL_TEMPLATE_RESULT (r) = build_decl (DECL_SOURCE_LOCATION (decl), @@ -8986,7 +8986,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) than the old one. */ r = copy_decl (t); gcc_assert (DECL_LANG_SPECIFIC (r) != 0); - TREE_CHAIN (r) = NULL_TREE; + DECL_CHAIN (r) = NULL_TREE; DECL_TEMPLATE_INFO (r) = build_template_info (t, args); @@ -9196,7 +9196,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) assigned to the instantiation. */ DECL_INTERFACE_KNOWN (r) = !TREE_PUBLIC (r); DECL_DEFER_OUTPUT (r) = 0; - TREE_CHAIN (r) = NULL_TREE; + DECL_CHAIN (r) = NULL_TREE; DECL_PENDING_INLINE_INFO (r) = 0; DECL_PENDING_INLINE_P (r) = 0; DECL_SAVED_TREE (r) = NULL_TREE; @@ -9395,12 +9395,12 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) /* Build a proper chain of parameters when substituting into a function parameter pack. */ if (prev_r) - TREE_CHAIN (prev_r) = r; + DECL_CHAIN (prev_r) = r; } - if (TREE_CHAIN (t)) - TREE_CHAIN (r) = tsubst (TREE_CHAIN (t), args, - complain, TREE_CHAIN (t)); + if (DECL_CHAIN (t)) + DECL_CHAIN (r) = tsubst (DECL_CHAIN (t), args, + complain, DECL_CHAIN (t)); /* FIRST_R contains the start of the chain we've built. */ r = first_r; @@ -9425,7 +9425,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) /*integral_constant_expression_p=*/true); /* We don't have to set DECL_CONTEXT here; it is set by finish_member_declaration. */ - TREE_CHAIN (r) = NULL_TREE; + DECL_CHAIN (r) = NULL_TREE; if (VOID_TYPE_P (type)) error ("instantiation of %q+D as type %qT", r, type); @@ -9452,7 +9452,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) else { r = copy_node (t); - TREE_CHAIN (r) = NULL_TREE; + DECL_CHAIN (r) = NULL_TREE; } break; @@ -9652,7 +9652,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) else register_local_specialization (r, t); - TREE_CHAIN (r) = NULL_TREE; + DECL_CHAIN (r) = NULL_TREE; apply_late_template_attributes (&r, DECL_ATTRIBUTES (r), /*flags=*/0, @@ -13123,7 +13123,7 @@ instantiate_template (tree tmpl, tree orig_args, tsubst_flags_t complain) instantiate all the alternate entry points as well. We do this by cloning the instantiation of the main entry point, not by instantiating the template clones. */ - if (TREE_CHAIN (gen_tmpl) && DECL_CLONED_FUNCTION_P (TREE_CHAIN (gen_tmpl))) + if (DECL_CHAIN (gen_tmpl) && DECL_CLONED_FUNCTION_P (DECL_CHAIN (gen_tmpl))) clone_function_decl (fndecl, /*update_method_vec_p=*/0); return fndecl; @@ -16392,12 +16392,12 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) interpretation is that it should be an explicit instantiation. */ if (! static_p) - for (tmp = TYPE_METHODS (t); tmp; tmp = TREE_CHAIN (tmp)) + for (tmp = TYPE_METHODS (t); tmp; tmp = DECL_CHAIN (tmp)) if (TREE_CODE (tmp) == FUNCTION_DECL && DECL_TEMPLATE_INSTANTIATION (tmp)) instantiate_class_member (tmp, extern_p); - for (tmp = TYPE_FIELDS (t); tmp; tmp = TREE_CHAIN (tmp)) + for (tmp = TYPE_FIELDS (t); tmp; tmp = DECL_CHAIN (tmp)) if (TREE_CODE (tmp) == VAR_DECL && DECL_TEMPLATE_INSTANTIATION (tmp)) instantiate_class_member (tmp, extern_p); @@ -16485,8 +16485,8 @@ regenerate_decl_from_template (tree decl, tree tmpl) DECL_ATTRIBUTES (decl_parm) = attributes; cplus_decl_attributes (&decl_parm, attributes, /*flags=*/0); } - decl_parm = TREE_CHAIN (decl_parm); - pattern_parm = TREE_CHAIN (pattern_parm); + decl_parm = DECL_CHAIN (decl_parm); + pattern_parm = DECL_CHAIN (pattern_parm); } /* Merge any parameters that match with the function parameter pack. */ @@ -16518,7 +16518,7 @@ regenerate_decl_from_template (tree decl, tree tmpl) DECL_ATTRIBUTES (decl_parm) = attributes; cplus_decl_attributes (&decl_parm, attributes, /*flags=*/0); } - decl_parm = TREE_CHAIN (decl_parm); + decl_parm = DECL_CHAIN (decl_parm); } } /* Merge additional specifiers from the CODE_PATTERN. */ @@ -16928,8 +16928,8 @@ instantiate_decl (tree d, int defer_ok, while (tmpl_parm && !FUNCTION_PARAMETER_PACK_P (tmpl_parm)) { register_local_specialization (spec_parm, tmpl_parm); - tmpl_parm = TREE_CHAIN (tmpl_parm); - spec_parm = TREE_CHAIN (spec_parm); + tmpl_parm = DECL_CHAIN (tmpl_parm); + spec_parm = DECL_CHAIN (spec_parm); } if (tmpl_parm && FUNCTION_PARAMETER_PACK_P (tmpl_parm)) { @@ -16937,7 +16937,7 @@ instantiate_decl (tree d, int defer_ok, TMPL_PARM, then move on. */ tree argpack = make_fnparm_pack (spec_parm); register_local_specialization (argpack, tmpl_parm); - tmpl_parm = TREE_CHAIN (tmpl_parm); + tmpl_parm = DECL_CHAIN (tmpl_parm); spec_parm = NULL_TREE; } gcc_assert (!spec_parm); diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index dde8e82..c994683 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -1210,7 +1210,7 @@ create_pseudo_type_info (int tk, const char *real_name, ...) /* Now add the derived fields. */ while ((field_decl = va_arg (ap, tree))) { - TREE_CHAIN (field_decl) = fields; + DECL_CHAIN (field_decl) = fields; fields = field_decl; } @@ -1375,7 +1375,7 @@ create_tinfo_types (void) field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE, const_string_type_node); - TREE_CHAIN (field) = fields; + DECL_CHAIN (field) = fields; fields = field; ti = VEC_index (tinfo_s, tinfo_descs, TK_TYPE_INFO_TYPE); @@ -1415,7 +1415,7 @@ create_tinfo_types (void) field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE, integer_types[itk_long]); - TREE_CHAIN (field) = fields; + DECL_CHAIN (field) = fields; fields = field; ti = VEC_index (tinfo_s, tinfo_descs, TK_BASE_TYPE); diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 9dbefd3..0249fb0 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -170,7 +170,7 @@ accessible_base_p (tree t, tree base, bool consider_local_p) public typedef created in the scope of every class. */ decl = TYPE_FIELDS (base); while (!DECL_SELF_REFERENCE_P (decl)) - decl = TREE_CHAIN (decl); + decl = DECL_CHAIN (decl); while (ANON_AGGR_TYPE_P (t)) t = TYPE_CONTEXT (t); return accessible_p (t, decl, consider_local_p); @@ -447,7 +447,7 @@ lookup_field_1 (tree type, tree name, bool want_type) #ifdef GATHER_STATISTICS n_calls_lookup_field_1++; #endif /* GATHER_STATISTICS */ - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) { #ifdef GATHER_STATISTICS n_fields_searched++; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 887bb42..a39e0b8 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2418,7 +2418,7 @@ finish_member_declaration (tree decl) return; /* We should see only one DECL at a time. */ - gcc_assert (TREE_CHAIN (decl) == NULL_TREE); + gcc_assert (DECL_CHAIN (decl) == NULL_TREE); /* Set up access control for DECL. */ TREE_PRIVATE (decl) @@ -2460,7 +2460,7 @@ finish_member_declaration (tree decl) CLASSTYPE_METHOD_VEC. */ if (add_method (current_class_type, decl, NULL_TREE)) { - TREE_CHAIN (decl) = TYPE_METHODS (current_class_type); + DECL_CHAIN (decl) = TYPE_METHODS (current_class_type); TYPE_METHODS (current_class_type) = decl; maybe_add_class_template_decl_list (current_class_type, decl, @@ -2493,7 +2493,7 @@ finish_member_declaration (tree decl) = chainon (TYPE_FIELDS (current_class_type), decl); else { - TREE_CHAIN (decl) = TYPE_FIELDS (current_class_type); + DECL_CHAIN (decl) = TYPE_FIELDS (current_class_type); TYPE_FIELDS (current_class_type) = decl; } @@ -3319,7 +3319,7 @@ emit_associated_thunks (tree fn) { tree thunk; - for (thunk = DECL_THUNKS (fn); thunk; thunk = TREE_CHAIN (thunk)) + for (thunk = DECL_THUNKS (fn); thunk; thunk = DECL_CHAIN (thunk)) { if (!THUNK_ALIAS (thunk)) { @@ -3329,7 +3329,7 @@ emit_associated_thunks (tree fn) tree probe; for (probe = DECL_THUNKS (thunk); - probe; probe = TREE_CHAIN (probe)) + probe; probe = DECL_CHAIN (probe)) use_thunk (probe, /*emit_p=*/1); } } @@ -5850,8 +5850,8 @@ maybe_add_lambda_conv_op (tree type) DECL_NOT_REALLY_EXTERN (fn) = 1; DECL_DECLARED_INLINE_P (fn) = 1; DECL_STATIC_FUNCTION_P (fn) = 1; - DECL_ARGUMENTS (fn) = copy_list (TREE_CHAIN (DECL_ARGUMENTS (callop))); - for (arg = DECL_ARGUMENTS (fn); arg; arg = TREE_CHAIN (arg)) + DECL_ARGUMENTS (fn) = copy_list (DECL_CHAIN (DECL_ARGUMENTS (callop))); + for (arg = DECL_ARGUMENTS (fn); arg; arg = DECL_CHAIN (arg)) DECL_CONTEXT (arg) = fn; if (nested) DECL_INTERFACE_KNOWN (fn) = 1; @@ -5884,7 +5884,7 @@ maybe_add_lambda_conv_op (tree type) null_pointer_node); argvec = make_tree_vector (); VEC_quick_push (tree, argvec, arg); - for (arg = DECL_ARGUMENTS (statfn); arg; arg = TREE_CHAIN (arg)) + for (arg = DECL_ARGUMENTS (statfn); arg; arg = DECL_CHAIN (arg)) VEC_safe_push (tree, gc, argvec, arg); call = build_call_a (callop, VEC_length (tree, argvec), VEC_address (tree, argvec)); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index d5e43de..f51722a 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2136,7 +2136,7 @@ lookup_anon_field (tree t, tree type) { tree field; - for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field)) { if (TREE_STATIC (field)) continue; @@ -6988,7 +6988,7 @@ build_ptrmemfunc1 (tree type, tree delta, tree pfn) /* Pull the FIELD_DECLs out of the type. */ pfn_field = TYPE_FIELDS (type); - delta_field = TREE_CHAIN (pfn_field); + delta_field = DECL_CHAIN (pfn_field); /* Make sure DELTA has the type we want. */ delta = convert_and_check (delta_type_node, delta); diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index bdc14c7..efe7030 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1115,7 +1115,7 @@ process_init_constructor_record (tree type, tree init) /* Generally, we will always have an index for each initializer (which is a FIELD_DECL, put by reshape_init), but compound literals don't go trough reshape_init. So we need to handle both cases. */ - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) { tree next; tree type; |