On Tue, Jan 24, 2023 at 01:45:27PM +0000, Alan Maguire wrote: SNIP > > return parm; > @@ -1450,7 +1504,7 @@ static struct tag *die__create_new_parameter(Dwarf_Die *die, > struct cu *cu, struct conf_load *conf, > int param_idx) > { > - struct parameter *parm = parameter__new(die, cu, conf); > + struct parameter *parm = parameter__new(die, cu, conf, param_idx); > > if (parm == NULL) > return NULL; > @@ -2209,6 +2263,10 @@ static void ftype__recode_dwarf_types(struct tag *tag, struct cu *cu) > } > pos->name = tag__parameter(dtype->tag)->name; > pos->tag.type = dtype->tag->type; > + if (pos->optimized) { > + tag__parameter(dtype->tag)->optimized = pos->optimized; > + type->optimized_parms = 1; > + } > continue; > } > > @@ -2219,6 +2277,20 @@ static void ftype__recode_dwarf_types(struct tag *tag, struct cu *cu) > } > pos->tag.type = dtype->small_id; > } > + /* if parameters were optimized out, set flag for the ftype this > + * function tag referred to via abstract origin. > + */ > + if (type->optimized_parms) { > + struct dwarf_tag *dtype = type->tag.priv; > + struct dwarf_tag *dftype; > + > + dftype = dwarf_cu__find_tag_by_ref(dcu, &dtype->abstract_origin); > + if (dftype && dftype->tag) { > + struct ftype *ftype = tag__ftype(dftype->tag); > + > + ftype->optimized_parms = 1; nit, could be: tag__ftype(dftype->tag)->optimized_parms = 1; as you did above jirka > + } > + } > }