core: class__clone() doesn't need a 'cu' arg

Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2021-06-30 10:07:14 -03:00
parent 2b2014187b
commit 0f54ca9c82
4 changed files with 5 additions and 7 deletions

View File

@ -352,7 +352,7 @@ static struct class *class__clone_base_types(const struct tag *tag,
{
struct class *class = tag__class(tag);
struct class_member *pos, *next;
struct class *clone = class__clone(class, new_class_name, cu);
struct class *clone = class__clone(class, new_class_name);
if (clone == NULL)
return NULL;

View File

@ -1198,8 +1198,7 @@ static int type__clone_members(struct type *type, const struct type *from)
return 0;
}
struct class *class__clone(const struct class *from,
const char *new_class_name, struct cu *cu)
struct class *class__clone(const struct class *from, const char *new_class_name)
{
struct class *class = malloc(sizeof(*class));

View File

@ -1114,8 +1114,7 @@ static inline struct tag *class__tag(const struct class *cls)
return (struct tag *)cls;
}
struct class *class__clone(const struct class *from,
const char *new_class_name, struct cu *cu);
struct class *class__clone(const struct class *from, const char *new_class_name);
void class__delete(struct class *cls);
static inline struct list_head *class__tags(struct class *cls)

View File

@ -352,7 +352,7 @@ static int class__packable(struct class *class, struct cu *cu)
if (class->nr_holes == 0 && class->nr_bit_holes == 0)
return 0;
clone = class__clone(class, NULL, cu);
clone = class__clone(class, NULL);
if (clone == NULL)
return 0;
class__reorganize(clone, cu, 0, stdout);
@ -1363,7 +1363,7 @@ static void do_reorg(struct tag *class, struct cu *cu)
int savings;
const uint8_t reorg_verbose =
show_reorg_steps ? 2 : global_verbose;
struct class *clone = class__clone(tag__class(class), NULL, cu);
struct class *clone = class__clone(tag__class(class), NULL);
if (clone == NULL) {
fprintf(stderr, "pahole: out of memory!\n");
exit(EXIT_FAILURE);