diff --git a/pfunct.c b/pfunct.c index 73ddd84..bc8e4ab 100644 --- a/pfunct.c +++ b/pfunct.c @@ -33,6 +33,7 @@ static bool expand_types; static bool compilable_output; static struct type_emissions emissions; static uint64_t addr; +static char *class_name; static char *function_name; static struct conf_fprintf conf; @@ -505,6 +506,8 @@ static enum load_steal_kind pfunct_stealer(struct cu *cu, struct conf_load *conf function__show(tag__function(tag), cu); return LSK__STOP_LOADING; } + } else if (class_name) { + cu_class_iterator(cu, class_name); } return LSK__DELETE; @@ -647,7 +650,6 @@ static const struct argp_option pfunct__options[] = { }; static void (*formatter)(const struct fn_stats *f) = fn_stats_fmtr; -static char *class_name; static int show_total_inline_expansion_stats; static error_t pfunct__options_parser(int key, char *arg, @@ -737,7 +739,7 @@ int main(int argc, char *argv[]) goto out_dwarves_exit; } - if (function_name) + if (function_name || class_name) conf_load.steal = pfunct_stealer; try_sole_arg_as_function_name: @@ -773,8 +775,6 @@ try_sole_arg_as_function_name: function__show(f, cu); } else if (show_total_inline_expansion_stats) print_total_inline_stats(); - else if (class_name != NULL) - cus__for_each_cu(cus, cu_class_iterator, class_name, NULL); else if (function_name != NULL || expand_types) cus__for_each_cu(cus, cu_function_iterator, function_name, NULL);