From 6340cb462767aa95fcaa9151af6fb52c516c4b14 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Wed, 30 Jun 2021 10:07:14 -0300 Subject: [PATCH] core: enumeration__delete() 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 --- btf_loader.c | 2 +- ctf_loader.c | 2 +- dwarf_loader.c | 2 +- dwarves.c | 8 ++++---- dwarves.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/btf_loader.c b/btf_loader.c index c79db40..171786a 100644 --- a/btf_loader.c +++ b/btf_loader.c @@ -308,7 +308,7 @@ static int create_new_enumeration(struct cu *cu, const struct btf_type *tp, uint return 0; out_free: - enumeration__delete(enumeration, cu); + enumeration__delete(enumeration); return -ENOMEM; } diff --git a/ctf_loader.c b/ctf_loader.c index 6a68029..e2758dc 100644 --- a/ctf_loader.c +++ b/ctf_loader.c @@ -408,7 +408,7 @@ static int create_new_enumeration(struct ctf *ctf, void *ptr, return (vlen * sizeof(*ep)); out_free: - enumeration__delete(enumeration, ctf->priv); + enumeration__delete(enumeration); return -ENOMEM; } diff --git a/dwarf_loader.c b/dwarf_loader.c index 3c4a950..b172fe4 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -1417,7 +1417,7 @@ static struct tag *die__create_new_enumeration(Dwarf_Die *die, struct cu *cu, st out: return &enumeration->namespace.tag; out_delete: - enumeration__delete(enumeration, cu); + enumeration__delete(enumeration); return NULL; } diff --git a/dwarves.c b/dwarves.c index 786123d..d1bf162 100644 --- a/dwarves.c +++ b/dwarves.c @@ -126,7 +126,7 @@ void tag__delete(struct tag *tag, struct cu *cu) case DW_TAG_structure_type: class__delete(tag__class(tag)); break; case DW_TAG_enumeration_type: - enumeration__delete(tag__type(tag), cu); break; + enumeration__delete(tag__type(tag)); break; case DW_TAG_subroutine_type: ftype__delete(tag__ftype(tag), cu); break; case DW_TAG_subprogram: @@ -1129,12 +1129,12 @@ void type__delete(struct type *type) free(type); } -static void enumerator__delete(struct enumerator *enumerator, struct cu *cu) +static void enumerator__delete(struct enumerator *enumerator) { free(enumerator); } -void enumeration__delete(struct type *type, struct cu *cu) +void enumeration__delete(struct type *type) { struct enumerator *pos, *n; @@ -1143,7 +1143,7 @@ void enumeration__delete(struct type *type, struct cu *cu) type__for_each_enumerator_safe_reverse(type, pos, n) { list_del_init(&pos->tag.node); - enumerator__delete(pos, cu); + enumerator__delete(pos); } free(type); diff --git a/dwarves.h b/dwarves.h index d960668..13564ae 100644 --- a/dwarves.h +++ b/dwarves.h @@ -1284,7 +1284,7 @@ static inline const char *enumerator__name(const struct enumerator *enumerator) return enumerator->name; } -void enumeration__delete(struct type *type, struct cu *cu); +void enumeration__delete(struct type *type); void enumeration__add(struct type *type, struct enumerator *enumerator); size_t enumeration__fprintf(const struct tag *tag_enum, const struct conf_fprintf *conf, FILE *fp);