diff options
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 866e342..216a301 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -421,7 +421,7 @@ build_base_path (enum tree_code code, t = TREE_TYPE (TYPE_VFIELD (current_class_type)); t = build_pointer_type (t); - v_offset = convert (t, current_vtt_parm); + v_offset = fold_convert (t, current_vtt_parm); v_offset = cp_build_indirect_ref (v_offset, RO_NULL, complain); } else @@ -554,8 +554,6 @@ build_simple_base_path (tree expr, tree binfo) expr = build3 (COMPONENT_REF, cp_build_qualified_type (type, type_quals), expr, field, NULL_TREE); - expr = fold_if_not_in_template (expr); - /* Mark the expression const or volatile, as appropriate. Even though we've dealt with the type above, we still have to mark the expression itself. */ @@ -1847,9 +1845,9 @@ determine_primary_bases (tree t) another hierarchy. As we're about to use it as a primary base, make sure the offsets match. */ delta = size_diffop_loc (input_location, - convert (ssizetype, + fold_convert (ssizetype, BINFO_OFFSET (base_binfo)), - convert (ssizetype, + fold_convert (ssizetype, BINFO_OFFSET (this_primary))); propagate_binfo_offsets (this_primary, delta); @@ -1911,7 +1909,7 @@ determine_primary_bases (tree t) another hierarchy. As we're about to use it as a primary base, make sure the offsets match. */ delta = size_diffop_loc (input_location, ssize_int (0), - convert (ssizetype, BINFO_OFFSET (primary))); + fold_convert (ssizetype, BINFO_OFFSET (primary))); propagate_binfo_offsets (primary, delta); } @@ -2635,7 +2633,7 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, if (virtual_offset || (thunk_binfo && !BINFO_OFFSET_ZEROP (thunk_binfo))) { - tree offset = convert (ssizetype, BINFO_OFFSET (thunk_binfo)); + tree offset = fold_convert (ssizetype, BINFO_OFFSET (thunk_binfo)); if (virtual_offset) { @@ -2643,7 +2641,7 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, offset to be from there. */ offset = size_diffop (offset, - convert (ssizetype, + fold_convert (ssizetype, BINFO_OFFSET (virtual_offset))); } if (fixed_offset) @@ -2732,8 +2730,8 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, /* The `this' pointer needs to be adjusted from the declaration to the nearest virtual base. */ delta = size_diffop_loc (input_location, - convert (ssizetype, BINFO_OFFSET (virtual_base)), - convert (ssizetype, BINFO_OFFSET (first_defn))); + fold_convert (ssizetype, BINFO_OFFSET (virtual_base)), + fold_convert (ssizetype, BINFO_OFFSET (first_defn))); else if (lost) /* If the nearest definition is in a lost primary, we don't need an entry in our vtable. Except possibly in a constructor vtable, @@ -2745,9 +2743,9 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, BINFO to pointing at the base where the final overrider appears. */ delta = size_diffop_loc (input_location, - convert (ssizetype, + fold_convert (ssizetype, BINFO_OFFSET (TREE_VALUE (overrider))), - convert (ssizetype, BINFO_OFFSET (binfo))); + fold_convert (ssizetype, BINFO_OFFSET (binfo))); modify_vtable_entry (t, binfo, overrider_fn, delta, virtuals); @@ -3469,7 +3467,7 @@ check_bitfield_decl (tree field) if (w != error_mark_node) { - DECL_SIZE (field) = convert (bitsizetype, w); + DECL_SIZE (field) = fold_convert (bitsizetype, w); DECL_BIT_FIELD (field) = 1; return true; } @@ -4314,8 +4312,8 @@ layout_nonempty_base_or_field (record_layout_info rli, OFFSET. */ propagate_binfo_offsets (binfo, size_diffop_loc (input_location, - convert (ssizetype, offset), - convert (ssizetype, + fold_convert (ssizetype, offset), + fold_convert (ssizetype, BINFO_OFFSET (binfo)))); } @@ -4362,7 +4360,7 @@ layout_empty_base (record_layout_info rli, tree binfo, /* That didn't work. Now, we move forward from the next available spot in the class. */ atend = true; - propagate_binfo_offsets (binfo, convert (ssizetype, eoc)); + propagate_binfo_offsets (binfo, fold_convert (ssizetype, eoc)); while (1) { if (!layout_conflict_p (binfo, @@ -5976,9 +5974,9 @@ propagate_binfo_offsets (tree binfo, tree offset) /* Update BINFO's offset. */ BINFO_OFFSET (binfo) - = convert (sizetype, + = fold_convert (sizetype, size_binop (PLUS_EXPR, - convert (ssizetype, BINFO_OFFSET (binfo)), + fold_convert (ssizetype, BINFO_OFFSET (binfo)), offset)); /* Find the primary base class. */ @@ -6183,7 +6181,7 @@ include_empty_classes (record_layout_info rli) = size_binop (PLUS_EXPR, rli->bitpos, size_binop (MULT_EXPR, - convert (bitsizetype, + fold_convert (bitsizetype, size_binop (MINUS_EXPR, eoc, rli_size)), bitsize_int (BITS_PER_UNIT))); @@ -6457,7 +6455,7 @@ layout_class_type (tree t, tree *virtuals_p) eoc = end_of_class (t, /*include_virtuals_p=*/0); TYPE_SIZE_UNIT (base_t) = size_binop (MAX_EXPR, - convert (sizetype, + fold_convert (sizetype, size_binop (CEIL_DIV_EXPR, rli_size_so_far (rli), bitsize_int (BITS_PER_UNIT))), @@ -6466,7 +6464,7 @@ layout_class_type (tree t, tree *virtuals_p) = size_binop (MAX_EXPR, rli_size_so_far (rli), size_binop (MULT_EXPR, - convert (bitsizetype, eoc), + fold_convert (bitsizetype, eoc), bitsize_int (BITS_PER_UNIT))); TYPE_ALIGN (base_t) = rli->record_align; TYPE_USER_ALIGN (base_t) = TYPE_USER_ALIGN (t); @@ -9302,7 +9300,7 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) /* Figure out where we can find this vbase offset. */ delta = size_binop (MULT_EXPR, vid->index, - convert (ssizetype, + fold_convert (ssizetype, TYPE_SIZE_UNIT (vtable_entry_type))); if (vid->primary_vtbl_p) BINFO_VPTR_FIELD (b) = delta; |