This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] misc argument changes
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: dnovillo at acm dot org, rth at redhat dot com, amacleod at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Fri, 4 May 2007 10:27:41 -0400
- Subject: [tuples] misc argument changes
Just plain noise.
Adjusting prototypes and function calls to call gimplify_expr with the right
type of arguments.
Committed.
* tree-gimple.h (get_initialized_tmp_var): Adjust prototype
for sequences.
(get_formal_tmp_var): Same.
(gimplify_type_sizes): Same.
(gimplify_one_sizepos): Same.
(gimplify_stmt): Same.
(gimplify_and_add): Same.
(gimplify_va_arg_expr): Same.
* langhooks.h (lang_hooks): Same.
* function.c (gimplify_parm_type): Adjust for sequences.
(gimplify_parameters): Same.
* c-gimplify.c (gimplify_compound_literal_expr): Same.
(c_gimplify_expr): Same.
* tree-flow.h (force_gimple_operand): Same.
* c-common.h (c_gimplify_expr): Adjust prototype for sequences.
* config/i386/i386.c (ix86_gimplify_va_arg): Adjust for sequences.
Change call to append_to_statement_list to gimplify_and_add.
Add parameter to gimplify_expr.
Index: tree-gimple.h
===================================================================
--- tree-gimple.h (revision 124186)
+++ tree-gimple.h (working copy)
@@ -29,8 +29,8 @@ Boston, MA 02110-1301, USA. */
extern tree create_tmp_var_raw (tree, const char *);
extern tree create_tmp_var_name (const char *);
extern tree create_tmp_var (tree, const char *);
-extern tree get_initialized_tmp_var (tree, tree *, tree *);
-extern tree get_formal_tmp_var (tree, tree *);
+extern tree get_initialized_tmp_var (tree, gs_seq, gs_seq);
+extern tree get_formal_tmp_var (tree, gs_seq);
extern void declare_vars (tree, tree, bool);
@@ -111,16 +111,16 @@ enum gimplify_status {
GS_ALL_DONE = 1 /* The expression is fully gimplified. */
};
-extern enum gimplify_status gimplify_expr (tree *, gs_seq, tree *, tree *,
+extern enum gimplify_status gimplify_expr (tree *, gs_seq, gs_seq, gs_seq,
bool (*) (tree), fallback_t);
-extern void gimplify_type_sizes (tree, tree *);
-extern void gimplify_one_sizepos (tree *, tree *);
-extern void gimplify_stmt (tree *);
+extern void gimplify_type_sizes (tree, gs_seq);
+extern void gimplify_one_sizepos (tree *, gs_seq);
+extern void gimplify_stmt (tree *, gs_seq);
extern void gimplify_to_stmt_list (tree *);
extern void gimplify_body (tree *, gs_seq, tree, bool);
extern void push_gimplify_context (void);
extern void pop_gimplify_context (tree);
-extern void gimplify_and_add (tree, tree *);
+extern void gimplify_and_add (tree, gs_seq);
/* Miscellaneous helpers. */
extern void gimple_add_tmp_var (tree);
@@ -131,7 +131,7 @@ extern tree build_and_jump (tree *);
extern tree alloc_stmt_list (void);
extern void free_stmt_list (tree);
extern tree force_labels_r (tree *, int *, void *);
-extern enum gimplify_status gimplify_va_arg_expr (tree *, tree *, tree *);
+extern enum gimplify_status gimplify_va_arg_expr (tree *, gs_seq, gs_seq);
struct gimplify_omp_ctx;
extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
extern tree gimple_boolify (tree);
Index: langhooks.h
===================================================================
--- langhooks.h (revision 124007)
+++ langhooks.h (working copy)
@@ -421,7 +421,7 @@ struct lang_hooks
/* Perform language-specific gimplification on the argument. Returns an
enum gimplify_status, though we can't see that type here. */
- int (*gimplify_expr) (tree *, tree *, tree *);
+ int (*gimplify_expr) (tree *, gs_seq, gs_seq, gs_seq);
/* Fold an OBJ_TYPE_REF expression to the address of a function.
KNOWN_TYPE carries the true type of the OBJ_TYPE_REF_OBJECT. */
Index: function.c
===================================================================
--- function.c (revision 124007)
+++ function.c (working copy)
@@ -3135,7 +3135,7 @@ gimplify_parm_type (tree *tp, int *walk_
else if (TYPE_SIZE (t) && !TREE_CONSTANT (TYPE_SIZE (t))
&& !TYPE_SIZES_GIMPLIFIED (t))
{
- gimplify_type_sizes (t, (tree *) data);
+ gimplify_type_sizes (t, (gs_seq) data);
*walk_subtrees = 1;
}
}
@@ -3145,15 +3145,15 @@ gimplify_parm_type (tree *tp, int *walk_
/* Gimplify the parameter list for current_function_decl. This involves
evaluating SAVE_EXPRs of variable sized parameters and generating code
- to implement callee-copies reference parameters. Returns a list of
- statements to add to the beginning of the function, or NULL if nothing
- to do. */
+ to implement callee-copies reference parameters. Returns a sequence of
+ statements to add to the beginning of the function. */
-tree
+struct gs_sequence
gimplify_parameters (void)
{
struct assign_parm_data_all all;
- tree fnargs, parm, stmts = NULL;
+ tree fnargs, parm;
+ struct gs_sequence stmts = GS_SEQ_INIT;
assign_parms_initialize_all (&all);
fnargs = assign_parms_augmented_arg_list (&all);
Index: c-gimplify.c
===================================================================
--- c-gimplify.c (revision 124007)
+++ c-gimplify.c (working copy)
@@ -179,7 +179,7 @@ c_build_bind_expr (tree block, tree body
decl instead. */
static enum gimplify_status
-gimplify_compound_literal_expr (tree *expr_p, tree *pre_p)
+gimplify_compound_literal_expr (tree *expr_p, gs_seq pre_p)
{
tree decl_s = COMPOUND_LITERAL_EXPR_DECL_STMT (*expr_p);
tree decl = DECL_EXPR_DECL (decl_s);
@@ -198,7 +198,7 @@ gimplify_compound_literal_expr (tree *ex
/* Do C-specific gimplification. Args are as for gimplify_expr. */
int
-c_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED)
+c_gimplify_expr (tree *expr_p, gs_seq pre_p, gs_seq post_p ATTRIBUTE_UNUSED)
{
enum tree_code code = TREE_CODE (*expr_p);
Index: tree-flow.h
===================================================================
--- tree-flow.h (revision 124007)
+++ tree-flow.h (working copy)
@@ -1114,7 +1114,7 @@ extern bool thread_through_all_blocks (v
extern void register_jump_thread (edge, edge);
/* In gimplify.c */
-tree force_gimple_operand (tree, tree *, bool, tree);
+tree force_gimple_operand (tree, gs_seq, bool, tree);
tree force_gimple_operand_bsi (block_stmt_iterator *, tree, bool, tree);
/* In tree-ssa-structalias.c */
Index: c-common.h
===================================================================
--- c-common.h (revision 124007)
+++ c-common.h (working copy)
@@ -888,7 +888,7 @@ extern void warn_for_div_by_zero (tree d
/* In c-gimplify.c */
extern void c_genericize (tree);
-extern int c_gimplify_expr (tree *, tree *, tree *);
+extern int c_gimplify_expr (tree *, gs_seq, gs_seq);
extern tree c_build_bind_expr (tree, tree);
/* In c-pch.c */
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 124007)
+++ config/i386/i386.c (working copy)
@@ -4674,7 +4674,7 @@ ix86_va_start (tree valist, rtx nextarg)
/* Implement va_arg. */
static tree
-ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
+ix86_gimplify_va_arg (tree valist, tree type, gs_seq pre_p, gs_seq post_p)
{
static const int intreg[6] = { 0, 1, 2, 3, 4, 5 };
tree f_gpr, f_fpr, f_ovf, f_sav;
@@ -4878,7 +4878,7 @@ ix86_gimplify_va_arg (tree valist, tree
gimplify_and_add (t, pre_p);
t = build1 (LABEL_EXPR, void_type_node, lab_false);
- append_to_statement_list (t, pre_p);
+ gimplify_and_add (t, pre_p);
}
/* ... otherwise out of the overflow area. */
@@ -4895,7 +4895,7 @@ ix86_gimplify_va_arg (tree valist, tree
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
build_int_cst (TREE_TYPE (t), -align));
}
- gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
+ gimplify_expr (&t, NULL, pre_p, NULL, is_gimple_val, fb_rvalue);
t2 = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
gimplify_and_add (t2, pre_p);