Commit d5123bae by Mike Stump Committed by Mike Stump

c-typeck.c (c_convert_parm_for_inlining): Add argnum...

	* c-typeck.c (c_convert_parm_for_inlining): Add argnum, which
	is the argumnt we are processing so that warnings and errors
	will have that information.
	* c-tree.h (c_convert_parm_for_inlining): Add argnum.
	* lang-hooks-def.h
	(lhd_tree_inlining_convert_parm_for_inlining): Likewse.
	* langhooks.c (lhd_tree_inlining_convert_parm_for_inlining): Likewise.
	* langhooks.h (convert_parm_for_inlining): Likewise.
	* tree-inline.c (initialize_inlined_parameters): Compute and
	pass argnum down.

From-SVN: r73507
parent ea81d2a3
2003-11-12 Mike Stump <mrs@apple.com>
* c-typeck.c (c_convert_parm_for_inlining): Add argnum, which
is the argumnt we are processing so that warnings and errors
will have that information.
* c-tree.h (c_convert_parm_for_inlining): Add argnum.
* lang-hooks-def.h
(lhd_tree_inlining_convert_parm_for_inlining): Likewse.
* langhooks.c (lhd_tree_inlining_convert_parm_for_inlining): Likewise.
* langhooks.h (convert_parm_for_inlining): Likewise.
* tree-inline.c (initialize_inlined_parameters): Compute and
pass argnum down.
2003-11-12 Alexey Starovoytov <alexey.starovoytov@sun.com>
Roger Sayle <roger@eyesopen.com>
......
......@@ -273,7 +273,7 @@ extern tree c_start_case (tree);
extern void c_finish_case (void);
extern tree simple_asm_stmt (tree);
extern tree build_asm_stmt (tree, tree, tree, tree, tree);
extern tree c_convert_parm_for_inlining (tree, tree, tree);
extern tree c_convert_parm_for_inlining (tree, tree, tree, int);
/* Set to 0 at beginning of a function definition, set to 1 if
a return statement that specifies a return value is seen. */
......
......@@ -3605,10 +3605,12 @@ convert_for_assignment (tree type, tree rhs, const char *errtype,
return error_mark_node;
}
/* Convert VALUE for assignment into inlined parameter PARM. */
/* Convert VALUE for assignment into inlined parameter PARM. ARGNUM
is used for error and waring reporting and indicates which argument
is being processed. */
tree
c_convert_parm_for_inlining (tree parm, tree value, tree fn)
c_convert_parm_for_inlining (tree parm, tree value, tree fn, int argnum)
{
tree ret, type;
......@@ -3620,7 +3622,7 @@ c_convert_parm_for_inlining (tree parm, tree value, tree fn)
type = TREE_TYPE (parm);
ret = convert_for_assignment (type, value,
(char *) 0 /* arg passing */, fn,
DECL_NAME (fn), 0);
DECL_NAME (fn), argnum);
if (targetm.calls.promote_prototypes (TREE_TYPE (fn))
&& INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
......
......@@ -83,7 +83,7 @@ extern tree lhd_tree_inlining_copy_res_decl_for_inlining (tree, tree, tree,
extern int lhd_tree_inlining_anon_aggr_type_p (tree);
extern int lhd_tree_inlining_start_inlining (tree);
extern void lhd_tree_inlining_end_inlining (tree);
extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree);
extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree, int);
extern void lhd_initialize_diagnostics (struct diagnostic_context *);
extern tree lhd_callgraph_analyze_expr (tree *, int *, tree);
......
......@@ -420,7 +420,8 @@ lhd_tree_inlining_end_inlining (tree fn ATTRIBUTE_UNUSED)
tree
lhd_tree_inlining_convert_parm_for_inlining (tree parm ATTRIBUTE_UNUSED,
tree value,
tree fndecl ATTRIBUTE_UNUSED)
tree fndecl ATTRIBUTE_UNUSED,
int argnum ATTRIBUTE_UNUSED)
{
return value;
}
......
......@@ -47,7 +47,7 @@ struct lang_hooks_for_tree_inlining
bool (*var_mod_type_p) (tree);
int (*start_inlining) (tree);
void (*end_inlining) (tree);
tree (*convert_parm_for_inlining) (tree, tree, tree);
tree (*convert_parm_for_inlining) (tree, tree, tree, int);
int (*estimate_num_insns) (tree);
};
......
......@@ -5,14 +5,12 @@
static void foo (p)
int p;
{ /* { dg-warning "passing arg of" } */
{ /* { dg-warning "passing arg 1 of" } */
}
static void bar (void)
void bar (void)
{
void *vp;
foo (vp); /* { dg-warning "" } */
}
void (*tourist_guide[]) (void) = { &bar };
......@@ -729,9 +729,11 @@ initialize_inlined_parameters (inline_data *id, tree args, tree fn, tree block)
#ifdef INLINER_FOR_JAVA
tree vars = NULL_TREE;
#endif /* INLINER_FOR_JAVA */
int argnum = 0;
/* Figure out what the parameters are. */
parms = DECL_ARGUMENTS (fn);
parms =
DECL_ARGUMENTS (fn);
/* Start with no initializations whatsoever. */
init_stmts = NULL_TREE;
......@@ -749,9 +751,11 @@ initialize_inlined_parameters (inline_data *id, tree args, tree fn, tree block)
tree value;
tree var_sub;
++argnum;
/* Find the initializer. */
value = (*lang_hooks.tree_inlining.convert_parm_for_inlining)
(p, a ? TREE_VALUE (a) : NULL_TREE, fn);
(p, a ? TREE_VALUE (a) : NULL_TREE, fn, argnum);
/* If the parameter is never assigned to, we may not need to
create a new variable here at all. Instead, we may be able
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment