summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-12 21:36:50 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-12 21:36:50 +0000
commit3602d821c747ab6c49adec9dbe11928242b19b22 (patch)
tree051c6e5b7ae1bdd153f37194a1ba91a1342fe790 /gcc/tree.c
parentb2ca91ff433a3a2431c9ffa7c55e978313445012 (diff)
downloadgcc-3602d821c747ab6c49adec9dbe11928242b19b22.tar.gz
PR c++/16254
* fold-const.c (fold) <case CLEANUP_POINT_EXPR>: Remove. * tree.c, tree.h (has_cleanups): Remove. cp/ * semantics.c (maybe_cleanup_point_expr): Don't call fold. * typeck.c (condition_conversion): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87407 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 9ef5a62a072..eb121991df1 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1805,67 +1805,6 @@ type_contains_placeholder_p (tree type)
gcc_unreachable ();
}
}
-
-/* Return 1 if EXP contains any expressions that produce cleanups for an
- outer scope to deal with. Used by fold. */
-
-int
-has_cleanups (tree exp)
-{
- int i, nops, cmp;
-
- if (! TREE_SIDE_EFFECTS (exp))
- return 0;
-
- switch (TREE_CODE (exp))
- {
- case TARGET_EXPR:
- case WITH_CLEANUP_EXPR:
- return 1;
-
- case CLEANUP_POINT_EXPR:
- return 0;
-
- case CALL_EXPR:
- for (exp = TREE_OPERAND (exp, 1); exp; exp = TREE_CHAIN (exp))
- {
- cmp = has_cleanups (TREE_VALUE (exp));
- if (cmp)
- return cmp;
- }
- return 0;
-
- case DECL_EXPR:
- return (DECL_INITIAL (DECL_EXPR_DECL (exp))
- && has_cleanups (DECL_INITIAL (DECL_EXPR_DECL (exp))));
-
- default:
- break;
- }
-
- /* This general rule works for most tree codes. All exceptions should be
- handled above. If this is a language-specific tree code, we can't
- trust what might be in the operand, so say we don't know
- the situation. */
- if ((int) TREE_CODE (exp) >= (int) LAST_AND_UNUSED_TREE_CODE)
- return -1;
-
- nops = first_rtl_op (TREE_CODE (exp));
- for (i = 0; i < nops; i++)
- if (TREE_OPERAND (exp, i) != 0)
- {
- int type = TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (exp, i)));
- if (type == 'e' || type == '<' || type == '1' || type == '2'
- || type == 'r' || type == 's')
- {
- cmp = has_cleanups (TREE_OPERAND (exp, i));
- if (cmp)
- return cmp;
- }
- }
-
- return 0;
-}
/* Given a tree EXP, a FIELD_DECL F, and a replacement value R,
return a tree with all occurrences of references to F in a