gdb: remove SYMBOL_CLASS macro, add getter

Change-Id: I83211d5a47efc0564386e5b5ea4a29c00b1fd46a
This commit is contained in:
Simon Marchi 2021-11-21 22:26:24 -05:00
parent d1eebf9a6f
commit 66d7f48f80
42 changed files with 147 additions and 144 deletions

View file

@ -1157,7 +1157,7 @@ write_object_renaming (struct parser_state *par_state,
ada_lookup_encoded_symbol (name, orig_left_context, VAR_DOMAIN, &sym_info); ada_lookup_encoded_symbol (name, orig_left_context, VAR_DOMAIN, &sym_info);
if (sym_info.symbol == NULL) if (sym_info.symbol == NULL)
error (_("Could not find renamed variable: %s"), ada_decode (name).c_str ()); error (_("Could not find renamed variable: %s"), ada_decode (name).c_str ());
else if (SYMBOL_CLASS (sym_info.symbol) == LOC_TYPEDEF) else if (sym_info.symbol->aclass () == LOC_TYPEDEF)
/* We have a renaming of an old-style renaming symbol. Don't /* We have a renaming of an old-style renaming symbol. Don't
trust the block information. */ trust the block information. */
sym_info.block = orig_left_context; sym_info.block = orig_left_context;
@ -1226,7 +1226,7 @@ write_object_renaming (struct parser_state *par_state,
VAR_DOMAIN, &index_sym_info); VAR_DOMAIN, &index_sym_info);
if (index_sym_info.symbol == NULL) if (index_sym_info.symbol == NULL)
error (_("Could not find %s"), index_name); error (_("Could not find %s"), index_name);
else if (SYMBOL_CLASS (index_sym_info.symbol) == LOC_TYPEDEF) else if (index_sym_info.symbol->aclass () == LOC_TYPEDEF)
/* Index is an old-style renaming symbol. */ /* Index is an old-style renaming symbol. */
index_sym_info.block = orig_left_context; index_sym_info.block = orig_left_context;
write_var_from_sym (par_state, index_sym_info); write_var_from_sym (par_state, index_sym_info);
@ -1296,14 +1296,14 @@ block_lookup (const struct block *context, const char *raw_name)
= ada_lookup_symbol_list (name, context, VAR_DOMAIN); = ada_lookup_symbol_list (name, context, VAR_DOMAIN);
if (context == NULL if (context == NULL
&& (syms.empty () || SYMBOL_CLASS (syms[0].symbol) != LOC_BLOCK)) && (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK))
symtab = lookup_symtab (name); symtab = lookup_symtab (name);
else else
symtab = NULL; symtab = NULL;
if (symtab != NULL) if (symtab != NULL)
result = BLOCKVECTOR_BLOCK (symtab->blockvector (), STATIC_BLOCK); result = BLOCKVECTOR_BLOCK (symtab->blockvector (), STATIC_BLOCK);
else if (syms.empty () || SYMBOL_CLASS (syms[0].symbol) != LOC_BLOCK) else if (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK)
{ {
if (context == NULL) if (context == NULL)
error (_("No file or function \"%s\"."), raw_name); error (_("No file or function \"%s\"."), raw_name);
@ -1329,7 +1329,7 @@ select_possible_type_sym (const std::vector<struct block_symbol> &syms)
preferred_index = -1; preferred_type = NULL; preferred_index = -1; preferred_type = NULL;
for (i = 0; i < syms.size (); i += 1) for (i = 0; i < syms.size (); i += 1)
switch (SYMBOL_CLASS (syms[i].symbol)) switch (syms[i].symbol->aclass ())
{ {
case LOC_TYPEDEF: case LOC_TYPEDEF:
if (ada_prefer_type (SYMBOL_TYPE (syms[i].symbol), preferred_type)) if (ada_prefer_type (SYMBOL_TYPE (syms[i].symbol), preferred_type))
@ -1373,7 +1373,7 @@ find_primitive_type (struct parser_state *par_state, const char *name)
strcpy (expanded_name, "standard__"); strcpy (expanded_name, "standard__");
strcat (expanded_name, name); strcat (expanded_name, name);
sym = ada_lookup_symbol (expanded_name, NULL, VAR_DOMAIN).symbol; sym = ada_lookup_symbol (expanded_name, NULL, VAR_DOMAIN).symbol;
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF) if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
type = SYMBOL_TYPE (sym); type = SYMBOL_TYPE (sym);
} }
@ -1690,7 +1690,7 @@ write_name_assoc (struct parser_state *par_state, struct stoken name)
par_state->expression_context_block, par_state->expression_context_block,
VAR_DOMAIN); VAR_DOMAIN);
if (syms.size () != 1 || SYMBOL_CLASS (syms[0].symbol) == LOC_TYPEDEF) if (syms.size () != 1 || syms[0].symbol->aclass () == LOC_TYPEDEF)
pstate->push_new<ada_string_operation> (copy_name (name)); pstate->push_new<ada_string_operation> (copy_name (name));
else else
write_var_from_sym (par_state, syms[0]); write_var_from_sym (par_state, syms[0]);

View file

