summaryrefslogtreecommitdiff
path: root/gcc/c-gimplify.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-23 07:43:21 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-23 07:43:21 +0000
commitb64311263afb0341bc5cc019230b6d5f6d1b185a (patch)
tree8a64183917aa821491a290388a2d847ef5f31dc6 /gcc/c-gimplify.c
parentd7c19af34733348ff30e9c8d1b11695aa079150c (diff)
downloadgcc-b64311263afb0341bc5cc019230b6d5f6d1b185a.tar.gz
* c-gimplify.c (gimplify_decl_stmt): Update gimplify_type_sizes call.
Use gimplify_and_add. * c-typeck.c (c_finish_if_stmt): Use NULL instead of empty stmt. * gimplify.c (build_and_jump, gimplify_exit_expr, gimplify_init_constructor, gimplify_save_expr, gimple_push_cleanup, gimplify_stmt, gimplify_expr): Likewise. (shortcut_cond_expr): Handle NULL arms of COND_EXPR. (gimplify_statement_list): Remove NULL entries. (gimplify_to_stmt_list): Handle NULL results. (gimplify_type_sizes): Add list_p argument. (gimplify_one_sizepos): Don't use internal pre/post queue. * tree-gimple.h (gimplify_type_sizes): Update. ada/ * trans.c (gnat_gimplify_stmt): Update gimplify_type_sizes call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83539 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-gimplify.c')
-rw-r--r--gcc/c-gimplify.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c
index 113a09d1b16..a3040d0bcd2 100644
--- a/gcc/c-gimplify.c
+++ b/gcc/c-gimplify.c
@@ -476,20 +476,18 @@ gimplify_decl_stmt (tree *stmt_p)
tree stmt = *stmt_p;
tree decl = DECL_STMT_DECL (stmt);
+ *stmt_p = NULL_TREE;
+
if (TREE_TYPE (decl) == error_mark_node)
- {
- *stmt_p = NULL;
- return GS_ERROR;
- }
-
+ return GS_ERROR;
+
if (TREE_CODE (decl) == TYPE_DECL)
- *stmt_p = gimplify_type_sizes (TREE_TYPE (decl));
+ gimplify_type_sizes (TREE_TYPE (decl), stmt_p);
else if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl))
{
tree init = DECL_INITIAL (decl);
- *stmt_p = NULL_TREE;
gimplify_one_sizepos (&DECL_SIZE (decl), stmt_p);
gimplify_one_sizepos (&DECL_SIZE_UNIT (decl), stmt_p);
@@ -508,8 +506,7 @@ gimplify_decl_stmt (tree *stmt_p)
tree_cons (NULL_TREE, DECL_SIZE_UNIT (decl),
NULL_TREE))));
- gimplify_stmt (&alloc_stmt);
- append_to_statement_list(alloc_stmt, stmt_p);
+ gimplify_and_add (alloc_stmt, stmt_p);
DECL_DEFER_OUTPUT (decl) = 1;
}
@@ -525,8 +522,7 @@ gimplify_decl_stmt (tree *stmt_p)
DECL_INITIAL (decl) = NULL_TREE;
init = build (MODIFY_EXPR, void_type_node, decl, init);
- gimplify_stmt (&init);
- append_to_statement_list (init, stmt_p);
+ gimplify_and_add (init, stmt_p);
}
else
/* We must still examine initializers for static variables
@@ -540,8 +536,6 @@ gimplify_decl_stmt (tree *stmt_p)
if (DECL_ARTIFICIAL (decl) && DECL_NAME (decl) == NULL_TREE)
gimple_add_tmp_var (decl);
}
- else
- *stmt_p = alloc_stmt_list ();
return GS_ALL_DONE;
}