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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73507
138bc75d-0d04-0410-961f-
82ee72b054a4
+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>
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. */
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;
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)))
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);
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;
}
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);
};
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 };
#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;
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