@ -3325,7 +3325,7 @@ See set/show multiple-symbol."));
if (syms[i].symbol == NULL) if (syms[i].symbol == NULL)
continue; continue;
if (SYMBOL_CLASS (syms[i].symbol) == LOC_BLOCK) if (syms[i].symbol->aclass () == LOC_BLOCK)
{ {
struct symtab_and_line sal = struct symtab_and_line sal =
find_function_start_sal (syms[i].symbol, 1); find_function_start_sal (syms[i].symbol, 1);
@ -3347,7 +3347,7 @@ See set/show multiple-symbol."));
else else
{ {
int is_enumeral = int is_enumeral =
(SYMBOL_CLASS (syms[i].symbol) == LOC_CONST (syms[i].symbol->aclass () == LOC_CONST
&& SYMBOL_TYPE (syms[i].symbol) != NULL && SYMBOL_TYPE (syms[i].symbol) != NULL
&& SYMBOL_TYPE (syms[i].symbol)->code () == TYPE_CODE_ENUM); && SYMBOL_TYPE (syms[i].symbol)->code () == TYPE_CODE_ENUM);
struct symtab *symtab = NULL; struct symtab *symtab = NULL;
@ -3491,7 +3491,7 @@ ada_resolve_variable (struct symbol *sym, const struct block *block,
candidates.end (), candidates.end (),
[] (block_symbol &bsym) [] (block_symbol &bsym)
{ {
switch (SYMBOL_CLASS (bsym.symbol)) switch (bsym.symbol->aclass ())
{ {
case LOC_REGISTER: case LOC_REGISTER:
case LOC_ARG: case LOC_ARG:
@ -3514,7 +3514,7 @@ ada_resolve_variable (struct symbol *sym, const struct block *block,
candidates.end (), candidates.end (),
[] (block_symbol &bsym) [] (block_symbol &bsym)
{ {
return SYMBOL_CLASS (bsym.symbol) == LOC_TYPEDEF; return bsym.symbol->aclass () == LOC_TYPEDEF;
}), }),
candidates.end ()); candidates.end ());
} }
@ -3628,7 +3628,7 @@ ada_args_match (struct symbol *func, struct value **actuals, int n_actuals)
int i; int i;
struct type *func_type = SYMBOL_TYPE (func); struct type *func_type = SYMBOL_TYPE (func);
if (SYMBOL_CLASS (func) == LOC_CONST if (func->aclass () == LOC_CONST
&& func_type->code () == TYPE_CODE_ENUM) && func_type->code () == TYPE_CODE_ENUM)
return (n_actuals == 0); return (n_actuals == 0);
else if (func_type == NULL || func_type->code () != TYPE_CODE_FUNC) else if (func_type == NULL || func_type->code () != TYPE_CODE_FUNC)
@ -3934,7 +3934,7 @@ ada_parse_renaming (struct symbol *sym,
if (sym == NULL) if (sym == NULL)
return ADA_NOT_RENAMING; return ADA_NOT_RENAMING;
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
default: default:
return ADA_NOT_RENAMING; return ADA_NOT_RENAMING;
@ -4443,7 +4443,7 @@ is_nonfunction (const std::vector<struct block_symbol> &syms)
for (const block_symbol &sym : syms) for (const block_symbol &sym : syms)
if (SYMBOL_TYPE (sym.symbol)->code () != TYPE_CODE_FUNC if (SYMBOL_TYPE (sym.symbol)->code () != TYPE_CODE_FUNC
&& (SYMBOL_TYPE (sym.symbol)->code () != TYPE_CODE_ENUM && (SYMBOL_TYPE (sym.symbol)->code () != TYPE_CODE_ENUM
|| SYMBOL_CLASS (sym.symbol) != LOC_CONST)) || sym.symbol->aclass () != LOC_CONST))
return 1; return 1;
return 0; return 0;
@ -4478,10 +4478,10 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
if (sym0 == sym1) if (sym0 == sym1)
return 1; return 1;
if (SYMBOL_DOMAIN (sym0) != SYMBOL_DOMAIN (sym1) if (SYMBOL_DOMAIN (sym0) != SYMBOL_DOMAIN (sym1)
|| SYMBOL_CLASS (sym0) != SYMBOL_CLASS (sym1)) || sym0->aclass () != sym1->aclass ())
return 0; return 0;
switch (SYMBOL_CLASS (sym0)) switch (sym0->aclass ())
{ {
case LOC_UNDEF: case LOC_UNDEF:
return 1; return 1;
@ -4743,7 +4743,7 @@ remove_extra_symbols (std::vector<struct block_symbol> *syms)
should be identical. */ should be identical. */
else if ((*syms)[i].symbol->linkage_name () != NULL else if ((*syms)[i].symbol->linkage_name () != NULL
&& SYMBOL_CLASS ((*syms)[i].symbol) == LOC_STATIC && (*syms)[i].symbol->aclass () == LOC_STATIC
&& is_nondebugging_type (SYMBOL_TYPE ((*syms)[i].symbol))) && is_nondebugging_type (SYMBOL_TYPE ((*syms)[i].symbol)))
{ {
for (j = 0; j < syms->size (); j += 1) for (j = 0; j < syms->size (); j += 1)
@ -4752,8 +4752,8 @@ remove_extra_symbols (std::vector<struct block_symbol> *syms)
&& (*syms)[j].symbol->linkage_name () != NULL && (*syms)[j].symbol->linkage_name () != NULL
&& strcmp ((*syms)[i].symbol->linkage_name (), && strcmp ((*syms)[i].symbol->linkage_name (),
(*syms)[j].symbol->linkage_name ()) == 0 (*syms)[j].symbol->linkage_name ()) == 0
&& SYMBOL_CLASS ((*syms)[i].symbol) && ((*syms)[i].symbol->aclass ()
== SYMBOL_CLASS ((*syms)[j].symbol) == (*syms)[j].symbol->aclass ())
&& SYMBOL_VALUE_ADDRESS ((*syms)[i].symbol) && SYMBOL_VALUE_ADDRESS ((*syms)[i].symbol)
== SYMBOL_VALUE_ADDRESS ((*syms)[j].symbol)) == SYMBOL_VALUE_ADDRESS ((*syms)[j].symbol))
remove_p = 1; remove_p = 1;
@ -4845,7 +4845,7 @@ is_package_name (const char *name)
static int static int
old_renaming_is_invisible (const struct symbol *sym, const char *function_name) old_renaming_is_invisible (const struct symbol *sym, const char *function_name)
{ {
if (SYMBOL_CLASS (sym) != LOC_TYPEDEF) if (sym->aclass () != LOC_TYPEDEF)
return 0; return 0;
std::string scope = xget_renaming_scope (SYMBOL_TYPE (sym)); std::string scope = xget_renaming_scope (SYMBOL_TYPE (sym));
@ -4924,7 +4924,7 @@ remove_irrelevant_renamings (std::vector<struct block_symbol> *syms,
const char *name; const char *name;
const char *suffix; const char *suffix;
if (sym == NULL || SYMBOL_CLASS (sym) == LOC_TYPEDEF) if (sym == NULL || sym->aclass () == LOC_TYPEDEF)
continue; continue;
name = sym->linkage_name (); name = sym->linkage_name ();
suffix = strstr (name, "___XR"); suffix = strstr (name, "___XR");
@ -5051,7 +5051,7 @@ match_data::operator() (struct block_symbol *bsym)
} }
else else
{ {
if (SYMBOL_CLASS (sym) == LOC_UNRESOLVED) if (sym->aclass () == LOC_UNRESOLVED)
return true; return true;
else if (SYMBOL_IS_ARGUMENT (sym)) else if (SYMBOL_IS_ARGUMENT (sym))
arg_sym = sym; arg_sym = sym;
@ -5742,7 +5742,7 @@ ada_add_block_symbols (std::vector<struct block_symbol> &result,
{ {
if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain)) if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain))
{ {
if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED) if (sym->aclass () != LOC_UNRESOLVED)
{ {
if (SYMBOL_IS_ARGUMENT (sym)) if (SYMBOL_IS_ARGUMENT (sym))
arg_sym = sym; arg_sym = sym;
@ -5796,7 +5796,7 @@ ada_add_block_symbols (std::vector<struct block_symbol> &result,
if (cmp == 0 if (cmp == 0
&& is_name_suffix (sym->linkage_name () + name_len + 5)) && is_name_suffix (sym->linkage_name () + name_len + 5))
{ {
if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED) if (sym->aclass () != LOC_UNRESOLVED)
{ {
if (SYMBOL_IS_ARGUMENT (sym)) if (SYMBOL_IS_ARGUMENT (sym))
arg_sym = sym; arg_sym = sym;
@ -7214,7 +7214,7 @@ ada_find_any_type_symbol (const char *name)
struct symbol *sym; struct symbol *sym;
sym = standard_lookup (name, get_selected_block (NULL), VAR_DOMAIN); sym = standard_lookup (name, get_selected_block (NULL), VAR_DOMAIN);
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF) if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
return sym; return sym;
sym = standard_lookup (name, NULL, STRUCT_DOMAIN); sym = standard_lookup (name, NULL, STRUCT_DOMAIN);
@ -11253,10 +11253,10 @@ ada_has_this_exception_support (const struct exception_support_info *einfo)
/* Make sure that the symbol we found corresponds to a function. */ /* Make sure that the symbol we found corresponds to a function. */
if (SYMBOL_CLASS (sym) != LOC_BLOCK) if (sym->aclass () != LOC_BLOCK)
{ {
error (_("Symbol \"%s\" is not a function (class = %d)"), error (_("Symbol \"%s\" is not a function (class = %d)"),
sym->linkage_name (), SYMBOL_CLASS (sym)); sym->linkage_name (), sym->aclass ());
return 0; return 0;
} }
@ -11276,10 +11276,10 @@ ada_has_this_exception_support (const struct exception_support_info *einfo)
/* Make sure that the symbol we found corresponds to a function. */ /* Make sure that the symbol we found corresponds to a function. */
if (SYMBOL_CLASS (sym) != LOC_BLOCK) if (sym->aclass () != LOC_BLOCK)
{ {
error (_("Symbol \"%s\" is not a function (class = %d)"), error (_("Symbol \"%s\" is not a function (class = %d)"),
sym->linkage_name (), SYMBOL_CLASS (sym)); sym->linkage_name (), sym->aclass ());
return 0; return 0;
} }
@ -12246,7 +12246,7 @@ ada_exception_sal (enum ada_exception_catchpoint_kind ex,
if (sym == NULL) if (sym == NULL)
error (_("Catchpoint symbol not found: %s"), sym_name); error (_("Catchpoint symbol not found: %s"), sym_name);
if (SYMBOL_CLASS (sym) != LOC_BLOCK) if (sym->aclass () != LOC_BLOCK)
error (_("Unable to insert catchpoint. %s is not a function."), sym_name); error (_("Unable to insert catchpoint. %s is not a function."), sym_name);
/* Set ADDR_STRING. */ /* Set ADDR_STRING. */
@ -12420,10 +12420,10 @@ ada_is_exception_sym (struct symbol *sym)
{ {
const char *type_name = SYMBOL_TYPE (sym)->name (); const char *type_name = SYMBOL_TYPE (sym)->name ();
return (SYMBOL_CLASS (sym) != LOC_TYPEDEF return (sym->aclass () != LOC_TYPEDEF
&& SYMBOL_CLASS (sym) != LOC_BLOCK && sym->aclass () != LOC_BLOCK
&& SYMBOL_CLASS (sym) != LOC_CONST && sym->aclass () != LOC_CONST
&& SYMBOL_CLASS (sym) != LOC_UNRESOLVED && sym->aclass () != LOC_UNRESOLVED
&& type_name != NULL && strcmp (type_name, "exception") == 0); && type_name != NULL && strcmp (type_name, "exception") == 0);
} }
@ -12545,7 +12545,7 @@ ada_add_exceptions_from_frame (compiled_regex *preg,
ALL_BLOCK_SYMBOLS (block, iter, sym) ALL_BLOCK_SYMBOLS (block, iter, sym)
{ {
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
case LOC_TYPEDEF: case LOC_TYPEDEF:
case LOC_BLOCK: case LOC_BLOCK:

View file

@ -520,7 +520,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
} }
/* I'm imitating the code in read_var_value. */ /* I'm imitating the code in read_var_value. */
switch (SYMBOL_CLASS (var)) switch (var->aclass ())
{ {
case LOC_CONST: /* A constant, like an enum value. */ case LOC_CONST: /* A constant, like an enum value. */
ax_const_l (ax, (LONGEST) SYMBOL_VALUE (var)); ax_const_l (ax, (LONGEST) SYMBOL_VALUE (var));

View file

@ -665,7 +665,7 @@ bool
best_symbol (struct symbol *a, const domain_enum domain) best_symbol (struct symbol *a, const domain_enum domain)
{ {
return (SYMBOL_DOMAIN (a) == domain return (SYMBOL_DOMAIN (a) == domain
&& SYMBOL_CLASS (a) != LOC_UNRESOLVED); && a->aclass () != LOC_UNRESOLVED);
} }
/* See block.h. */ /* See block.h. */
@ -685,11 +685,10 @@ better_symbol (struct symbol *a, struct symbol *b, const domain_enum domain)
&& SYMBOL_DOMAIN (a) != domain) && SYMBOL_DOMAIN (a) != domain)
return b; return b;
if (SYMBOL_CLASS (a) != LOC_UNRESOLVED if (a->aclass () != LOC_UNRESOLVED && b->aclass () == LOC_UNRESOLVED)
&& SYMBOL_CLASS (b) == LOC_UNRESOLVED)
return a; return a;
if (SYMBOL_CLASS (b) != LOC_UNRESOLVED
&& SYMBOL_CLASS (a) == LOC_UNRESOLVED) if (b->aclass () != LOC_UNRESOLVED && a->aclass () == LOC_UNRESOLVED)
return b; return b;
return a; return a;

View file

@ -1093,7 +1093,7 @@ block : block COLONCOLON name
= lookup_symbol (copy.c_str (), $1, = lookup_symbol (copy.c_str (), $1,
VAR_DOMAIN, NULL).symbol; VAR_DOMAIN, NULL).symbol;
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) if (!tem || tem->aclass () != LOC_BLOCK)
error (_("No function \"%s\" in specified context."), error (_("No function \"%s\" in specified context."),
copy.c_str ()); copy.c_str ());
$$ = SYMBOL_BLOCK_VALUE (tem); } $$ = SYMBOL_BLOCK_VALUE (tem); }
@ -3067,7 +3067,7 @@ classify_name (struct parser_state *par_state, const struct block *block,
par_state->language ()->name_of_this () par_state->language ()->name_of_this ()
? &is_a_field_of_this : NULL); ? &is_a_field_of_this : NULL);
if (bsym.symbol && SYMBOL_CLASS (bsym.symbol) == LOC_BLOCK) if (bsym.symbol && bsym.symbol->aclass () == LOC_BLOCK)
{ {
yylval.ssym.sym = bsym; yylval.ssym.sym = bsym;
yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL; yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
@ -3116,7 +3116,7 @@ classify_name (struct parser_state *par_state, const struct block *block,
} }
} }
if (bsym.symbol && SYMBOL_CLASS (bsym.symbol) == LOC_TYPEDEF) if (bsym.symbol && bsym.symbol->aclass () == LOC_TYPEDEF)
{ {
yylval.tsym.type = SYMBOL_TYPE (bsym.symbol); yylval.tsym.type = SYMBOL_TYPE (bsym.symbol);
return TYPENAME; return TYPENAME;
@ -3211,7 +3211,7 @@ classify_inner_name (struct parser_state *par_state,
return ERROR; return ERROR;
} }
switch (SYMBOL_CLASS (yylval.ssym.sym.symbol)) switch (yylval.ssym.sym.symbol->aclass ())
{ {
case LOC_BLOCK: case LOC_BLOCK:
case LOC_LABEL: case LOC_LABEL:

View file

@ -883,7 +883,7 @@ c_type_print_template_args (const struct type_print_options *flags,
{ {
struct symbol *sym = TYPE_TEMPLATE_ARGUMENT (type, i); struct symbol *sym = TYPE_TEMPLATE_ARGUMENT (type, i);
if (SYMBOL_CLASS (sym) != LOC_TYPEDEF) if (sym->aclass () != LOC_TYPEDEF)
continue; continue;
if (first) if (first)

View file

@ -1490,7 +1490,7 @@ patch_opaque_types (struct symtab *s)
Remove syms from the chain when their types are stored, Remove syms from the chain when their types are stored,
but search the whole chain, as there may be several syms but search the whole chain, as there may be several syms
from different files with the same name. */ from different files with the same name. */
if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF if (real_sym->aclass () == LOC_TYPEDEF
&& SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN && SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN
&& SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR && SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0) && TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)

View file

@ -62,7 +62,7 @@ convert_one_symbol (compile_c_instance *context,
context->error_symbol_once (sym.symbol); context->error_symbol_once (sym.symbol);
if (SYMBOL_CLASS (sym.symbol) == LOC_LABEL) if (sym.symbol->aclass () == LOC_LABEL)
sym_type = 0; sym_type = 0;
else else
sym_type = context->convert_type (SYMBOL_TYPE (sym.symbol)); sym_type = context->convert_type (SYMBOL_TYPE (sym.symbol));
@ -80,7 +80,7 @@ convert_one_symbol (compile_c_instance *context,
CORE_ADDR addr = 0; CORE_ADDR addr = 0;
gdb::unique_xmalloc_ptr<char> symbol_name; gdb::unique_xmalloc_ptr<char> symbol_name;
switch (SYMBOL_CLASS (sym.symbol)) switch (sym.symbol->aclass ())
{ {
case LOC_TYPEDEF: case LOC_TYPEDEF:
kind = GCC_C_SYMBOL_TYPEDEF; kind = GCC_C_SYMBOL_TYPEDEF;
@ -398,7 +398,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
/* We only need global functions here. */ /* We only need global functions here. */
sym = lookup_symbol (identifier, NULL, VAR_DOMAIN, NULL).symbol; sym = lookup_symbol (identifier, NULL, VAR_DOMAIN, NULL).symbol;
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_BLOCK) if (sym != NULL && sym->aclass () == LOC_BLOCK)
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
@ -577,7 +577,7 @@ generate_c_for_for_one_variable (compile_instance *compiler,
} }
else else
{ {
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
case LOC_REGISTER: case LOC_REGISTER:
case LOC_ARG: case LOC_ARG:

View file

@ -53,7 +53,7 @@ convert_one_symbol (compile_cplus_instance *instance,
instance->error_symbol_once (sym.symbol); instance->error_symbol_once (sym.symbol);
if (SYMBOL_CLASS (sym.symbol) == LOC_LABEL) if (sym.symbol->aclass () == LOC_LABEL)
sym_type = 0; sym_type = 0;
else else
sym_type = instance->convert_type (SYMBOL_TYPE (sym.symbol)); sym_type = instance->convert_type (SYMBOL_TYPE (sym.symbol));
@ -70,7 +70,7 @@ convert_one_symbol (compile_cplus_instance *instance,
std::string name; std::string name;
gdb::unique_xmalloc_ptr<char> symbol_name; gdb::unique_xmalloc_ptr<char> symbol_name;
switch (SYMBOL_CLASS (sym.symbol)) switch (sym.symbol->aclass ())
{ {
case LOC_TYPEDEF: case LOC_TYPEDEF:
if (SYMBOL_TYPE (sym.symbol)->code () == TYPE_CODE_TYPEDEF) if (SYMBOL_TYPE (sym.symbol)->code () == TYPE_CODE_TYPEDEF)
@ -435,7 +435,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
struct symbol *sym struct symbol *sym
= lookup_symbol (identifier, nullptr, VAR_DOMAIN, nullptr).symbol; = lookup_symbol (identifier, nullptr, VAR_DOMAIN, nullptr).symbol;
if (sym != nullptr && SYMBOL_CLASS (sym) == LOC_BLOCK) if (sym != nullptr && sym->aclass () == LOC_BLOCK)
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,

View file

@ -1501,7 +1501,7 @@ cp_lookup_rtti_type (const char *name, const struct block *block)
return NULL; return NULL;
} }
if (SYMBOL_CLASS (rtti_sym) != LOC_TYPEDEF) if (rtti_sym->aclass () != LOC_TYPEDEF)
{ {
warning (_("RTTI symbol for class '%s' is not a type"), name); warning (_("RTTI symbol for class '%s' is not a type"), name);
return NULL; return NULL;

View file

@ -448,7 +448,7 @@ PrimaryExpression:
sym = lookup_symbol (copy.c_str (), sym = lookup_symbol (copy.c_str (),
pstate->expression_context_block, pstate->expression_context_block,
VAR_DOMAIN, &is_a_field_of_this); VAR_DOMAIN, &is_a_field_of_this);
if (sym.symbol && SYMBOL_CLASS (sym.symbol) != LOC_TYPEDEF) if (sym.symbol && sym.symbol->aclass () != LOC_TYPEDEF)
{ {
if (symbol_read_needs_frame (sym.symbol)) if (symbol_read_needs_frame (sym.symbol))
pstate->block_tracker->update (sym); pstate->block_tracker->update (sym);
@ -1341,7 +1341,7 @@ classify_name (struct parser_state *par_state, const struct block *block)
std::string copy = copy_name (yylval.sval); std::string copy = copy_name (yylval.sval);
sym = lookup_symbol (copy.c_str (), block, VAR_DOMAIN, &is_a_field_of_this); sym = lookup_symbol (copy.c_str (), block, VAR_DOMAIN, &is_a_field_of_this);
if (sym.symbol && SYMBOL_CLASS (sym.symbol) == LOC_TYPEDEF) if (sym.symbol && sym.symbol->aclass () == LOC_TYPEDEF)
{ {
yylval.tsym.type = SYMBOL_TYPE (sym.symbol); yylval.tsym.type = SYMBOL_TYPE (sym.symbol);
return TYPENAME; return TYPENAME;
@ -1388,7 +1388,7 @@ classify_inner_name (struct parser_state *par_state,
if (yylval.ssym.sym.symbol == NULL) if (yylval.ssym.sym.symbol == NULL)
return ERROR; return ERROR;
if (SYMBOL_CLASS (yylval.ssym.sym.symbol) == LOC_TYPEDEF) if (yylval.ssym.sym.symbol->aclass () == LOC_TYPEDEF)
{ {
yylval.tsym.type = SYMBOL_TYPE (yylval.ssym.sym.symbol); yylval.tsym.type = SYMBOL_TYPE (yylval.ssym.sym.symbol);
return TYPENAME; return TYPENAME;

View file

@ -8879,7 +8879,7 @@ fixup_go_packaging (struct dwarf2_cu *cu)
struct symbol *sym = list->symbol[i]; struct symbol *sym = list->symbol[i];
if (sym->language () == language_go if (sym->language () == language_go
&& SYMBOL_CLASS (sym) == LOC_BLOCK) && sym->aclass () == LOC_BLOCK)
{ {
gdb::unique_xmalloc_ptr<char> this_package_name gdb::unique_xmalloc_ptr<char> this_package_name
(go_symbol_package_name (sym)); (go_symbol_package_name (sym));
@ -21844,7 +21844,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
&& die->parent->tag == DW_TAG_common_block) && die->parent->tag == DW_TAG_common_block)
attr2 = NULL; attr2 = NULL;
if (SYMBOL_CLASS (sym) == LOC_STATIC if (sym->aclass () == LOC_STATIC
&& SYMBOL_VALUE_ADDRESS (sym) == 0 && SYMBOL_VALUE_ADDRESS (sym) == 0
&& !per_objfile->per_bfd->has_section_at_zero) && !per_objfile->per_bfd->has_section_at_zero)
{ {
@ -21855,7 +21855,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
} }
else if (attr2 != nullptr && attr2->as_boolean ()) else if (attr2 != nullptr && attr2->as_boolean ())
{ {
if (SYMBOL_CLASS (sym) == LOC_STATIC if (sym->aclass () == LOC_STATIC
&& (objfile->flags & OBJF_MAINLINE) == 0 && (objfile->flags & OBJF_MAINLINE) == 0
&& per_objfile->per_bfd->can_copy) && per_objfile->per_bfd->can_copy)
{ {
@ -21918,7 +21918,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
else if (!die_is_declaration (die, cu)) else if (!die_is_declaration (die, cu))
{ {
/* Use the default LOC_OPTIMIZED_OUT class. */ /* Use the default LOC_OPTIMIZED_OUT class. */
gdb_assert (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT); gdb_assert (sym->aclass () == LOC_OPTIMIZED_OUT);
if (!suppress_add) if (!suppress_add)
list_to_add = cu->list_in_scope; list_to_add = cu->list_in_scope;
} }

View file

@ -2588,7 +2588,7 @@ var_value_operation::evaluate_for_address (struct expression *exp,
if (noside == EVAL_AVOID_SIDE_EFFECTS) if (noside == EVAL_AVOID_SIDE_EFFECTS)
{ {
struct type *type = lookup_pointer_type (SYMBOL_TYPE (var)); struct type *type = lookup_pointer_type (SYMBOL_TYPE (var));
enum address_class sym_class = SYMBOL_CLASS (var); enum address_class sym_class = var->aclass ();
if (sym_class == LOC_CONST if (sym_class == LOC_CONST
|| sym_class == LOC_CONST_BYTES || sym_class == LOC_CONST_BYTES

View file

@ -482,7 +482,7 @@ check_constant (ULONGEST cst)
static inline bool static inline bool
check_constant (struct symbol *sym) check_constant (struct symbol *sym)
{ {
enum address_class sc = SYMBOL_CLASS (sym); enum address_class sc = sym->aclass ();
return (sc == LOC_BLOCK return (sc == LOC_BLOCK
|| sc == LOC_CONST || sc == LOC_CONST
|| sc == LOC_CONST_BYTES || sc == LOC_CONST_BYTES

View file

@ -1487,7 +1487,7 @@ yylex (void)
{ {
result = lookup_symbol (tmp.c_str (), pstate->expression_context_block, result = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
domain, NULL); domain, NULL);
if (result.symbol && SYMBOL_CLASS (result.symbol) == LOC_TYPEDEF) if (result.symbol && result.symbol->aclass () == LOC_TYPEDEF)
{ {
yylval.tsym.type = SYMBOL_TYPE (result.symbol); yylval.tsym.type = SYMBOL_TYPE (result.symbol);
return TYPENAME; return TYPENAME;

View file

@ -600,7 +600,7 @@ info_common_command_for_block (const struct block *block, const char *comname,
const struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym); const struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym);
size_t index; size_t index;
gdb_assert (SYMBOL_CLASS (sym) == LOC_COMMON_BLOCK); gdb_assert (sym->aclass () == LOC_COMMON_BLOCK);
if (comname && (!sym->linkage_name () if (comname && (!sym->linkage_name ()
|| strcmp (comname, sym->linkage_name ()) != 0)) || strcmp (comname, sym->linkage_name ()) != 0))

View file

@ -358,7 +358,7 @@ symbol_read_needs (struct symbol *sym)
if (SYMBOL_COMPUTED_OPS (sym) != NULL) if (SYMBOL_COMPUTED_OPS (sym) != NULL)
return SYMBOL_COMPUTED_OPS (sym)->get_symbol_read_needs (sym); return SYMBOL_COMPUTED_OPS (sym)->get_symbol_read_needs (sym);
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
/* All cases listed explicitly so that gcc -Wall will detect it if /* All cases listed explicitly so that gcc -Wall will detect it if
we failed to consider one. */ we failed to consider one. */
@ -616,7 +616,7 @@ language_defn::read_var_value (struct symbol *var,
if (SYMBOL_COMPUTED_OPS (var) != NULL) if (SYMBOL_COMPUTED_OPS (var) != NULL)
return SYMBOL_COMPUTED_OPS (var)->read_variable (var, frame); return SYMBOL_COMPUTED_OPS (var)->read_variable (var, frame);
switch (SYMBOL_CLASS (var)) switch (var->aclass ())
{ {
case LOC_CONST: case LOC_CONST:
if (is_dynamic_type (type)) if (is_dynamic_type (type))
@ -718,7 +718,7 @@ language_defn::read_var_value (struct symbol *var,
->register_number (var, get_frame_arch (frame)); ->register_number (var, get_frame_arch (frame));
struct value *regval; struct value *regval;
if (SYMBOL_CLASS (var) == LOC_REGPARM_ADDR) if (var->aclass () == LOC_REGPARM_ADDR)
{ {
regval = value_from_register (lookup_pointer_type (type), regval = value_from_register (lookup_pointer_type (type),
regno, regno,

View file

@ -1690,7 +1690,7 @@ lookup_typename (const struct language_defn *language,
sym = lookup_symbol_in_language (name, block, VAR_DOMAIN, sym = lookup_symbol_in_language (name, block, VAR_DOMAIN,
language->la_language, NULL).symbol; language->la_language, NULL).symbol;
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF) if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
return SYMBOL_TYPE (sym); return SYMBOL_TYPE (sym);
if (noerr) if (noerr)

View file

@ -1338,7 +1338,7 @@ package_name_p (const char *name, const struct block *block)
sym = lookup_symbol (name, block, STRUCT_DOMAIN, &is_a_field_of_this).symbol; sym = lookup_symbol (name, block, STRUCT_DOMAIN, &is_a_field_of_this).symbol;
if (sym if (sym
&& SYMBOL_CLASS (sym) == LOC_TYPEDEF && sym->aclass () == LOC_TYPEDEF
&& SYMBOL_TYPE (sym)->code () == TYPE_CODE_MODULE) && SYMBOL_TYPE (sym)->code () == TYPE_CODE_MODULE)
return 1; return 1;

View file

@ -412,7 +412,7 @@ gdbscm_symbol_addr_class (SCM self)
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol; const struct symbol *symbol = s_smob->symbol;
return scm_from_int (SYMBOL_CLASS (symbol)); return scm_from_int (symbol->aclass ());
} }
/* (symbol-argument? <gdb:symbol>) -> boolean */ /* (symbol-argument? <gdb:symbol>) -> boolean */
@ -437,7 +437,7 @@ gdbscm_symbol_constant_p (SCM self)
const struct symbol *symbol = s_smob->symbol; const struct symbol *symbol = s_smob->symbol;
enum address_class theclass; enum address_class theclass;
theclass = SYMBOL_CLASS (symbol); theclass = symbol->aclass ();
return scm_from_bool (theclass == LOC_CONST || theclass == LOC_CONST_BYTES); return scm_from_bool (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
} }
@ -452,7 +452,7 @@ gdbscm_symbol_function_p (SCM self)
const struct symbol *symbol = s_smob->symbol; const struct symbol *symbol = s_smob->symbol;
enum address_class theclass; enum address_class theclass;
theclass = SYMBOL_CLASS (symbol); theclass = symbol->aclass ();
return scm_from_bool (theclass == LOC_BLOCK); return scm_from_bool (theclass == LOC_BLOCK);
} }
@ -467,7 +467,7 @@ gdbscm_symbol_variable_p (SCM self)
const struct symbol *symbol = s_smob->symbol; const struct symbol *symbol = s_smob->symbol;
enum address_class theclass; enum address_class theclass;
theclass = SYMBOL_CLASS (symbol); theclass = symbol->aclass ();
return scm_from_bool (!SYMBOL_IS_ARGUMENT (symbol) return scm_from_bool (!SYMBOL_IS_ARGUMENT (symbol)
&& (theclass == LOC_LOCAL || theclass == LOC_REGISTER && (theclass == LOC_LOCAL || theclass == LOC_REGISTER
@ -534,7 +534,7 @@ gdbscm_symbol_value (SCM self, SCM rest)
if (!gdbscm_is_false (frame_scm)) if (!gdbscm_is_false (frame_scm))
f_smob = frscm_get_frame_smob_arg_unsafe (frame_scm, frame_pos, FUNC_NAME); f_smob = frscm_get_frame_smob_arg_unsafe (frame_scm, frame_pos, FUNC_NAME);
if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF) if (symbol->aclass () == LOC_TYPEDEF)
{ {
gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG1, self, gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG1, self,
_("cannot get the value of a typedef")); _("cannot get the value of a typedef"));

View file

@ -976,7 +976,7 @@ prepare_one_step (thread_info *tp, struct step_command_fsm *sm)
if (inline_skipped_frames (tp) > 0) if (inline_skipped_frames (tp) > 0)
{ {
symbol *sym = inline_skipped_symbol (tp); symbol *sym = inline_skipped_symbol (tp);
if (SYMBOL_CLASS (sym) == LOC_BLOCK) if (sym->aclass () == LOC_BLOCK)
{ {
const block *block = SYMBOL_BLOCK_VALUE (sym); const block *block = SYMBOL_BLOCK_VALUE (sym);
if (BLOCK_END (block) < tp->control.step_range_end) if (BLOCK_END (block) < tp->control.step_range_end)

View file

@ -204,7 +204,7 @@ collect_info::add_symbol (block_symbol *bsym)
{ {
/* In list mode, add all matching symbols, regardless of class. /* In list mode, add all matching symbols, regardless of class.
This allows the user to type "list a_global_variable". */ This allows the user to type "list a_global_variable". */
if (SYMBOL_CLASS (bsym->symbol) == LOC_BLOCK || this->state->list_mode) if (bsym->symbol->aclass () == LOC_BLOCK || this->state->list_mode)
this->result.symbols->push_back (*bsym); this->result.symbols->push_back (*bsym);
/* Continue iterating. */ /* Continue iterating. */
@ -2298,7 +2298,7 @@ convert_linespec_to_sals (struct linespec_state *state, linespec *ls)
if (state->funfirstline if (state->funfirstline
&& !ls->minimal_symbols.empty () && !ls->minimal_symbols.empty ()
&& SYMBOL_CLASS (sym.symbol) == LOC_BLOCK) && sym.symbol->aclass () == LOC_BLOCK)
{ {
const CORE_ADDR addr const CORE_ADDR addr
= BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym.symbol)); = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym.symbol));
@ -3491,7 +3491,7 @@ decode_compound_collector::operator () (block_symbol *bsym)
struct type *t; struct type *t;
struct symbol *sym = bsym->symbol; struct symbol *sym = bsym->symbol;
if (SYMBOL_CLASS (sym) != LOC_TYPEDEF) if (sym->aclass () != LOC_TYPEDEF)
return true; /* Continue iterating. */ return true; /* Continue iterating. */
t = SYMBOL_TYPE (sym); t = SYMBOL_TYPE (sym);
@ -4439,14 +4439,14 @@ static int
symbol_to_sal (struct symtab_and_line *result, symbol_to_sal (struct symtab_and_line *result,
int funfirstline, struct symbol *sym) int funfirstline, struct symbol *sym)
{ {
if (SYMBOL_CLASS (sym) == LOC_BLOCK) if (sym->aclass () == LOC_BLOCK)
{ {
*result = find_function_start_sal (sym, funfirstline); *result = find_function_start_sal (sym, funfirstline);
return 1; return 1;
} }
else else
{ {
if (SYMBOL_CLASS (sym) == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0) if (sym->aclass () == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
{ {
*result = {}; *result = {};
result->symtab = symbol_symtab (sym); result->symtab = symbol_symtab (sym);

View file

@ -507,7 +507,7 @@ fblock : block COLONCOLON BLOCKNAME
{ struct symbol *tem { struct symbol *tem
= lookup_symbol (copy_name ($3).c_str (), $1, = lookup_symbol (copy_name ($3).c_str (), $1,
VAR_DOMAIN, 0).symbol; VAR_DOMAIN, 0).symbol;
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) if (!tem || tem->aclass () != LOC_BLOCK)
error (_("No function \"%s\" in specified context."), error (_("No function \"%s\" in specified context."),
copy_name ($3).c_str ()); copy_name ($3).c_str ());
$$ = tem; $$ = tem;
@ -932,7 +932,7 @@ yylex (void)
return BLOCKNAME; return BLOCKNAME;
sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block, sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
VAR_DOMAIN, 0).symbol; VAR_DOMAIN, 0).symbol;
if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK) if (sym && sym->aclass () == LOC_BLOCK)
return BLOCKNAME; return BLOCKNAME;
if (lookup_typename (pstate->language (), if (lookup_typename (pstate->language (),
tmp.c_str (), pstate->expression_context_block, 1)) tmp.c_str (), pstate->expression_context_block, 1))
@ -940,7 +940,7 @@ yylex (void)
if(sym) if(sym)
{ {
switch(SYMBOL_CLASS (sym)) switch(sym->aclass ())
{ {
case LOC_STATIC: case LOC_STATIC:
case LOC_REGISTER: case LOC_REGISTER:

View file

@ -4468,7 +4468,7 @@ mylookup_symbol (const char *name, const struct block *block,
{ {
if (sym->linkage_name ()[0] == inc if (sym->linkage_name ()[0] == inc
&& SYMBOL_DOMAIN (sym) == domain && SYMBOL_DOMAIN (sym) == domain
&& SYMBOL_CLASS (sym) == theclass && sym->aclass () == theclass
&& strcmp (sym->linkage_name (), name) == 0) && strcmp (sym->linkage_name (), name) == 0)
return sym; return sym;
} }

View file

@ -599,7 +599,7 @@ list_args_or_locals (const frame_print_options &fp_opts,
{ {
int print_me = 0; int print_me = 0;
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
default: default:
case LOC_UNDEF: /* catches errors */ case LOC_UNDEF: /* catches errors */

View file

@ -483,7 +483,7 @@ msymbol_is_micromips (struct minimal_symbol *msym)
static void static void
mips_make_symbol_special (struct symbol *sym, struct objfile *objfile) mips_make_symbol_special (struct symbol *sym, struct objfile *objfile)
{ {
if (SYMBOL_CLASS (sym) == LOC_BLOCK) if (sym->aclass () == LOC_BLOCK)
{ {
/* We are in symbol reading so it is OK to cast away constness. */ /* We are in symbol reading so it is OK to cast away constness. */
struct block *block = (struct block *) SYMBOL_BLOCK_VALUE (sym); struct block *block = (struct block *) SYMBOL_BLOCK_VALUE (sym);

View file

@ -616,8 +616,8 @@ relocate_one_symbol (struct symbol *sym, struct objfile *objfile,
any symbols in STRUCT_DOMAIN or UNDEF_DOMAIN. any symbols in STRUCT_DOMAIN or UNDEF_DOMAIN.
But I'm leaving out that test, on the theory that But I'm leaving out that test, on the theory that
they can't possibly pass the tests below. */ they can't possibly pass the tests below. */
if ((SYMBOL_CLASS (sym) == LOC_LABEL if ((sym->aclass () == LOC_LABEL
|| SYMBOL_CLASS (sym) == LOC_STATIC) || sym->aclass () == LOC_STATIC)
&& sym->section_index () >= 0) && sym->section_index () >= 0)
{ {
SET_SYMBOL_VALUE_ADDRESS (sym, SET_SYMBOL_VALUE_ADDRESS (sym,

View file

@ -635,7 +635,7 @@ block : block COLONCOLON name
= lookup_symbol (copy.c_str (), $1, = lookup_symbol (copy.c_str (), $1,
VAR_DOMAIN, NULL).symbol; VAR_DOMAIN, NULL).symbol;
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) if (!tem || tem->aclass () != LOC_BLOCK)
error (_("No function \"%s\" in specified context."), error (_("No function \"%s\" in specified context."),
copy.c_str ()); copy.c_str ());
$$ = SYMBOL_BLOCK_VALUE (tem); } $$ = SYMBOL_BLOCK_VALUE (tem); }
@ -1544,7 +1544,7 @@ yylex (void)
/* Call lookup_symtab, not lookup_partial_symtab, in case there are /* Call lookup_symtab, not lookup_partial_symtab, in case there are
no psymtabs (coff, xcoff, or some future change to blow away the no psymtabs (coff, xcoff, or some future change to blow away the
psymtabs once once symbols are read). */ psymtabs once once symbols are read). */
if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) if ((sym && sym->aclass () == LOC_BLOCK)
|| lookup_symtab (tmp.c_str ())) || lookup_symtab (tmp.c_str ()))
{ {
yylval.ssym.sym.symbol = sym; yylval.ssym.sym.symbol = sym;
@ -1553,7 +1553,7 @@ yylex (void)
free (uptokstart); free (uptokstart);
return BLOCKNAME; return BLOCKNAME;
} }
if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF) if (sym && sym->aclass () == LOC_TYPEDEF)
{ {
#if 1 #if 1
/* Despite the following flaw, we need to keep this code enabled. /* Despite the following flaw, we need to keep this code enabled.
@ -1622,7 +1622,7 @@ yylex (void)
VAR_DOMAIN, NULL).symbol; VAR_DOMAIN, NULL).symbol;
if (cur_sym) if (cur_sym)
{ {
if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF) if (cur_sym->aclass () == LOC_TYPEDEF)
{ {
best_sym = cur_sym; best_sym = cur_sym;
pstate->lexptr = p; pstate->lexptr = p;

View file

@ -1700,7 +1700,7 @@ info_address_command (const char *exp, int from_tty)
return; return;
} }
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
case LOC_CONST: case LOC_CONST:
case LOC_CONST_BYTES: case LOC_CONST_BYTES:

View file

@ -169,7 +169,7 @@ mi_should_print (struct symbol *sym, enum mi_print_types type)
{ {
int print_me = 0; int print_me = 0;
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
default: default:
case LOC_UNDEF: /* catches errors */ case LOC_UNDEF: /* catches errors */

View file

@ -131,7 +131,7 @@ sympy_get_addr_class (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol); SYMPY_REQUIRE_VALID (self, symbol);
return gdb_py_object_from_longest (SYMBOL_CLASS (symbol)).release (); return gdb_py_object_from_longest (symbol->aclass ()).release ();
} }
static PyObject * static PyObject *
@ -152,7 +152,7 @@ sympy_is_constant (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol); SYMPY_REQUIRE_VALID (self, symbol);
theclass = SYMBOL_CLASS (symbol); theclass = symbol->aclass ();
return PyBool_FromLong (theclass == LOC_CONST || theclass == LOC_CONST_BYTES); return PyBool_FromLong (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
} }
@ -165,7 +165,7 @@ sympy_is_function (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol); SYMPY_REQUIRE_VALID (self, symbol);
theclass = SYMBOL_CLASS (symbol); theclass = symbol->aclass ();
return PyBool_FromLong (theclass == LOC_BLOCK); return PyBool_FromLong (theclass == LOC_BLOCK);
} }
@ -178,7 +178,7 @@ sympy_is_variable (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol); SYMPY_REQUIRE_VALID (self, symbol);
theclass = SYMBOL_CLASS (symbol); theclass = symbol->aclass ();
return PyBool_FromLong (!SYMBOL_IS_ARGUMENT (symbol) return PyBool_FromLong (!SYMBOL_IS_ARGUMENT (symbol)
&& (theclass == LOC_LOCAL || theclass == LOC_REGISTER && (theclass == LOC_LOCAL || theclass == LOC_REGISTER
@ -260,7 +260,7 @@ sympy_value (PyObject *self, PyObject *args)
} }
SYMPY_REQUIRE_VALID (self, symbol); SYMPY_REQUIRE_VALID (self, symbol);
if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF) if (symbol->aclass () == LOC_TYPEDEF)
{ {
PyErr_SetString (PyExc_TypeError, "cannot get the value of a typedef"); PyErr_SetString (PyExc_TypeError, "cannot get the value of a typedef");
return NULL; return NULL;

View file

@ -997,9 +997,9 @@ typy_template_argument (PyObject *self, PyObject *args)
} }
sym = TYPE_TEMPLATE_ARGUMENT (type, argno); sym = TYPE_TEMPLATE_ARGUMENT (type, argno);
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF) if (sym->aclass () == LOC_TYPEDEF)
return type_to_type_object (SYMBOL_TYPE (sym)); return type_to_type_object (SYMBOL_TYPE (sym));
else if (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT) else if (sym->aclass () == LOC_OPTIMIZED_OUT)
{ {
PyErr_Format (PyExc_RuntimeError, PyErr_Format (PyExc_RuntimeError,
_("Template argument is optimized out")); _("Template argument is optimized out"));

View file

@ -1210,14 +1210,14 @@ rust_parser::name_to_operation (const std::string &name)
struct block_symbol sym = lookup_symbol (name.c_str (), struct block_symbol sym = lookup_symbol (name.c_str (),
pstate->expression_context_block, pstate->expression_context_block,
VAR_DOMAIN); VAR_DOMAIN);
if (sym.symbol != nullptr && SYMBOL_CLASS (sym.symbol) != LOC_TYPEDEF) if (sym.symbol != nullptr && sym.symbol->aclass () != LOC_TYPEDEF)
return make_operation<var_value_operation> (sym); return make_operation<var_value_operation> (sym);
struct type *type = nullptr; struct type *type = nullptr;
if (sym.symbol != nullptr) if (sym.symbol != nullptr)
{ {
gdb_assert (SYMBOL_CLASS (sym.symbol) == LOC_TYPEDEF); gdb_assert (sym.symbol->aclass () == LOC_TYPEDEF);
type = SYMBOL_TYPE (sym.symbol); type = SYMBOL_TYPE (sym.symbol);
} }
if (type == nullptr) if (type == nullptr)

View file

@ -323,7 +323,7 @@ select_source_symtab (struct symtab *s)
/* Make the default place to list be the function `main' /* Make the default place to list be the function `main'
if one exists. */ if one exists. */
block_symbol bsym = lookup_symbol (main_name (), 0, VAR_DOMAIN, 0); block_symbol bsym = lookup_symbol (main_name (), 0, VAR_DOMAIN, 0);
if (bsym.symbol != nullptr && SYMBOL_CLASS (bsym.symbol) == LOC_BLOCK) if (bsym.symbol != nullptr && bsym.symbol->aclass () == LOC_BLOCK)
{ {
symtab_and_line sal = find_function_start_sal (bsym.symbol, true); symtab_and_line sal = find_function_start_sal (bsym.symbol, true);
if (sal.symtab == NULL) if (sal.symtab == NULL)

View file

@ -1155,8 +1155,8 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
struct symbol *prev_sym; struct symbol *prev_sym;
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1]; prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG if ((prev_sym->aclass () == LOC_REF_ARG
|| SYMBOL_CLASS (prev_sym) == LOC_ARG) || prev_sym->aclass () == LOC_ARG)
&& strcmp (prev_sym->linkage_name (), && strcmp (prev_sym->linkage_name (),
sym->linkage_name ()) == 0) sym->linkage_name ()) == 0)
{ {
@ -1398,11 +1398,11 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
{ {
/* We have to convert LOC_REGISTER to LOC_REGPARM_ADDR (for /* We have to convert LOC_REGISTER to LOC_REGPARM_ADDR (for
variables passed in a register). */ variables passed in a register). */
if (SYMBOL_CLASS (sym) == LOC_REGISTER) if (sym->aclass () == LOC_REGISTER)
sym->set_aclass_index (LOC_REGPARM_ADDR); sym->set_aclass_index (LOC_REGPARM_ADDR);
/* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th /* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th
and subsequent arguments on SPARC, for example). */ and subsequent arguments on SPARC, for example). */
else if (SYMBOL_CLASS (sym) == LOC_ARG) else if (sym->aclass () == LOC_ARG)
sym->set_aclass_index (LOC_REF_ARG); sym->set_aclass_index (LOC_REF_ARG);
} }
@ -1628,7 +1628,7 @@ again:
{ {
struct symbol *sym = ppt->symbol[i]; struct symbol *sym = ppt->symbol[i];
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF if (sym->aclass () == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (SYMBOL_TYPE (sym)->code () == code) && (SYMBOL_TYPE (sym)->code () == code)
&& strcmp (sym->linkage_name (), type_name) == 0) && strcmp (sym->linkage_name (), type_name) == 0)
@ -4466,7 +4466,7 @@ cleanup_undefined_types_1 (void)
{ {
struct symbol *sym = ppt->symbol[i]; struct symbol *sym = ppt->symbol[i];
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF if (sym->aclass () == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (SYMBOL_TYPE (sym)->code () == (*type)->code ()) && (SYMBOL_TYPE (sym)->code () == (*type)->code ())
&& ((*type)->instance_flags () && ((*type)->instance_flags ()
@ -4576,7 +4576,7 @@ scan_file_globals (struct objfile *objfile)
the same symbol if there are multiple references. */ the same symbol if there are multiple references. */
if (sym) if (sym)
{ {
if (SYMBOL_CLASS (sym) == LOC_BLOCK) if (sym->aclass () == LOC_BLOCK)
{ {
fix_common_block (sym, fix_common_block (sym,
MSYMBOL_VALUE_ADDRESS (resolve_objfile, MSYMBOL_VALUE_ADDRESS (resolve_objfile,
@ -4627,7 +4627,7 @@ scan_file_globals (struct objfile *objfile)
SET_SYMBOL_VALUE_ADDRESS (prev, 0); SET_SYMBOL_VALUE_ADDRESS (prev, 0);
/* Complain about unresolved common block symbols. */ /* Complain about unresolved common block symbols. */
if (SYMBOL_CLASS (prev) == LOC_STATIC) if (prev->aclass () == LOC_STATIC)
prev->set_aclass_index (LOC_UNRESOLVED); prev->set_aclass_index (LOC_UNRESOLVED);
else else
complaint (_("%s: common block `%s' from " complaint (_("%s: common block `%s' from "

View file

@ -773,7 +773,7 @@ print_frame_args (const frame_print_options &fp_opts,
break; break;
} }
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
case LOC_ARG: case LOC_ARG:
case LOC_REF_ARG: case LOC_REF_ARG:
@ -828,7 +828,7 @@ print_frame_args (const frame_print_options &fp_opts,
nsym = lookup_symbol_search_name (sym->search_name (), nsym = lookup_symbol_search_name (sym->search_name (),
b, VAR_DOMAIN).symbol; b, VAR_DOMAIN).symbol;
gdb_assert (nsym != NULL); gdb_assert (nsym != NULL);
if (SYMBOL_CLASS (nsym) == LOC_REGISTER if (nsym->aclass () == LOC_REGISTER
&& !SYMBOL_IS_ARGUMENT (nsym)) && !SYMBOL_IS_ARGUMENT (nsym))
{ {
/* There is a LOC_ARG/LOC_REGISTER pair. This means /* There is a LOC_ARG/LOC_REGISTER pair. This means
@ -2248,7 +2248,7 @@ iterate_over_block_locals (const struct block *b,
ALL_BLOCK_SYMBOLS (b, iter, sym) ALL_BLOCK_SYMBOLS (b, iter, sym)
{ {
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
case LOC_CONST: case LOC_CONST:
case LOC_LOCAL: case LOC_LOCAL:

View file

@ -543,7 +543,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
} }
else else
{ {
if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF) if (symbol->aclass () == LOC_TYPEDEF)
fprintf_filtered (outfile, "typedef "); fprintf_filtered (outfile, "typedef ");
if (SYMBOL_TYPE (symbol)) if (SYMBOL_TYPE (symbol))
{ {
@ -558,7 +558,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
else else
fprintf_filtered (outfile, "%s ", symbol->print_name ()); fprintf_filtered (outfile, "%s ", symbol->print_name ());
switch (SYMBOL_CLASS (symbol)) switch (symbol->aclass ())
{ {
case LOC_CONST: case LOC_CONST:
fprintf_filtered (outfile, "const %s (%s)", fprintf_filtered (outfile, "const %s (%s)",
@ -654,7 +654,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
default: default:
fprintf_filtered (outfile, "botched symbol class %x", fprintf_filtered (outfile, "botched symbol class %x",
SYMBOL_CLASS (symbol)); symbol->aclass ());
break; break;
} }
} }

View file

@ -1805,7 +1805,7 @@ fixup_symbol_section (struct symbol *sym, struct objfile *objfile)
/* We should have an objfile by now. */ /* We should have an objfile by now. */
gdb_assert (objfile); gdb_assert (objfile);
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
case LOC_STATIC: case LOC_STATIC:
case LOC_LABEL: case LOC_LABEL:
@ -3086,7 +3086,7 @@ find_symbol_at_address (CORE_ADDR address)
ALL_BLOCK_SYMBOLS (b, iter, sym) ALL_BLOCK_SYMBOLS (b, iter, sym)
{ {
if (SYMBOL_CLASS (sym) == LOC_STATIC if (sym->aclass () == LOC_STATIC
&& SYMBOL_VALUE_ADDRESS (sym) == addr) && SYMBOL_VALUE_ADDRESS (sym) == addr)
return sym; return sym;
} }
@ -4119,7 +4119,7 @@ find_function_alias_target (bound_minimal_symbol msymbol)
symbol *sym = find_pc_function (func_addr); symbol *sym = find_pc_function (func_addr);
if (sym != NULL if (sym != NULL
&& SYMBOL_CLASS (sym) == LOC_BLOCK && sym->aclass () == LOC_BLOCK
&& BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) == func_addr) && BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) == func_addr)
return sym; return sym;
@ -4828,25 +4828,25 @@ global_symbol_searcher::add_matching_symbols
|| preg->exec (sym->natural_name (), 0, || preg->exec (sym->natural_name (), 0,
NULL, 0) == 0) NULL, 0) == 0)
&& ((kind == VARIABLES_DOMAIN && ((kind == VARIABLES_DOMAIN
&& SYMBOL_CLASS (sym) != LOC_TYPEDEF && sym->aclass () != LOC_TYPEDEF
&& SYMBOL_CLASS (sym) != LOC_UNRESOLVED && sym->aclass () != LOC_UNRESOLVED
&& SYMBOL_CLASS (sym) != LOC_BLOCK && sym->aclass () != LOC_BLOCK
/* LOC_CONST can be used for more than /* LOC_CONST can be used for more than
just enums, e.g., c++ static const just enums, e.g., c++ static const
members. We only want to skip enums members. We only want to skip enums
here. */ here. */
&& !(SYMBOL_CLASS (sym) == LOC_CONST && !(sym->aclass () == LOC_CONST
&& (SYMBOL_TYPE (sym)->code () && (SYMBOL_TYPE (sym)->code ()
== TYPE_CODE_ENUM)) == TYPE_CODE_ENUM))
&& (!treg.has_value () && (!treg.has_value ()
|| treg_matches_sym_type_name (*treg, sym))) || treg_matches_sym_type_name (*treg, sym)))
|| (kind == FUNCTIONS_DOMAIN || (kind == FUNCTIONS_DOMAIN
&& SYMBOL_CLASS (sym) == LOC_BLOCK && sym->aclass () == LOC_BLOCK
&& (!treg.has_value () && (!treg.has_value ()
|| treg_matches_sym_type_name (*treg, || treg_matches_sym_type_name (*treg,
sym))) sym)))
|| (kind == TYPES_DOMAIN || (kind == TYPES_DOMAIN
&& SYMBOL_CLASS (sym) == LOC_TYPEDEF && sym->aclass () == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) != MODULE_DOMAIN) && SYMBOL_DOMAIN (sym) != MODULE_DOMAIN)
|| (kind == MODULES_DOMAIN || (kind == MODULES_DOMAIN
&& SYMBOL_DOMAIN (sym) == MODULE_DOMAIN && SYMBOL_DOMAIN (sym) == MODULE_DOMAIN
@ -5056,7 +5056,7 @@ symbol_to_info_string (struct symbol *sym, int block,
string_file tmp_stream; string_file tmp_stream;
type_print (SYMBOL_TYPE (sym), type_print (SYMBOL_TYPE (sym),
(SYMBOL_CLASS (sym) == LOC_TYPEDEF (sym->aclass () == LOC_TYPEDEF
? "" : sym->print_name ()), ? "" : sym->print_name ()),
&tmp_stream, 0); &tmp_stream, 0);
@ -5526,7 +5526,7 @@ completion_list_add_symbol (completion_tracker &tracker,
tracker. */ tracker. */
if (sym->language () == language_cplus if (sym->language () == language_cplus
&& SYMBOL_DOMAIN (sym) == VAR_DOMAIN && SYMBOL_DOMAIN (sym) == VAR_DOMAIN
&& SYMBOL_CLASS (sym) == LOC_BLOCK) && sym->aclass () == LOC_BLOCK)
{ {
/* The call to canonicalize returns the empty string if the input /* The call to canonicalize returns the empty string if the input
string is already in canonical form, thanks to this we don't string is already in canonical form, thanks to this we don't
@ -5671,7 +5671,7 @@ completion_list_add_fields (completion_tracker &tracker,
const lookup_name_info &lookup_name, const lookup_name_info &lookup_name,
const char *text, const char *word) const char *text, const char *word)
{ {
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF) if (sym->aclass () == LOC_TYPEDEF)
{ {
struct type *t = SYMBOL_TYPE (sym); struct type *t = SYMBOL_TYPE (sym);
enum type_code c = t->code (); enum type_code c = t->code ();
@ -5723,7 +5723,7 @@ symbol_is_function_or_method (minimal_symbol *msymbol)
bound_minimal_symbol bound_minimal_symbol
find_gnu_ifunc (const symbol *sym) find_gnu_ifunc (const symbol *sym)
{ {
if (SYMBOL_CLASS (sym) != LOC_BLOCK) if (sym->aclass () != LOC_BLOCK)
return {}; return {};
lookup_name_info lookup_name (sym->search_name (), lookup_name_info lookup_name (sym->search_name (),
@ -6572,7 +6572,7 @@ CORE_ADDR
get_symbol_address (const struct symbol *sym) get_symbol_address (const struct symbol *sym)
{ {
gdb_assert (sym->maybe_copied); gdb_assert (sym->maybe_copied);
gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC); gdb_assert (sym->aclass () == LOC_STATIC);
const char *linkage_name = sym->linkage_name (); const char *linkage_name = sym->linkage_name ();

View file

@ -1153,6 +1153,11 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
return symbol_impls[this->aclass_index ()]; return symbol_impls[this->aclass_index ()];
} }
address_class aclass () const
{
return this->impl ().aclass;
}
/* Data type of value */ /* Data type of value */
struct type *type = nullptr; struct type *type = nullptr;
@ -1256,7 +1261,6 @@ struct block_symbol
"private". */ "private". */
#define SYMBOL_DOMAIN(symbol) (symbol)->domain #define SYMBOL_DOMAIN(symbol) (symbol)->domain
#define SYMBOL_CLASS(symbol) ((symbol)->impl ().aclass)
#define SYMBOL_OBJFILE_OWNED(symbol) ((symbol)->is_objfile_owned) #define SYMBOL_OBJFILE_OWNED(symbol) ((symbol)->is_objfile_owned)
#define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument #define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument
#define SYMBOL_INLINED(symbol) (symbol)->is_inlined #define SYMBOL_INLINED(symbol) (symbol)->is_inlined

View file

@ -696,14 +696,14 @@ validate_actionline (const char *line, struct breakpoint *b)
(exp->op.get ())); (exp->op.get ()));
sym = vvop->get_symbol (); sym = vvop->get_symbol ();
if (SYMBOL_CLASS (sym) == LOC_CONST) if (sym->aclass () == LOC_CONST)
{ {
error (_("constant `%s' (value %s) " error (_("constant `%s' (value %s) "
"will not be collected."), "will not be collected."),
sym->print_name (), sym->print_name (),
plongest (SYMBOL_VALUE (sym))); plongest (SYMBOL_VALUE (sym)));
} }
else if (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT) else if (sym->aclass () == LOC_OPTIMIZED_OUT)
{ {
error (_("`%s' is optimized away " error (_("`%s' is optimized away "
"and cannot be collected."), "and cannot be collected."),
@ -928,11 +928,11 @@ collection_list::collect_symbol (struct symbol *sym,
int treat_as_expr = 0; int treat_as_expr = 0;
len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))); len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
default: default:
printf_filtered ("%s: don't know symbol class %d\n", printf_filtered ("%s: don't know symbol class %d\n",
sym->print_name (), SYMBOL_CLASS (sym)); sym->print_name (), sym->aclass ());
break; break;
case LOC_CONST: case LOC_CONST:
printf_filtered ("constant %s (value %s) will not be collected.\n", printf_filtered ("constant %s (value %s) will not be collected.\n",
@ -2550,12 +2550,12 @@ info_scope_command (const char *args_in, int from_tty)
gdb_stdout); gdb_stdout);
else else
{ {
switch (SYMBOL_CLASS (sym)) switch (sym->aclass ())
{ {
default: default:
case LOC_UNDEF: /* Messed up symbol? */ case LOC_UNDEF: /* Messed up symbol? */
printf_filtered ("a bogus symbol, class %d.\n", printf_filtered ("a bogus symbol, class %d.\n",
SYMBOL_CLASS (sym)); sym->aclass ());
count--; /* Don't count this one. */ count--; /* Don't count this one. */
continue; continue;
case LOC_CONST: case LOC_CONST:

View file

@ -255,7 +255,7 @@ typedef_hash_table::add_template_parameters (struct type *t)
void **slot; void **slot;
/* We only want type-valued template parameters in the hash. */ /* We only want type-valued template parameters in the hash. */
if (SYMBOL_CLASS (TYPE_TEMPLATE_ARGUMENT (t, i)) != LOC_TYPEDEF) if (TYPE_TEMPLATE_ARGUMENT (t, i)->aclass () != LOC_TYPEDEF)
continue; continue;
tf = XOBNEW (&m_storage, struct decl_field); tf = XOBNEW (&m_storage, struct decl_field);

View file

@ -120,7 +120,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p)
sym = lookup_symbol (name, 0, VAR_DOMAIN, 0); sym = lookup_symbol (name, 0, VAR_DOMAIN, 0);
if (sym.symbol != NULL) if (sym.symbol != NULL)
{ {
if (SYMBOL_CLASS (sym.symbol) != LOC_BLOCK) if (sym.symbol->aclass () != LOC_BLOCK)
{ {
error (_("\"%s\" exists in this program but is not a function."), error (_("\"%s\" exists in this program but is not a function."),
name); name);
@ -3779,7 +3779,7 @@ value_maybe_namespace_elt (const struct type *curtype,
if (sym.symbol == NULL) if (sym.symbol == NULL)
return NULL; return NULL;
else if ((noside == EVAL_AVOID_SIDE_EFFECTS) else if ((noside == EVAL_AVOID_SIDE_EFFECTS)
&& (SYMBOL_CLASS (sym.symbol) == LOC_TYPEDEF)) && (sym.symbol->aclass () == LOC_TYPEDEF))
result = allocate_value (SYMBOL_TYPE (sym.symbol)); result = allocate_value (SYMBOL_TYPE (sym.symbol));
else else
result = value_of_variable (sym.symbol, sym.block); result = value_of_variable (sym.symbol, sym.block);