aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2004-06-22 03:07:05 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2004-06-21 23:07:05 -0400
commit44de5aeb00a66307236cb5b7ccfca1a21aaca080 (patch)
tree0f08ba8e2fff4040497202121f17db146e774840 /gcc/cp
parent6264b0a68d820604c6b85a4c093de22bef6382cf (diff)
downloadgcc-44de5aeb00a66307236cb5b7ccfca1a21aaca080.zip
gcc-44de5aeb00a66307236cb5b7ccfca1a21aaca080.tar.gz
gcc-44de5aeb00a66307236cb5b7ccfca1a21aaca080.tar.bz2
alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset.
* alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset. * c-decl.c (build_array_declarator): Add news args for ARRAY_REF. * c-gimplify.c (gimplify_expr_stmt): Use alloc_stmt_list. (gimplify_decl_stmt): Call gimplify_type_sizes for type. For decl, call gimplify_one_sizepos and use statement list. (gimplify_compound_literal_expr): New arg PRE_P. Add statement to PRE_P list and return DECL. (c_gimplify_expr, case COMPOUND_LITERAL_EXPR): Add arg to gimplify_compound_literal_expr. * c-tree.h (getdecls): Deleted. * c-typeck.c (build_component_ref): Add operand for COMPONENT_REF. (build_array_ref): Add two operands for ARRAY_REF. (build_unary_op): Set TREE_INVARIANT and TREE_CONSTANT for COMPOUND_LITERAL_EXPR. * coverage.c (tree_coverage_counter_ref): Add new operands for ARRAY_REF. * emit-rtl.c (component_ref_for_mem_expr): Add new operand for COMPONENT_REF. (set_mem_attributes_minus_bitpos): Use array_ref_low_bound and array_ref_element_size. (widen_memory_access):Use component_ref_field_offset. * explow.c (update_nonlocal_goto_save_area): Add two operands for ARRAY_REF. * expr.c (array_ref_element_size, array_ref_low_bound): New functions. (component_ref_field_offset): Likewise. (get_inner_reference): Use them. (expand_expr_real_1, case ARRAY_REF): Use array_ref_low_bound. * fold-const.c (fold, case EQ_EXPR): Properly handle DECL_SIZE. (fold_read_from_constant_string): Use array_ref_low_bound. Verify that result is a character type. (build_fold_indirect_ref): Add two operands for ARRAY_REF. * function.c (expand_function_start): Likewise. * gimple-low.c (expand_var_p): Delete duplicated line. * gimplify.c: Add static decls for local functions. (cgraph.h): Now included. (create_tmp_var): Remove check for ARRAY_TYPE. (copy_if_shared_r): Look at bounds and sizes of types. (build_and_jump): Return alloc_stmt_list instead of build_empty_stmt. (gimplify_exit_expr, shortcut_cond_expr): Likewise. (gimplify_save_expr, gimple_push_cleanup): Likewise. (gimplify_init_constructor): Likewise. WANT_VALUE now bool. If empty list with no result wanted, return GS_UNHANDLED. Add additional operands for ARRAY_REF and COMPONENT_REF. (canonicalize_component_ref): Convert to &array[L]. (gimplify_array_ref_to_plus): Use array_ref_element_size and array_ref_lower_bound. (build_addr_expr_with_type, build_addr_expr): New functions. (gimplify_compound_lval): WANT_LVALUE now bool. Major rework to allow handle_component_p and initialize and gimplify new operands for ARRAY_REF, ARRAY_RANGE_REF, and COMPONENT_REF. (gimplify_array_ref): Deleted. (gimplify_self_mod_expr): WANT_VALUE now bool. (gimplify_modify_expr): Gimplify to_p and from_p later. Factor out code into gimplify_modify_expr_rhs and call twice. Move variable-size code earlier and handle PLACEHOLDER_EXPR. (gimplify_modify_expr_rhs, gimplify_variable_sized_compare): New fns. (gimplify_addr_expr, case VIEW_CONVERT_EXPR): New case. (gimplify_expr, case ARRAY_REF): Delete special case. Instead handle like COMPONENT_REF; also do ARRAY_RANGE_REF, IMAGPART, and REALPART the same way. (gimplify_expr, case VIEW_CONVERT_EXPR): New case. (gimplify_expr): Call gimplify_variable_sized_compare if applicable. Call alloc_stmt_list instead of build_empty_stmt. Deal with _REF that's volatile. (gimplify_type_sizes, gimplify_one_sizepos): New functions. (unshare_body, unvisit_body): New functions. (gimplify_body): Call them. * stmt.c (expand_stack_alloc): Don't expand TYPE_MAX_VALUE. * stor-layout.c (get_pending_sizes): Don't change SAVE_EXPR_CONTEXT. * tree-alias-common.c (get_alias_var): Also skip ARRAY_RANGE_REF. * tree-cfg.c (tree_node_can_be_shared): Treat ARRAY_RANGE_REF like ARRAY_REF. (verify_expr, case ADDR_EXPR): Use handled_component_p. * tree-dfa.c (get_virtual_var): Likewise. * tree-dump.c (dequeue_and_dump, case COMPONENT_REF, ARRAY_REF): New cases to dump new operands; likewise for ARRAY_RANGE_REF. * tree-eh.c (tree_could_trap, case ARRAY_RANGE_REF): Like ARRAY_REF. * tree-gimple.c (is_gimple_addr_expr_arg): Add ARRAY_RANGE_REF and INDIRECT_REF. (get_base_address): Use handled_component_p. * tree-gimple.h (gimplify_type_sizes, gimplify_one_sizepos): New. * tree-line.c (walk_tree): Walk more things for types and decls. * tree-mudflap.c (mf_build_check_statement_for): Add new operands for ARRAY_REF and COMPONENT_REF. (mx_xform_derefs_1): Clean up usage of decl sizes. * tree-nested.c (build_addr): Use handled_component_p. (walk_stmts, case CATCH_EXPR): Add missing "break". (get_static_chain, get_frame_field): Add new operand for COMPONENT_REF. (finalize_nesting_tree_1): Likewise. (convert_nonlocal_reference, case ARRAY_RANGE_REF): Like ARRAY_REF and process additional operands. (convert_local_reference): Likewise. * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Treat ARRAY_RANGE_REF similarly to ARRAY_REF. * tree-pretty-print.c (dump_generic_node, case QUAL_UNION_TYPE): Handle like RECORD_TYPE. (dump_generic_node, case COMPONENT_REF): Print offset operand. (dump_generic_node, case ARRAY_RANGE_REF): Treat like ARRAY_REF and print lower bound and element size for both. (op_prio, case ARRAY_RANGE_REF): Like ARRAY_REF. * tree-sra.c (csc_build_component_ref): Add new operand. (scalarize_call_expr): Use get_base_address. * tree-ssa-ccp.c (widen_bitfield): Clean up size handling. (maybe_fold_offset_to_array_ref): Rework to handle input having an ARRAY_REF, refine handling of lower bound, and add new operands for ARRAY_REF. (maybe_fold_to_component_ref): Add new operand for COMPONENT_REF. (maybe_fold_stmt_indirect): Only fold *&B to B if types match. (maybe_fold_stmt_addition): Only handle constant lower bound. * tree-ssa-operands.c (get_expr_operands): Minor rearrangements. Treat ARRAY_REF and ARRAY_RANGE_REF the same; look at extra operands. Look at new offset operand of COMPONENT_REF. * tree-ssa.c (set_is_used): Use handled_component_p. * tree.c (substitute_in_expr, case COMPONENT_REF): Add new operand. (stabilize_reference, case COMPONENT_REF): Likewise. (stabilize_reference, case ARRAY_RANGE_REF, ARRAY_REF): Similarly. (recompute_tree_invariant_for_addr_expr): Completely rework to be more precise. Also set TREE_SIDE_EFFECTS. (build1_stat, case ARRAY_EXPR): Don't handle TREE_SIDE_EFFECTS here. (build2_stat, build3_stat, build4_stat): For references, propagate TREE_THIS_VOLATILE. (get_unwidened): Add new operand for COMPONENT_REF. (get_narrower): Likewise; use host_integerp for DECL_SIZE. * tree.def (COMPONENT_REF): Add new operand. (ARRAY_REF, ARRAY_RANGE_REF): Add two new operands. * tree.h (array_ref_element_size, array_ref_low_bound): New decls. (component_ref_field_offset): Likewise. * config/alpha/alpha.c (alpha_va_start): Add new op for COMPONENT_REF. (alpha_gimplify_va_arg): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/i860/i860.c (i860_va_start, i860_va_arg): Likewise. * config/iq2000/iq2000.c (iq2000_va_arg): Likewise. * config/mips/mips.c (mips_va_start, mips_va_arg): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_va_start, s390_gimplify_va_arg): Likewise. * config/sh/sh.c (sh_va_start, sh_va_arg): Likewise. * config/stormy16/stormy16.c (xstormy1_expand_builin_va_start): Likewise. (xstormy16_expand_builtin_va_arg): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_va_arg): Likewise. * cp/call.c (build_vfield_ref): Add new operand for COMPONENT_REF. (build_new_method_call): Likewise. * cp/decl.c (local_variable_p_walkfn): Don't walk into types. * cp/decl2.c (grok_array_decl): Add new operands for ARRAY_REF. (build_anon_union_vars): Add new operand for COMPONENT_REF. * cp/init.c (buld_new): Add new operand for ARRAY_REF. * cp/method.c (do_build_copy_constructor): New op for COMPONENT_REF. (do_build_assign_ref): Likewise. * cp/parser.c (cp_parser_direct_new_declarator): Add new operands for ARRAY_REF. (cp_parser_direct_declarator): Likewise. * cp/pt.c (tsubst): Likewise. (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand for COMPONENT_REF. * cp/semantics.c (finish_non_static_data_member): Add new operand for COMPONENT_REF. * cp/typeck.c (build_class_member_access_expr): Likewise. (build_class_member_access_expr, finish_class_member_access_expr): Likewise. (build_ptrmemfunc_access_expr): Likewise. (build_array_ref): Add new operands for ARRAY_REF. * cp/typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too. * cp/tree.c (count_trees_r, no_linkage_helper): Don't walk in types. * fortran/f95-lang.c (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Deleted. * fortran/trans-array.c (gfc_conv_descriptor_data): Add operand for COMPONENT_REF. (gfc_conv_descriptor_offset, gfc_conv_descriptor_dtype): Likewise. (gfc_conv_descriptor_dimension, gfc_conv_descriptor_stride): Likewise. (gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound): Likewise. * fortran/trans-common.c (create_common): Likewise. * fortran/trans-expr.c (gfc_conv_component_ref): Likewise. * fortran/trans-io.c (set_parameter_value): Likewise. (set_parameter_ref, set_string, set_flag, io_result): Likewise. (transfer_expr): Likewise. * fortran/trans-decl.c (gfc_trans_auto_character_variable): Set up to get DECL_SIZE and DECL_SIZE_UNIT gimplified. (gfc_simplify_function): New function. (gfc_generate_function-code): Properly handle nested functions. * fortran/trans.c (gfc_build_array_ref): Add two new operands for ARRAY_REF. * java/class.c (build_class_ref): Add new operand for COMPONENT_REF. (build_static_field_ref): Likewise and add new operands for ARRAY_REF. * java/constants.c (build_ref_from_constant_pool): Likewise. * java/expr.c (build_java_array_length_access): Likewise. (build_get_class, build_field_ref, build_known_method_ref): Likewise. (invoke_build_dtable, build_invokevirtual): Likewise. (build_invokeinterface, java_expand_expr): Likewise. (emit_init_test_initialization): Likewise. * java/java-gimplify.c (java_gimplify_new_array_init): Likewise. * java/parse.y (make_qualifed_name, build_array_ref): Likewise. * objc/ojbc-act.c (generate_static_references): Add additional operands to ARRAY_REF. (generate_strings, build_method_prototype_list_template): Likewise. (generate_protocol_list): Likewise. From-SVN: r83474
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog26
-rw-r--r--gcc/cp/call.c7
-rw-r--r--gcc/cp/decl.c14
-rw-r--r--gcc/cp/decl2.c10
-rw-r--r--gcc/cp/init.c5
-rw-r--r--gcc/cp/method.c7
-rw-r--r--gcc/cp/parser.c6
-rw-r--r--gcc/cp/pt.c9
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/cp/tree.c16
-rw-r--r--gcc/cp/typeck.c13
-rw-r--r--gcc/cp/typeck2.c12
12 files changed, 85 insertions, 42 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0291057..d8b494b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,29 @@
+2004-06-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
+ (build_new_method_call): Likewise.
+ * decl.c (local_variable_p_walkfn): Don't walk into types.
+ * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
+ (build_anon_union_vars): Add new operand for COMPONENT_REF.
+ * init.c (buld_new): Add new operand for ARRAY_REF.
+ * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
+ (do_build_assign_ref): Likewise.
+ * parser.c (cp_parser_direct_new_declarator): Add new operands
+ for ARRAY_REF.
+ (cp_parser_direct_declarator): Likewise.
+ * pt.c (tsubst): Likewise.
+ (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
+ for COMPONENT_REF.
+ * semantics.c (finish_non_static_data_member): Add new operand
+ for COMPONENT_REF.
+ * typeck.c (build_class_member_access_expr): Likewise.
+ (build_class_member_access_expr, finish_class_member_access_expr):
+ Likewise.
+ (build_ptrmemfunc_access_expr): Likewise.
+ (build_array_ref): Add new operands for ARRAY_REF.
+ * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
+ * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
+
2004-06-21 Richard Henderson <rth@redhat.com>
* dump.c (cp_dump_tree): Don't use dump_next_stmt.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 616cf81..0c247b8 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -203,7 +203,7 @@ build_vfield_ref (tree datum, tree type)
datum = convert_to_base (datum, type, /*check_access=*/false);
return build (COMPONENT_REF, TREE_TYPE (TYPE_VFIELD (type)),
- datum, TYPE_VFIELD (type));
+ datum, TYPE_VFIELD (type), NULL_TREE);
}
/* Returns nonzero iff the destructor name specified in NAME
@@ -3868,8 +3868,7 @@ builtin:
return build_conditional_expr (arg1, arg2, arg3);
case MEMBER_REF:
- return build_m_component_ref
- (build_indirect_ref (arg1, NULL), arg2);
+ return build_m_component_ref (build_indirect_ref (arg1, NULL), arg2);
/* The caller will deal with these. */
case ADDR_EXPR:
@@ -5360,7 +5359,7 @@ build_new_method_call (tree instance, tree fns, tree args,
if (processing_template_decl && call != error_mark_node)
call = (build_min_non_dep
(CALL_EXPR, call,
- build_min_nt (COMPONENT_REF, orig_instance, orig_fns),
+ build_min_nt (COMPONENT_REF, orig_instance, orig_fns, NULL_TREE),
orig_args, NULL_TREE));
/* Free all the conversions we allocated. */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 84f3b84..55ce684 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8508,14 +8508,18 @@ nonstatic_local_decl_p (tree t)
function. */
static tree
-local_variable_p_walkfn (tree* tp,
- int* walk_subtrees ATTRIBUTE_UNUSED ,
- void* data ATTRIBUTE_UNUSED )
+local_variable_p_walkfn (tree *tp, int *walk_subtrees,
+ void *data ATTRIBUTE_UNUSED)
{
- return ((local_variable_p (*tp) && !DECL_ARTIFICIAL (*tp))
- ? *tp : NULL_TREE);
+ if (local_variable_p (*tp) && !DECL_ARTIFICIAL (*tp))
+ return *tp;
+ else if (TYPE_P (*tp))
+ *walk_subtrees = 0;
+
+ return NULL_TREE;
}
+
/* Check that ARG, which is a default-argument expression for a
parameter DECL, is valid. Returns ARG, or ERROR_MARK_NODE, if
something goes wrong. DECL may also be a _TYPE node, rather than a
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index eacab5f..00105a6 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -369,7 +369,8 @@ grok_array_decl (tree array_expr, tree index_exp)
{
if (type_dependent_expression_p (array_expr)
|| type_dependent_expression_p (index_exp))
- return build_min_nt (ARRAY_REF, array_expr, index_exp);
+ return build_min_nt (ARRAY_REF, array_expr, index_exp,
+ NULL_TREE, NULL_TREE);
array_expr = build_non_dependent_expr (array_expr);
index_exp = build_non_dependent_expr (index_exp);
}
@@ -426,8 +427,8 @@ grok_array_decl (tree array_expr, tree index_exp)
expr = build_array_ref (array_expr, index_exp);
}
if (processing_template_decl && expr != error_mark_node)
- return build_min_non_dep (ARRAY_REF, expr,
- orig_array_expr, orig_index_exp);
+ return build_min_non_dep (ARRAY_REF, expr, orig_array_expr, orig_index_exp,
+ NULL_TREE, NULL_TREE);
return expr;
}
@@ -1175,7 +1176,8 @@ build_anon_union_vars (tree object)
cp_pedwarn_at ("protected member `%#D' in anonymous union", field);
if (processing_template_decl)
- ref = build_min_nt (COMPONENT_REF, object, DECL_NAME (field));
+ ref = build_min_nt (COMPONENT_REF, object,
+ DECL_NAME (field), NULL_TREE);
else
ref = build_class_member_access_expr (object, field, NULL_TREE,
false);
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 6c88623..2af5118 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1777,7 +1777,8 @@ build_new (tree placement, tree decl, tree init, int use_global_new)
{
if (has_array)
t = tree_cons (tree_cons (NULL_TREE, type, NULL_TREE),
- build_min_nt (ARRAY_REF, NULL_TREE, nelts),
+ build_min_nt (ARRAY_REF, NULL_TREE, nelts,
+ NULL_TREE, NULL_TREE),
NULL_TREE);
else
t = type;
@@ -1815,7 +1816,7 @@ build_new (tree placement, tree decl, tree init, int use_global_new)
}
if (has_array)
- t = build_nt (ARRAY_REF, type, nelts);
+ t = build_nt (ARRAY_REF, type, nelts, NULL_TREE, NULL_TREE);
else
t = type;
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 357ea86..495244f 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -591,7 +591,7 @@ do_build_copy_constructor (tree fndecl)
expr_type = TREE_TYPE (field);
if (TREE_CODE (expr_type) != REFERENCE_TYPE)
expr_type = cp_build_qualified_type (expr_type, cvquals);
- init = build (COMPONENT_REF, expr_type, init, field);
+ init = build (COMPONENT_REF, expr_type, init, field, NULL_TREE);
init = build_tree_list (NULL_TREE, init);
member_init_list
@@ -687,10 +687,11 @@ do_build_assign_ref (tree fndecl)
else
continue;
- comp = build (COMPONENT_REF, TREE_TYPE (field), comp, field);
+ comp = build (COMPONENT_REF, TREE_TYPE (field), comp, field,
+ NULL_TREE);
init = build (COMPONENT_REF,
cp_build_qualified_type (TREE_TYPE (field), cvquals),
- init, field);
+ init, field, NULL_TREE);
if (DECL_NAME (field))
finish_expr_stmt (build_modify_expr (comp, NOP_EXPR, init));
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index bd6abe8..5ad4250 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -4767,7 +4767,8 @@ cp_parser_direct_new_declarator (cp_parser* parser)
cp_parser_require (parser, CPP_CLOSE_SQUARE, "`]'");
/* Add this bound to the declarator. */
- declarator = build_nt (ARRAY_REF, declarator, expression);
+ declarator = build_nt (ARRAY_REF, declarator, expression,
+ NULL_TREE, NULL_TREE);
/* If the next token is not a `[', then there are no more
bounds. */
@@ -10714,7 +10715,8 @@ cp_parser_direct_declarator (cp_parser* parser,
break;
}
- declarator = build_nt (ARRAY_REF, declarator, bounds);
+ declarator = build_nt (ARRAY_REF, declarator, bounds,
+ NULL_TREE, NULL_TREE);
}
else if (first && dcl_kind != CP_PARSER_DECLARATOR_ABSTRACT)
{
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f8e259c..1e23acb 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7201,7 +7201,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (e1 == error_mark_node || e2 == error_mark_node)
return error_mark_node;
- return build_nt (ARRAY_REF, e1, e2);
+ return build_nt (ARRAY_REF, e1, e2, NULL_TREE, NULL_TREE);
}
case CALL_EXPR:
@@ -7563,7 +7563,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
in_decl);
else
name = tsubst_copy (name, args, complain, in_decl);
- return build_nt (COMPONENT_REF, object, name);
+ return build_nt (COMPONENT_REF, object, name, NULL_TREE);
}
case PLUS_EXPR:
@@ -8143,7 +8143,7 @@ tsubst_copy_and_build (tree t,
if (object)
return build (COMPONENT_REF, TREE_TYPE (template),
- object, template);
+ object, template, NULL_TREE);
else
return template;
}
@@ -8255,7 +8255,8 @@ tsubst_copy_and_build (tree t,
if (tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl)
== NULL_TREE)
/* new-type-id */
- return build_nt (ARRAY_REF, NULL_TREE, RECUR (TREE_OPERAND (t, 1)));
+ return build_nt (ARRAY_REF, NULL_TREE, RECUR (TREE_OPERAND (t, 1)),
+ NULL_TREE, NULL_TREE);
op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
args, complain, in_decl);
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 0da9494..9e4b884 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1233,7 +1233,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
type = cp_build_qualified_type (type, quals);
}
- return build_min (COMPONENT_REF, type, object, decl);
+ return build_min (COMPONENT_REF, type, object, decl, NULL_TREE);
}
else
{
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 6b55880..527e9c2 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1026,11 +1026,13 @@ bind_template_template_parm (tree t, tree newargs)
/* Called from count_trees via walk_tree. */
static tree
-count_trees_r (tree* tp ATTRIBUTE_UNUSED ,
- int* walk_subtrees ATTRIBUTE_UNUSED ,
- void* data)
+count_trees_r (tree *tp, int *walk_subtrees, void *data)
{
- ++ *((int*) data);
+ ++*((int *) data);
+
+ if (TYPE_P (*tp))
+ *walk_subtrees = 0;
+
return NULL_TREE;
}
@@ -1107,9 +1109,8 @@ find_tree (tree t, tree x)
/* Passed to walk_tree. Checks for the use of types with no linkage. */
static tree
-no_linkage_helper (tree* tp,
- int* walk_subtrees ATTRIBUTE_UNUSED ,
- void* data ATTRIBUTE_UNUSED )
+no_linkage_helper (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
{
tree t = *tp;
@@ -1118,6 +1119,7 @@ no_linkage_helper (tree* tp,
&& (decl_function_context (TYPE_MAIN_DECL (t))
|| TYPE_ANONYMOUS_P (t)))
return t;
+
return NULL_TREE;
}
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index bdf7377..8800007 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1752,7 +1752,8 @@ build_class_member_access_expr (tree object, tree member,
member_type = cp_build_qualified_type (member_type, type_quals);
}
- result = fold (build (COMPONENT_REF, member_type, object, member));
+ result = fold (build (COMPONENT_REF, member_type, object, member,
+ NULL_TREE));
/* Mark the expression const or volatile, as appropriate. Even
though we've dealt with the type above, we still have to mark the
@@ -1779,7 +1780,7 @@ build_class_member_access_expr (tree object, tree member,
type = unknown_type_node;
/* Note that we do not convert OBJECT to the BASELINK_BINFO
base. That will happen when the function is called. */
- result = build (COMPONENT_REF, type, object, member);
+ result = build (COMPONENT_REF, type, object, member, NULL_TREE);
}
else if (TREE_CODE (member) == CONST_DECL)
{
@@ -1878,7 +1879,7 @@ finish_class_member_access_expr (tree object, tree name)
|| (TREE_CODE (name) == SCOPE_REF
&& TYPE_P (TREE_OPERAND (name, 0))
&& dependent_type_p (TREE_OPERAND (name, 0))))
- return build_min_nt (COMPONENT_REF, object, name);
+ return build_min_nt (COMPONENT_REF, object, name, NULL_TREE);
object = build_non_dependent_expr (object);
}
@@ -2005,7 +2006,7 @@ finish_class_member_access_expr (tree object, tree name)
/*preserve_reference=*/false);
if (processing_template_decl && expr != error_mark_node)
return build_min_non_dep (COMPONENT_REF, expr,
- orig_object, orig_name);
+ orig_object, orig_name, NULL_TREE);
return expr;
}
@@ -2033,7 +2034,7 @@ build_ptrmemfunc_access_expr (tree ptrmem, tree member_name)
/*want_type=*/false);
member_type = cp_build_qualified_type (TREE_TYPE (member),
cp_type_quals (ptrmem_type));
- return fold (build (COMPONENT_REF, member_type, ptrmem, member));
+ return fold (build (COMPONENT_REF, member_type, ptrmem, member, NULL_TREE));
}
/* Given an expression PTR for a pointer, return an expression
@@ -2249,7 +2250,7 @@ build_array_ref (tree array, tree idx)
}
type = TREE_TYPE (TREE_TYPE (array));
- rval = build (ARRAY_REF, type, array, idx);
+ rval = build (ARRAY_REF, type, array, idx, NULL_TREE, NULL_TREE);
/* Array ref is const/volatile if the array elements are
or if the array is.. */
TREE_READONLY (rval)
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 9ea4f55..2e08d56 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -320,9 +320,11 @@ split_nonconstant_init_1 (tree dest, tree init)
if (TREE_CODE (value) == CONSTRUCTOR)
{
if (array_type_p)
- sub = build (ARRAY_REF, inner_type, dest, field_index);
+ sub = build (ARRAY_REF, inner_type, dest, field_index,
+ NULL_TREE, NULL_TREE);
else
- sub = build (COMPONENT_REF, inner_type, dest, field_index);
+ sub = build (COMPONENT_REF, inner_type, dest, field_index,
+ NULL_TREE);
split_nonconstant_init_1 (sub, value);
}
@@ -331,9 +333,11 @@ split_nonconstant_init_1 (tree dest, tree init)
*pelt = TREE_CHAIN (elt);
if (array_type_p)
- sub = build (ARRAY_REF, inner_type, dest, field_index);
+ sub = build (ARRAY_REF, inner_type, dest, field_index,
+ NULL_TREE, NULL_TREE);
else
- sub = build (COMPONENT_REF, inner_type, dest, field_index);
+ sub = build (COMPONENT_REF, inner_type, dest, field_index,
+ NULL_TREE);
code = build (MODIFY_EXPR, inner_type, sub, value);
code = build_stmt (EXPR_STMT, code);