From 45ec63ed20a56557a96b4e5b962b7e501d4cb641 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 25 Jun 2021 09:56:00 -0300 Subject: [PATCH] core: enumeration__calc_prefix doesn't need a 'cu' argument With the conversion of ->name members to plain char strings, no need to use 'cu' to get the old string_t index and find the per-cu string table. Signed-off-by: Arnaldo Carvalho de Melo --- dwarves.c | 8 ++++---- dwarves.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dwarves.c b/dwarves.c index 3ee924c..9d6ff19 100644 --- a/dwarves.c +++ b/dwarves.c @@ -1706,7 +1706,7 @@ static int strcommon(const char *a, const char *b) return i; } -void enumeration__calc_prefix(struct type *enumeration, const struct cu *cu) +void enumeration__calc_prefix(struct type *enumeration) { if (enumeration->member_prefix) return; @@ -1743,13 +1743,13 @@ void enumerations__calc_prefix(struct list_head *enumerations) struct tag_cu_node *pos; list_for_each_entry(pos, enumerations, node) - enumeration__calc_prefix(tag__type(pos->tc.tag), pos->tc.cu); + enumeration__calc_prefix(tag__type(pos->tc.tag)); } const char *enumeration__prefix(struct type *enumeration, const struct cu *cu) { if (!enumeration->member_prefix) - enumeration__calc_prefix(enumeration, cu); + enumeration__calc_prefix(enumeration); return enumeration->member_prefix; } @@ -1757,7 +1757,7 @@ const char *enumeration__prefix(struct type *enumeration, const struct cu *cu) uint16_t enumeration__prefix_len(struct type *enumeration, const struct cu *cu) { if (!enumeration->member_prefix) - enumeration__calc_prefix(enumeration, cu); + enumeration__calc_prefix(enumeration); return enumeration->member_prefix_len; } diff --git a/dwarves.h b/dwarves.h index 293c9fb..5a664bf 100644 --- a/dwarves.h +++ b/dwarves.h @@ -1087,7 +1087,7 @@ struct class_member *type__find_member_by_name(const struct type *type, const ch uint32_t type__nr_members_of_type(const struct type *type, const type_id_t oftype); struct class_member *type__last_member(struct type *type); -void enumeration__calc_prefix(struct type *type, const struct cu *cu); +void enumeration__calc_prefix(struct type *type); const char *enumeration__prefix(struct type *type, const struct cu *cu); uint16_t enumeration__prefix_len(struct type *type, const struct cu *cu); int enumeration__max_entry_name_len(struct type *type, const struct cu *cu);