From: Richard Henderson Date: Thu, 17 Jun 2004 01:24:06 +0000 (-0700) Subject: c-common.def (COMPOUND_STMT): Remove. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5882f0f31a400e94182c921c39fb4ddd9781517e;p=gcc.git c-common.def (COMPOUND_STMT): Remove. * c-common.def (COMPOUND_STMT): Remove. * c-common.c (finish_fname_decls): Don't look through it. * c-typeck.c (c_tree_expr_nonnegative_p): Likewise. * c-common.h (COMPOUND_BODY): Remove. (c_common_stmt_codes): Remove COMPOUND_STMT. * c-dump.c (c_dump_tree): Likewise. * c-gimplify.c (c_gimplify_stmt): Likewise. * c-pretty-print.c (pp_c_statement): Likewise. * tree.h (DECL_SAVED_TREE): Update commentary. * doc/c-tree.texi (ASM_EXPR): Rename from ASM_STMT. (CASE_LABEL_EXPR): Rename from CASE_LABEL. (GOTO_EXPR): Rename from GOTO_STMT. (GOTO_FAKE_P): Remove. (COMPOUND_STMT): Remove. (HANDLER): Update wrt COMPOUND_STMT. (STMT_EXPR): Likewise. (LABEL_EXPR): Rename from LABEL_STMT. (SCOPE_STMT): Remove. * objc/objc-act.c (objc_build_try_catch_finally_stmt): Don't look through COMPOUND_STMT. cp/ * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill. (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New. * cxx-pretty-print.c (pp_cxx_function_definition): Move handling of CTOR_INITIALIZER ... (pp_cxx_statement): ... here. * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK. (finish_function): Use alloc_stmt_list to zap entire function. * parser.c (cp_parser_compound_statement): Update commentary. * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT. * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise. (finish_stmt_expr): Don't look through COMPOUND_STMT. From-SVN: r83281 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 79c722e6f80..6263dbdf160 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,26 @@ +2004-06-16 Richard Henderson + + * c-common.def (COMPOUND_STMT): Remove. + * c-common.c (finish_fname_decls): Don't look through it. + * c-typeck.c (c_tree_expr_nonnegative_p): Likewise. + * c-common.h (COMPOUND_BODY): Remove. + (c_common_stmt_codes): Remove COMPOUND_STMT. + * c-dump.c (c_dump_tree): Likewise. + * c-gimplify.c (c_gimplify_stmt): Likewise. + * c-pretty-print.c (pp_c_statement): Likewise. + * tree.h (DECL_SAVED_TREE): Update commentary. + * doc/c-tree.texi (ASM_EXPR): Rename from ASM_STMT. + (CASE_LABEL_EXPR): Rename from CASE_LABEL. + (GOTO_EXPR): Rename from GOTO_STMT. + (GOTO_FAKE_P): Remove. + (COMPOUND_STMT): Remove. + (HANDLER): Update wrt COMPOUND_STMT. + (STMT_EXPR): Likewise. + (LABEL_EXPR): Rename from LABEL_STMT. + (SCOPE_STMT): Remove. + * objc/objc-act.c (objc_build_try_catch_finally_stmt): Don't look + through COMPOUND_STMT. + 2004-06-16 Richard Henderson * c-common.h (c_begin_if_stmt, c_begin_while_stmt, diff --git a/gcc/c-common.c b/gcc/c-common.c index 6ef83f04640..ac439e58485 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -899,8 +899,6 @@ finish_fname_decls (void) { tree *bodyp = &DECL_SAVED_TREE (current_function_decl); - if (TREE_CODE (*bodyp) == COMPOUND_STMT) - bodyp = &COMPOUND_BODY (*bodyp); if (TREE_CODE (*bodyp) == BIND_EXPR) bodyp = &BIND_EXPR_BODY (*bodyp); diff --git a/gcc/c-common.def b/gcc/c-common.def index 0c9b9f0a0b8..b66098a3a27 100644 --- a/gcc/c-common.def +++ b/gcc/c-common.def @@ -33,10 +33,6 @@ DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", '1', 1) obtain the expression. */ DEFTREECODE (EXPR_STMT, "expr_stmt", 'e', 1) -/* Used to represent a brace-enclosed block. The operand is - COMPOUND_BODY. */ -DEFTREECODE (COMPOUND_STMT, "compound_stmt", 'e', 1) - /* Used to represent a local declaration. The operand is DECL_STMT_DECL. */ DEFTREECODE (DECL_STMT, "decl_stmt", 'e', 1) diff --git a/gcc/c-common.h b/gcc/c-common.h index 3e15d2b9896..2f661538e46 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -956,12 +956,6 @@ extern void finish_file (void); #define SWITCH_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) -/* COMPOUND_STMT accessor. This gives access to the TREE_LIST of - statements associated with a compound statement. The result is the - first statement in the list. Succeeding nodes can be accessed by - calling TREE_CHAIN on a node in the list. */ -#define COMPOUND_BODY(NODE) TREE_OPERAND (COMPOUND_STMT_CHECK (NODE), 0) - /* DECL_STMT accessor. This gives access to the DECL associated with the given declaration statement. */ #define DECL_STMT_DECL(NODE) TREE_OPERAND (DECL_STMT_CHECK (NODE), 0) @@ -1000,7 +994,7 @@ enum c_tree_code { #undef DEFTREECODE #define c_common_stmt_codes \ - CLEANUP_STMT, EXPR_STMT, COMPOUND_STMT, \ + CLEANUP_STMT, EXPR_STMT, \ DECL_STMT, IF_STMT, FOR_STMT, \ WHILE_STMT, DO_STMT, RETURN_STMT, \ BREAK_STMT, CONTINUE_STMT, SWITCH_STMT diff --git a/gcc/c-dump.c b/gcc/c-dump.c index 9e8280774c2..74ef44db032 100644 --- a/gcc/c-dump.c +++ b/gcc/c-dump.c @@ -76,12 +76,6 @@ c_dump_tree (void *dump_info, tree t) dump_next_stmt (di, t); break; - case COMPOUND_STMT: - dump_stmt (di, t); - dump_child ("body", COMPOUND_BODY (t)); - dump_next_stmt (di, t); - break; - case DECL_STMT: dump_stmt (di, t); dump_child ("decl", DECL_STMT_DECL (t)); diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c index 2e9b4b92b64..933b24faf31 100644 --- a/gcc/c-gimplify.c +++ b/gcc/c-gimplify.c @@ -227,11 +227,6 @@ c_gimplify_stmt (tree *stmt_p) switch (TREE_CODE (stmt)) { - case COMPOUND_STMT: - stmt = COMPOUND_BODY (stmt); - ret = GS_OK; - break; - case FOR_STMT: ret = gimplify_for_stmt (&stmt, &pre); break; diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c index a2ef2048874..490cf809800 100644 --- a/gcc/c-pretty-print.c +++ b/gcc/c-pretty-print.c @@ -1909,27 +1909,6 @@ pp_c_statement (c_pretty_printer *pp, tree stmt) } break; - /* compound-statement: - { block-item-list(opt) } - - block-item-list: - block-item - block-item-list block-item - - block-item: - declaration - statement */ - case COMPOUND_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_c_left_brace (pp); - pp_newline_and_indent (pp, 3); - pp_statement (pp, COMPOUND_BODY (stmt)); - pp_newline_and_indent (pp, -3); - pp_c_right_brace (pp); - pp_needs_newline (pp) = true; - break; - /* expression-statement: expression(opt) ; */ case EXPR_STMT: diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 8c2a7ba57f7..434cd575ce0 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -2208,7 +2208,7 @@ int c_tree_expr_nonnegative_p (tree t) { if (TREE_CODE (t) == STMT_EXPR) - t = expr_last (COMPOUND_BODY (STMT_EXPR_STMT (t))); + t = expr_last (STMT_EXPR_STMT (t)); return tree_expr_nonnegative_p (t); } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 309ef0286a4..08ac68f0f09 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2004-06-16 Richard Henderson + + * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill. + (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New. + * cxx-pretty-print.c (pp_cxx_function_definition): Move handling + of CTOR_INITIALIZER ... + (pp_cxx_statement): ... here. + * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK. + (finish_function): Use alloc_stmt_list to zap entire function. + * parser.c (cp_parser_compound_statement): Update commentary. + * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT. + * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise. + (finish_stmt_expr): Don't look through COMPOUND_STMT. + 2004-06-16 Geoffrey Keating * pt.c (mark_decl_instantiated): Don't call defer_fn. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 799bbcfe79d..36d493c26fd 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -50,7 +50,7 @@ struct diagnostic_context; KOENIG_LOOKUP_P (in CALL_EXPR) STATEMENT_LIST_NO_SCOPE (in STATEMENT_LIST). EXPR_STMT_STMT_EXPR_RESULT (in EXPR_STMT) - COMPOUND_STMT_TRY_BLOCK (in COMPOUND_STMT) + BIND_EXPR_TRY_BLOCK (in BIND_EXPR) 1: IDENTIFIER_VIRTUAL_P. TI_PENDING_TEMPLATE_FLAG. TEMPLATE_PARMS_FOR_INLINE. @@ -74,7 +74,7 @@ struct diagnostic_context; ICS_BAD_FLAG (in _CONV) FN_TRY_BLOCK_P (in TRY_BLOCK) IDENTIFIER_CTOR_OR_DTOR_P (in IDENTIFIER_NODE) - COMPOUND_STMT_BODY_BLOCK (in COMPOUND_STMT) + BIND_EXPR_BODY_BLOCK (in BIND_EXPR) 4: BINFO_NEW_VTABLE_MARKED. TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR, or FIELD_DECL). @@ -271,12 +271,12 @@ typedef struct ptrmem_cst * ptrmem_cst_t; #define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE)) -#define COMPOUND_STMT_TRY_BLOCK(NODE) \ - TREE_LANG_FLAG_0 (COMPOUND_STMT_CHECK (NODE)) +#define BIND_EXPR_TRY_BLOCK(NODE) \ + TREE_LANG_FLAG_0 (BIND_EXPR_CHECK (NODE)) /* Used to mark the block around the member initializers and cleanups. */ -#define COMPOUND_STMT_BODY_BLOCK(NODE) \ - TREE_LANG_FLAG_3 (COMPOUND_STMT_CHECK (NODE)) +#define BIND_EXPR_BODY_BLOCK(NODE) \ + TREE_LANG_FLAG_3 (BIND_EXPR_CHECK (NODE)) #define STATEMENT_LIST_NO_SCOPE(NODE) \ TREE_LANG_FLAG_0 (STATEMENT_LIST_CHECK (NODE)) diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index c5e667d9495..a50ecc4114c 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -1304,17 +1304,7 @@ pp_cxx_function_definition (cxx_pretty_printer *pp, tree t) pp_needs_newline (pp) = true; pp->enclosing_scope = DECL_CONTEXT (t); if (DECL_SAVED_TREE (t)) - { - tree body = DECL_SAVED_TREE (t); - if (TREE_CODE (body) == COMPOUND_STMT - && TREE_CODE (COMPOUND_BODY (body)) == CTOR_INITIALIZER) - { - body = COMPOUND_BODY (body); - pp_cxx_ctor_initializer (pp, body); - body = TREE_CHAIN (body); - } - pp_cxx_statement (pp, body); - } + pp_cxx_statement (pp, DECL_SAVED_TREE (t)); else { pp_cxx_semicolon (pp); @@ -1471,6 +1461,10 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) { switch (TREE_CODE (t)) { + case CTOR_INITIALIZER: + pp_cxx_ctor_initializer (pp, t); + break; + case USING_STMT: pp_cxx_identifier (pp, "using"); pp_cxx_identifier (pp, "namespace"); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 4a402d43895..b794b9e96f0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10618,7 +10618,6 @@ begin_function_body (void) keep_next_level (true); stmt = begin_compound_stmt (BCS_FN_BODY); - COMPOUND_STMT_BODY_BLOCK (stmt) = 1; if (processing_template_decl) /* Do nothing now. */; @@ -10743,7 +10742,7 @@ finish_function (int flags) /* Throw away the broken statement tree and extra binding levels. */ - DECL_SAVED_TREE (fndecl) = build_stmt (COMPOUND_STMT, NULL_TREE); + DECL_SAVED_TREE (fndecl) = alloc_stmt_list (); while (current_binding_level->kind != sk_function_parms) { diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ced8e6aac80..91512dee5d7 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -5841,7 +5841,7 @@ cp_parser_expression_statement (cp_parser* parser, tree in_statement_expr) compound-statement: { statement-seq [opt] } - Returns a COMPOUND_STMT representing the statement. */ + Returns a tree representing the statement. */ static tree cp_parser_compound_statement (cp_parser *parser, tree in_statement_expr, diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c174426908d..d724a13e688 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7931,18 +7931,18 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl) } break; - case COMPOUND_STMT: + case BIND_EXPR: { prep_stmt (t); - if (COMPOUND_STMT_BODY_BLOCK (t)) + if (BIND_EXPR_BODY_BLOCK (t)) stmt = begin_function_body (); else - stmt = begin_compound_stmt (COMPOUND_STMT_TRY_BLOCK (t) + stmt = begin_compound_stmt (BIND_EXPR_TRY_BLOCK (t) ? BCS_TRY_BLOCK : 0); - tsubst_expr (COMPOUND_BODY (t), args, complain, in_decl); + tsubst_expr (BIND_EXPR_BODY (t), args, complain, in_decl); - if (COMPOUND_STMT_BODY_BLOCK (t)) + if (BIND_EXPR_BODY_BLOCK (t)) finish_function_body (stmt); else finish_compound_stmt (stmt); diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 8961d8f6e46..271092a6c24 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -950,9 +950,12 @@ finish_handler (tree handler) HANDLER_BODY (handler) = do_poplevel (HANDLER_BODY (handler)); } -/* Begin a compound-statement. If HAS_NO_SCOPE is true, the - compound-statement does not define a scope. Returns a new - COMPOUND_STMT. */ +/* Begin a compound statement. FLAGS contains some bits that control the + behaviour and context. If BCS_NO_SCOPE is set, the compound statement + does not define a scope. If BCS_FN_BODY is set, this is the outermost + block of a function. If BCS_TRY_BLOCK is set, this is the block + created on behalf of a TRY statement. Returns a token to be passed to + finish_compound_stmt. */ tree begin_compound_stmt (unsigned int flags) @@ -973,24 +976,30 @@ begin_compound_stmt (unsigned int flags) else r = do_pushlevel (flags & BCS_TRY_BLOCK ? sk_try : sk_block); - if (flags & BCS_FN_BODY || processing_template_decl) + /* When processing a template, we need to remember where the braces were, + so that we can set up identical scopes when instantiating the template + later. BIND_EXPR is a handy candidate for this. + Note that do_poplevel won't create a BIND_EXPR itself here (and thus + result in nested BIND_EXPRs), since we don't build BLOCK nodes when + processing templates. */ + if (processing_template_decl) { - r = build (COMPOUND_STMT, NULL_TREE, r); - COMPOUND_STMT_TRY_BLOCK (r) = (flags & BCS_TRY_BLOCK) != 0; - COMPOUND_STMT_BODY_BLOCK (r) = (flags & BCS_FN_BODY) != 0; + r = build (BIND_EXPR, NULL, NULL, r, NULL); + BIND_EXPR_TRY_BLOCK (r) = (flags & BCS_TRY_BLOCK) != 0; + BIND_EXPR_BODY_BLOCK (r) = (flags & BCS_FN_BODY) != 0; TREE_SIDE_EFFECTS (r) = 1; } return r; } -/* Finish a compound-statement, which is given by COMPOUND_STMT. */ +/* Finish a compound-statement, which is given by STMT. */ void finish_compound_stmt (tree stmt) { - if (TREE_CODE (stmt) == COMPOUND_STMT) - COMPOUND_BODY (stmt) = do_poplevel (COMPOUND_BODY (stmt)); + if (TREE_CODE (stmt) == BIND_EXPR) + BIND_EXPR_BODY (stmt) = do_poplevel (BIND_EXPR_BODY (stmt)); else if (STATEMENT_LIST_NO_SCOPE (stmt)) stmt = pop_stmt_list (stmt); else @@ -1456,9 +1465,6 @@ finish_stmt_expr (tree stmt_expr, bool has_no_scope) case BIND_EXPR: result_stmt_p = &BIND_EXPR_BODY (t); break; - case COMPOUND_STMT: - result_stmt_p = &COMPOUND_BODY (t); - break; case TRY_FINALLY_EXPR: case TRY_CATCH_EXPR: case CLEANUP_STMT: diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi index 60eba063922..3a7fd58b241 100644 --- a/gcc/doc/c-tree.texi +++ b/gcc/doc/c-tree.texi @@ -1272,18 +1272,10 @@ This predicate holds if the function an overloaded @subsection Function Bodies @cindex function body @cindex statements -@tindex ASM_STMT -@findex ASM_STRING -@findex ASM_CV_QUAL -@findex ASM_INPUTS -@findex ASM_OUTPUTS -@findex ASM_CLOBBERS @tindex BREAK_STMT @tindex CLEANUP_STMT @findex CLEANUP_DECL @findex CLEANUP_EXPR -@tindex COMPOUND_STMT -@findex COMPOUND_BODY @tindex CONTINUE_STMT @tindex DECL_STMT @findex DECL_STMT_DECL @@ -1298,23 +1290,14 @@ This predicate holds if the function an overloaded @findex FOR_COND @findex FOR_EXPR @findex FOR_BODY -@tindex GOTO_STMT -@findex GOTO_DESTINATION -@findex GOTO_FAKE_P @tindex HANDLER @tindex IF_STMT @findex IF_COND @findex THEN_CLAUSE @findex ELSE_CLAUSE -@tindex LABEL_STMT -@tindex LABEL_STMT_LABEL @tindex RETURN_INIT @tindex RETURN_STMT @findex RETURN_EXPR -@tindex SCOPE_STMT -@findex SCOPE_BEGIN_P -@findex SCOPE_END_P -@findex SCOPE_NULLIFIED_P @tindex SUBOBJECT @findex SUBOBJECT_CLEANUP @tindex SWITCH_STMT @@ -1335,9 +1318,7 @@ have a non-@code{NULL} @code{DECL_INITIAL}. However, back ends should not make use of the particular value given by @code{DECL_INITIAL}. The @code{DECL_SAVED_TREE} macro will give the complete body of the -function. This node will usually be a @code{COMPOUND_STMT} representing -the outermost block of the function, but it may also be a -@code{TRY_BLOCK}, a @code{RETURN_INIT}, or any other valid statement. +function. @subsubsection Statements @@ -1398,7 +1379,7 @@ compound statement), the intermediate representation will sometimes use several statements chained together. @table @code -@item ASM_STMT +@item ASM_EXPR Used to represent an inline assembly statement. For an inline assembly statement like: @@ -1425,14 +1406,14 @@ embedded @code{NUL}-characters. If the assembly statement is declared @code{volatile}, or if the statement was not an extended assembly statement, and is therefore implicitly volatile, then the predicate @code{ASM_VOLATILE_P} will hold -of the @code{ASM_STMT}. +of the @code{ASM_EXPR}. @item BREAK_STMT Used to represent a @code{break} statement. There are no additional fields. -@item CASE_LABEL +@item CASE_LABEL_EXPR Use to represent a @code{case} label, range of @code{case} labels, or a @code{default} label. If @code{CASE_LOW} is @code{NULL_TREE}, then this is a @@ -1463,14 +1444,6 @@ expression to execute. The cleanups executed on exit from a scope should be run in the reverse order of the order in which the associated @code{CLEANUP_STMT}s were encountered. -@item COMPOUND_STMT - -Used to represent a brace-enclosed block. The first substatement is -given by @code{COMPOUND_BODY}. Subsequent substatements are found by -following the @code{TREE_CHAIN} link from one substatement to the next. -The @code{COMPOUND_BODY} will be @code{NULL_TREE} if there are no -substatements. - @item CONTINUE_STMT Used to represent a @code{continue} statement. There are no additional @@ -1521,15 +1494,12 @@ expression increments a counter. The body of the loop is given by return statements, while @code{FOR_COND} and @code{FOR_EXPR} return expressions. -@item GOTO_STMT +@item GOTO_EXPR Used to represent a @code{goto} statement. The @code{GOTO_DESTINATION} will usually be a @code{LABEL_DECL}. However, if the ``computed goto'' extension has been used, the @code{GOTO_DESTINATION} will be an arbitrary expression indicating the destination. This expression will always have pointer type. -Additionally the @code{GOTO_FAKE_P} flag is set whenever the goto statement -does not come from source code, but it is generated implicitly by the compiler. -This is used for branch prediction. @item HANDLER @@ -1537,8 +1507,7 @@ Used to represent a C++ @code{catch} block. The @code{HANDLER_TYPE} is the type of exception that will be caught by this handler; it is equal (by pointer equality) to @code{NULL} if this handler is for all types. @code{HANDLER_PARMS} is the @code{DECL_STMT} for the catch -parameter, and @code{HANDLER_BODY} is the @code{COMPOUND_STMT} for the -block itself. +parameter, and @code{HANDLER_BODY} is the code for the block itself. @item IF_STMT @@ -1562,10 +1531,10 @@ The @code{THEN_CLAUSE} represents the statement given by the @code{then} condition, while the @code{ELSE_CLAUSE} represents the statement given by the @code{else} condition. -@item LABEL_STMT +@item LABEL_EXPR Used to represent a label. The @code{LABEL_DECL} declared by this -statement can be obtained with the @code{LABEL_STMT_LABEL} macro. The +statement can be obtained with the @code{LABEL_EXPR_LABEL} macro. The @code{IDENTIFIER_NODE} giving the name of the label can be obtained from the @code{LABEL_DECL} with @code{DECL_NAME}. @@ -1594,17 +1563,6 @@ was just return; @end smallexample -@item SCOPE_STMT - -A scope-statement represents the beginning or end of a scope. If -@code{SCOPE_BEGIN_P} holds, this statement represents the beginning of a -scope; if @code{SCOPE_END_P} holds this statement represents the end of -a scope. On exit from a scope, all cleanups from @code{CLEANUP_STMT}s -occurring in the scope must be run, in reverse order to the order in -which they were encountered. If @code{SCOPE_NULLIFIED_P} or -@code{SCOPE_NO_CLEANUPS_P} holds of the scope, back ends should behave -as if the @code{SCOPE_STMT} were not present at all. - @item SUBOBJECT In a constructor, these nodes are used to mark the point at which a @@ -2259,11 +2217,10 @@ int f() @{ return (@{ int j; j = 3; j + 7; @}); @} In other words, an sequence of statements may occur where a single expression would normally appear. The @code{STMT_EXPR} node represents such an expression. The @code{STMT_EXPR_STMT} gives the statement -contained in the expression; this is always a @code{COMPOUND_STMT}. The -value of the expression is the value of the last sub-statement in the -@code{COMPOUND_STMT}. More precisely, the value is the value computed -by the last @code{EXPR_STMT} in the outermost scope of the -@code{COMPOUND_STMT}. For example, in: +contained in the expression. The value of the expression is the value +of the last sub-statement in the body. More precisely, the value is the +value computed by the last statement nested inside @code{BIND_EXPR}, +@code{TRY_FINALLY_EXPR}, or @code{TRY_CATCH_EXPR}. For example, in: @smallexample (@{ 3; @}) @end smallexample @@ -2271,9 +2228,8 @@ the value is @code{3} while in: @smallexample (@{ if (x) @{ 3; @} @}) @end smallexample -(represented by a nested @code{COMPOUND_STMT}), there is no value. If -the @code{STMT_EXPR} does not yield a value, it's type will be -@code{void}. +there is no value. If the @code{STMT_EXPR} does not yield a value, +it's type will be @code{void}. @item BIND_EXPR These nodes represent local blocks. The first operand is a list of diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 7891afdbc55..8946bd02cc1 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -3144,8 +3144,9 @@ objc_build_try_catch_finally_stmt (int has_catch, int has_finally) /* NB: The operative assumption here is that TRY_FINALLY_EXPR will deal with all exits from 'try_catch_blk' and route them through 'finally_blk'. */ + /* ??? This is all crock. What the hell is this trying to do? */ tree outer_blk = objc_build_finally_epilogue (); - tree prec_stmt = TREE_CHAIN (TREE_CHAIN (COMPOUND_BODY (outer_blk))); + tree prec_stmt = TREE_CHAIN (TREE_CHAIN (outer_blk)); tree try_catch_blk = TREE_CHAIN (prec_stmt), try_catch_expr; tree finally_blk = TREE_CHAIN (try_catch_blk), finally_expr; tree succ_stmt = TREE_CHAIN (finally_blk); diff --git a/gcc/tree.h b/gcc/tree.h index 5a87055ff31..db32362ec7b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1934,8 +1934,7 @@ struct tree_type GTY(()) #define DECL_THREAD_LOCAL(NODE) (VAR_DECL_CHECK (NODE)->decl.thread_local_flag) /* In a FUNCTION_DECL, the saved representation of the body of the - entire function. Usually a COMPOUND_STMT, but in C++ this may also - be a RETURN_INIT, CTOR_INITIALIZER, or TRY_BLOCK. */ + entire function. */ #define DECL_SAVED_TREE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.saved_tree) /* List of FUNCTION_DECLs inlined into this function's body. */