aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.def
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2019-07-04 15:00:00 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2019-07-04 15:00:00 +0000
commitebebc928d8b0d17676e751848892f927373b1fe5 (patch)
tree5b00c4867b3d58dc4865627ffab29da1e0baa2d0 /gcc/tree.def
parente57c896e86c4257741b574d99d7cacbfda219755 (diff)
downloadgcc-ebebc928d8b0d17676e751848892f927373b1fe5.zip
gcc-ebebc928d8b0d17676e751848892f927373b1fe5.tar.gz
gcc-ebebc928d8b0d17676e751848892f927373b1fe5.tar.bz2
introduce EH_ELSE_EXPR tree and gimplifier
I found GIMPLE_EH_ELSE offered exactly the semantics I needed for some Ada changes yet to be contributed, but GIMPLE_EH_ELSE was only built by GIMPLE passes, and I needed to build earlier something that eventually became GIMPLE_EH_ELSE. This patch does that, introducing an EH_ELSE_EXPR tree, and logic to dump it and to gimplify it. for gcc/ChangeLog * doc/generic.texi (Cleanups): Document EH_ELSE_EXPR. * except.c: Likewise. * expr.c (expand_expr_real_1): Reject it. * gimplify.c (gimplify_expr): Gimplify it, within TRY_FINALLY_EXPR. * tree-dump.c (dequeue_and_dump): Dump it. * tree-pretty-print.c (dump_generic_node): Likewise. * tree.c (block_may_fallthru): Handle it. * tree.def (EH_ELSE_EXPR): Introduce it. * gimple-pretty-print.c (dump_gimple_try): Dump TRY_FINALLY with GIMPLE_EH_ELSE as try/finally/else. From-SVN: r273084
Diffstat (limited to 'gcc/tree.def')
-rw-r--r--gcc/tree.def9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree.def b/gcc/tree.def
index 10a14fc..d2e6938 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -908,7 +908,14 @@ DEFTREECODE (TRY_CATCH_EXPR, "try_catch_expr", tcc_statement, 2)
/* Evaluate the first operand.
The second operand is a cleanup expression which is evaluated
on any exit (normal, exception, or jump out) from this expression. */
-DEFTREECODE (TRY_FINALLY_EXPR, "try_finally", tcc_statement, 2)
+DEFTREECODE (TRY_FINALLY_EXPR, "try_finally_expr", tcc_statement, 2)
+
+/* Evaluate either the normal or the exceptional cleanup. This must
+ only be present as the cleanup expression in a TRY_FINALLY_EXPR.
+ If the TRY_FINALLY_EXPR completes normally, the first operand of
+ EH_ELSE_EXPR is used as a cleanup, otherwise the second operand is
+ used. */
+DEFTREECODE (EH_ELSE_EXPR, "eh_else_expr", tcc_statement, 2)
/* These types of expressions have no useful value,
and always have side effects. */