dwarves: Make function__for_each_parameter receive 'cu' arg
Needed to find the right 'struct ftype' to iterate function arguments on. This is due to how BTF works with this and how we implemented it, at some point this can get improved to avoid the need for checking if it is BTF, doing it in a more format abstracted way, but for now, abstract this away in the for_each_parameter helpers. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
252b0fcc91
commit
66e640508e
@ -818,8 +818,8 @@ static __pure inline int tag__is_function(const struct tag *tag)
|
||||
* @func: struct function instance to iterate
|
||||
* @pos: struct parameter iterator
|
||||
*/
|
||||
#define function__for_each_parameter(func, pos) \
|
||||
ftype__for_each_parameter(&func->proto, pos)
|
||||
#define function__for_each_parameter(func, cu, pos) \
|
||||
ftype__for_each_parameter(func->btf ? tag__ftype(cu__type(cu, func->proto.tag.type)) : &func->proto, pos)
|
||||
|
||||
const char *function__name(struct function *func, const struct cu *cu);
|
||||
|
||||
|
2
syscse.c
2
syscse.c
@ -61,7 +61,7 @@ static void emit_wrapper(struct function *f, struct cu *cu)
|
||||
const char *name = function__name(f, cu);
|
||||
int regparm = 0, needs_wrapper = 0;
|
||||
|
||||
function__for_each_parameter(f, parm) {
|
||||
function__for_each_parameter(f, cu, parm) {
|
||||
const type_id_t type_id = parm->tag.type;
|
||||
struct tag *type = cu__type(cu, type_id);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user