diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-11-13 22:12:55 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-11-13 22:12:55 +0000 |
commit | 0744a0c1155bca3b0fee47ad2ac40a2652968bd4 (patch) | |
tree | 1abdf8c3ce6efdfe6e521741c681eae3a746db70 /gcc/cp/class.c | |
parent | e6b3d9d035d761e96e1255dbd365450d928157b8 (diff) | |
download | gcc-0744a0c1155bca3b0fee47ad2ac40a2652968bd4.tar.gz |
Defer folding of *&.
* typeck.c (cp_build_fold_indirect_ref): New.
(cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
Add 'fold' parameter.
* cp-tree.h: Declare cp_build_fold_indirect_ref.
* call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
* parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
(cp_convert_range_for): Likewise.
* typeck2.c (build_x_arrow): Use RO_ARROW.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254712 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 98e62c6ad45..586a32c436f 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -425,7 +425,7 @@ build_base_path (enum tree_code code, interesting to the optimizers anyway. */ && !has_empty) { - expr = cp_build_indirect_ref (expr, RO_NULL, complain); + expr = cp_build_fold_indirect_ref (expr); expr = build_simple_base_path (expr, binfo); if (rvalue) expr = move (expr); @@ -452,7 +452,7 @@ build_base_path (enum tree_code code, t = TREE_TYPE (TYPE_VFIELD (current_class_type)); t = build_pointer_type (t); v_offset = fold_convert (t, current_vtt_parm); - v_offset = cp_build_indirect_ref (v_offset, RO_NULL, complain); + v_offset = cp_build_fold_indirect_ref (v_offset); } else { @@ -465,8 +465,7 @@ build_base_path (enum tree_code code, if (t == NULL_TREE) t = expr; } - v_offset = build_vfield_ref (cp_build_indirect_ref (t, RO_NULL, - complain), + v_offset = build_vfield_ref (cp_build_fold_indirect_ref (t), TREE_TYPE (TREE_TYPE (expr))); } @@ -477,7 +476,7 @@ build_base_path (enum tree_code code, v_offset = build1 (NOP_EXPR, build_pointer_type (ptrdiff_type_node), v_offset); - v_offset = cp_build_indirect_ref (v_offset, RO_NULL, complain); + v_offset = cp_build_fold_indirect_ref (v_offset); TREE_CONSTANT (v_offset) = 1; offset = convert_to_integer (ptrdiff_type_node, @@ -516,7 +515,7 @@ build_base_path (enum tree_code code, indout: if (!want_pointer) { - expr = cp_build_indirect_ref (expr, RO_NULL, complain); + expr = cp_build_fold_indirect_ref (expr); if (rvalue) expr = move (expr); } @@ -552,7 +551,7 @@ build_simple_base_path (tree expr, tree binfo) in the back end. */ temp = unary_complex_lvalue (ADDR_EXPR, expr); if (temp) - expr = cp_build_indirect_ref (temp, RO_NULL, tf_warning_or_error); + expr = cp_build_fold_indirect_ref (temp); return expr; } @@ -745,8 +744,7 @@ build_vfn_ref (tree instance_ptr, tree idx) { tree aref; - aref = build_vtbl_ref_1 (cp_build_indirect_ref (instance_ptr, RO_NULL, - tf_warning_or_error), + aref = build_vtbl_ref_1 (cp_build_fold_indirect_ref (instance_ptr), idx); /* When using function descriptors, the address of the |