diff options
author | Jason Merrill <jason@redhat.com> | 2018-04-30 11:20:56 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-04-30 11:20:56 -0400 |
commit | 4d20f49036b7a669518aab3ba4cbb062287957da (patch) | |
tree | 94c5315e309e27bc8a5fddafb119db9fa52a33bd | |
parent | 94b2a1e543ca20ed5e0468a186b27822d98b81b8 (diff) | |
download | gcc-4d20f49036b7a669518aab3ba4cbb062287957da.zip gcc-4d20f49036b7a669518aab3ba4cbb062287957da.tar.gz gcc-4d20f49036b7a669518aab3ba4cbb062287957da.tar.bz2 |
init.c (build_dtor_call): Use build_special_member_call.
* init.c (build_dtor_call): Use build_special_member_call.
(build_delete): Remove redundant uses of save_addr.
From-SVN: r259771
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/init.c | 18 |
2 files changed, 9 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7e32e75..df6d611 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2018-04-30 Jason Merrill <jason@redhat.com> + * init.c (build_dtor_call): Use build_special_member_call. + (build_delete): Remove redundant uses of save_addr. + * decl.c (build_clobber_this): Use build_clobber. 2018-04-27 Jakub Jelinek <jakub@redhat.com> diff --git a/gcc/cp/init.c b/gcc/cp/init.c index d6c0bcf..9b64ec3 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -4536,7 +4536,6 @@ build_dtor_call (tree exp, special_function_kind dtor_kind, int flags, tsubst_flags_t complain) { tree name; - tree fn; switch (dtor_kind) { case sfk_complete_destructor: @@ -4554,13 +4553,12 @@ build_dtor_call (tree exp, special_function_kind dtor_kind, int flags, default: gcc_unreachable (); } - fn = lookup_fnfields (TREE_TYPE (exp), name, /*protect=*/2); - return build_new_method_call (exp, fn, - /*args=*/NULL, - /*conversion_path=*/NULL_TREE, - flags, - /*fn_p=*/NULL, - complain); + + return build_special_member_call (exp, name, + /*args=*/NULL, + /*binfo=*/TREE_TYPE (exp), + flags, + complain); } /* Generate a call to a destructor. TYPE is the type to cast ADDR to. @@ -4650,8 +4648,6 @@ build_delete (tree otype, tree addr, special_function_kind auto_delete, } } } - if (TREE_SIDE_EFFECTS (addr)) - addr = save_expr (addr); /* Throw away const and volatile on target type of addr. */ addr = convert_force (build_pointer_type (type), addr, 0, complain); @@ -4664,8 +4660,6 @@ build_delete (tree otype, tree addr, special_function_kind auto_delete, addr = cp_build_addr_expr (addr, complain); if (addr == error_mark_node) return error_mark_node; - if (TREE_SIDE_EFFECTS (addr)) - addr = save_expr (addr); addr = convert_force (build_pointer_type (type), addr, 0, complain); } |