summaryrefslogtreecommitdiffstats
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-28 01:38:11 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-28 01:38:11 +0000
commitd17251207d3e29ea9c232fb839e753d42239f083 (patch)
treefd13f92af3cb33e0387f4cd14cef0ef59efafcfc /gcc/c-decl.c
parent98c1202033333a3c6ce42b42102f9526633265c9 (diff)
downloadppe42-gcc-d17251207d3e29ea9c232fb839e753d42239f083.tar.gz
ppe42-gcc-d17251207d3e29ea9c232fb839e753d42239f083.zip
./:
* c-decl.c (add_stmt): Add C frontend specific version. (stmts_are_full_exprs_p): Remove. * c-common.h (STMT_IS_FULL_EXPR_P): Remove. (stmts_are_full_exprs_p): Don't declare. * c-semantics.c (add_stmt): Remove. cp/: * semantics.c (add_stmt): Add C++ frontend specific version. * cp-tree.h (STMT_IS_FULL_EXPR_P): Define. (stmts_are_full_exprs_p): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100289 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index d5e13abca87..d36ceb563d2 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -418,6 +418,31 @@ static tree grokdeclarator (const struct c_declarator *,
static tree grokparms (struct c_arg_info *, bool);
static void layout_array_type (tree);
+/* T is a statement. Add it to the statement-tree. This is the
+ C/ObjC version--C++ has a slightly different version of this
+ function. */
+
+tree
+add_stmt (tree t)
+{
+ enum tree_code code = TREE_CODE (t);
+
+ if (EXPR_P (t) && code != LABEL_EXPR)
+ {
+ if (!EXPR_HAS_LOCATION (t))
+ SET_EXPR_LOCATION (t, input_location);
+ }
+
+ if (code == LABEL_EXPR || code == CASE_LABEL_EXPR)
+ STATEMENT_LIST_HAS_LABEL (cur_stmt_list) = 1;
+
+ /* Add T to the statement-tree. Non-side-effect statements need to be
+ recorded during statement expressions. */
+ append_to_statement_list_force (t, &cur_stmt_list);
+
+ return t;
+}
+
/* States indicating how grokdeclarator() should handle declspecs marked
with __attribute__((deprecated)). An object declared as
__attribute__((deprecated)) suppresses warnings of uses of other
@@ -6717,16 +6742,6 @@ c_dup_lang_specific_decl (tree decl)
functions are not called from anywhere in the C front end, but as
these changes continue, that will change. */
-/* Returns nonzero if the current statement is a full expression,
- i.e. temporaries created during that statement should be destroyed
- at the end of the statement. */
-
-int
-stmts_are_full_exprs_p (void)
-{
- return 0;
-}
-
/* Returns the stmt_tree (if any) to which statements are currently
being added. If there is no active statement-tree, NULL is
returned. */
OpenPOWER on IntegriCloud