diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-25 19:03:41 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-25 19:03:41 +0000 |
commit | 7219fab5f2729f3e4a2e67f0dbaa30b8c3af4c18 (patch) | |
tree | 04c6f7b2baf3f9d03ae1167e9d3db012d53a4e00 /gcc/c-gimplify.c | |
parent | d34440fb1399385426c75bbb66b92fc38d5980ec (diff) | |
download | gcc-7219fab5f2729f3e4a2e67f0dbaa30b8c3af4c18.tar.gz |
./
* c-common.def (EXPR_STMT): Remove, moved to C++ frontend.
* c-common.h (EXPR_STMT_EXPR): Don't define.
(c_common_stmt_codes): Don't define.
* c-dump.c (c_dump_tree): Remove EXPR_STMT case.
* c-gimplify.c (gimplify_expr_stmt): Remove.
(c_gimplify_expr): Remove EXPR_STMT case.
* c-objc-common.c (c_objc_common_init): Remove stmt_codes and call
to INIT_STATEMENT_CODES.
* c-pretty-print.c (pp_c_statement): Just call dump_generic_node.
cp/
* cp-tree.def: Add EXPR_STMT.
* cp-tree.h (cp_stmt_codes): Add EXPR_STMT.
(EXPR_STMT_EXPR): Define.
* cp-gimplify.c: Include "flags.h".
(gimplify_expr_stmt): New static function.
(cp_gimplify_expr): Handle EXPR_STMT.
* cxx-pretty-print.c (pp_cxx_statement): Use pp_cxx_expression
rather than pp_expression.
(pp_cxx_statement): Handle EXPR_STMT.
* dump.c (cp_dump_tree): Handle EXPR_STMT.
* lex.c (cxx_init): Don't use c_common_stmt_codes in stmt_codes
initializer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98731 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-gimplify.c')
-rw-r--r-- | gcc/c-gimplify.c | 54 |
1 files changed, 3 insertions, 51 deletions
diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c index 70db9f249a8..a82c4a6562b 100644 --- a/gcc/c-gimplify.c +++ b/gcc/c-gimplify.c @@ -173,56 +173,11 @@ c_build_bind_expr (tree block, tree body) return bind; } -/* Gimplify an EXPR_STMT node. - - STMT is the statement node. - - PRE_P points to the list where side effects that must happen before - STMT should be stored. - - POST_P points to the list where side effects that must happen after - STMT should be stored. */ - -static enum gimplify_status -gimplify_expr_stmt (tree *stmt_p) -{ - tree stmt = EXPR_STMT_EXPR (*stmt_p); - - if (stmt == error_mark_node) - stmt = NULL; - - /* Gimplification of a statement expression will nullify the - statement if all its side effects are moved to *PRE_P and *POST_P. - - In this case we will not want to emit the gimplified statement. - However, we may still want to emit a warning, so we do that before - gimplification. */ - if (stmt && (extra_warnings || warn_unused_value)) - { - if (!TREE_SIDE_EFFECTS (stmt)) - { - if (!IS_EMPTY_STMT (stmt) - && !VOID_TYPE_P (TREE_TYPE (stmt)) - && !TREE_NO_WARNING (stmt)) - warning (0, "statement with no effect"); - } - else if (warn_unused_value) - warn_if_unused_value (stmt, input_location); - } - - if (stmt == NULL_TREE) - stmt = alloc_stmt_list (); - - *stmt_p = stmt; - - return GS_OK; -} - /* Gimplification of expression trees. */ -/* Gimplify a C99 compound literal expression. This just means adding the - DECL_EXPR before the current EXPR_STMT and using its anonymous decl - instead. */ +/* Gimplify a C99 compound literal expression. This just means adding + the DECL_EXPR before the current statement and using its anonymous + decl instead. */ static enum gimplify_status gimplify_compound_literal_expr (tree *expr_p, tree *pre_p) @@ -266,9 +221,6 @@ c_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED) case COMPOUND_LITERAL_EXPR: return gimplify_compound_literal_expr (expr_p, pre_p); - case EXPR_STMT: - return gimplify_expr_stmt (expr_p); - default: return GS_UNHANDLED; } |