From d3ecddab5fc036fb57588a9bfff73575dc419052 Mon Sep 17 00:00:00 2001 From: Christian Biesinger Date: Wed, 11 Dec 2019 19:50:43 -0500 Subject: Use a member function to set a symbol's language This removes symbol_set_language and SYMBOL_SET_LANGUAGE in favor of a new function general_symbol_info::set_language. symbol and minimal_symbol already inherit from that struct so this works naturally. gdb/ChangeLog: 2019-12-15 Christian Biesinger * ada-exp.y (write_ambiguous_var): Update. * coffread.c (process_coff_symbol): Update. * ctfread.c (ctf_add_enum_member_cb): Update. (new_symbol): Update. * dwarf2read.c (fixup_go_packaging): Update. (new_symbol): Update. * language.c (language_alloc_type_symbol): Update. * mdebugread.c (new_symbol): Update. * minsyms.c (minimal_symbol_reader::record_full): Update. * psymtab.c (add_psymbol_to_bcache): Update. * stabsread.c (define_symbol): Update. (read_enum_type): Update. * symtab.c (symbol_set_language): Make this a member function... (general_symbol_info::set_language): ... here. * symtab.h (struct general_symbol_info) : New function. (SYMBOL_SET_LANGUAGE): Remove. (symbol_set_language): Remove. Change-Id: Ideafb6c384004b9adef793a1192735c501da41d5 --- gdb/symtab.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'gdb/symtab.h') diff --git a/gdb/symtab.h b/gdb/symtab.h index 09e2a20..e18cd65 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -428,6 +428,10 @@ struct general_symbol_info enum language language () const { return m_language; } + /* Initializes the language dependent portion of a symbol + depending upon the language for the symbol. */ + void set_language (enum language language, struct obstack *obstack); + /* Name of the symbol. This is a required field. Storage for the name is allocated on the objfile_obstack for the associated objfile. For languages like C++ that make a distinction between @@ -531,14 +535,6 @@ extern CORE_ADDR get_symbol_address (const struct symbol *sym); ? (&(((objfile)->sections)[(symbol)->section])) \ : NULL) -/* Initializes the language dependent portion of a symbol - depending upon the language for the symbol. */ -#define SYMBOL_SET_LANGUAGE(symbol,language,obstack) \ - (symbol_set_language ((symbol), (language), (obstack))) -extern void symbol_set_language (struct general_symbol_info *symbol, - enum language language, - struct obstack *obstack); - /* Try to determine the demangled name for a symbol, based on the language of that symbol. If the language is set to language_auto, it will attempt to find any demangling algorithm that works and -- cgit v1.1