From 0f54ca9c827e9ef70fe6df050956ed0bf52961f4 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Wed, 30 Jun 2021 10:07:14 -0300 Subject: [PATCH] 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 --- ctracer.c | 2 +- dwarves.c | 3 +-- dwarves.h | 3 +-- pahole.c | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ctracer.c b/ctracer.c index 62d759f..3636297 100644 --- a/ctracer.c +++ b/ctracer.c @@ -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; diff --git a/dwarves.c b/dwarves.c index 8581268..5ca6a54 100644 --- a/dwarves.c +++ b/dwarves.c @@ -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)); diff --git a/dwarves.h b/dwarves.h index b7da064..23c7229 100644 --- a/dwarves.h +++ b/dwarves.h @@ -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) diff --git a/pahole.c b/pahole.c index 5b19b00..2be830c 100644 --- a/pahole.c +++ b/pahole.c @@ -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);