Make compunit_primary_filetab a method of compunit_symtab.
Change-Id: Iee3c4f7e36d579bf763c5bba146e5e10d6766768
if (cust == NULL)
return NULL;
- return compunit_primary_filetab (cust);
+ return cust->primary_filetab ();
}
/* See read.h. */
: i_smob->iter.d.compunit_symtab->includes[i_smob->iter.idx]);
gdbscm_printf (port, " %s",
symtab_to_filename_for_display
- (compunit_primary_filetab (cust)));
+ (cust->primary_filetab ()));
break;
}
case FIRST_LOCAL_BLOCK:
if (cust == NULL)
return NULL;
- return compunit_primary_filetab (cust);
+ return cust->primary_filetab ();
}
}
return NULL;
if (debug_symfile)
fprintf_filtered (gdb_stdlog, "qf->lookup_symbol (...) = %s\n",
retval
- ? debug_symtab_name (compunit_primary_filetab (retval))
+ ? debug_symtab_name (retval->primary_filetab ())
: "NULL");
return retval;
fprintf_filtered (gdb_stdlog,
"qf->find_pc_sect_compunit_symtab (...) = %s\n",
retval
- ? debug_symtab_name (compunit_primary_filetab (retval))
+ ? debug_symtab_name (retval->primary_filetab ())
: "NULL");
return retval;
fprintf_filtered (gdb_stdlog,
"qf->find_compunit_symtab_by_address (...) = %s\n",
result
- ? debug_symtab_name (compunit_primary_filetab (result))
+ ? debug_symtab_name (result->primary_filetab ())
: "NULL");
return result;
for (compunit_symtab *cust : objfile->compunits ())
{
int found_something = 0;
- struct symtab *symtab = compunit_primary_filetab (cust);
+ struct symtab *symtab = cust->primary_filetab ();
QUIT;
/* See symtab.h. */
struct symtab *
-compunit_primary_filetab (const struct compunit_symtab *cust)
+compunit_symtab::primary_filetab () const
{
- gdb_assert (COMPUNIT_FILETABS (cust) != NULL);
+ gdb_assert (this->filetabs != nullptr);
/* The primary file symtab is the first one in the list. */
- return COMPUNIT_FILETABS (cust);
+ return this->filetabs;
}
/* See symtab.h. */
enum language
compunit_language (const struct compunit_symtab *cust)
{
- struct symtab *symtab = compunit_primary_filetab (cust);
+ struct symtab *symtab = cust->primary_filetab ();
/* The language of the compunit symtab is the language of its primary
source file. */
(if a template, try specifying an instantiation: %s<type>)."),
block_index == GLOBAL_BLOCK ? "global" : "static",
name,
- symtab_to_filename_for_display (compunit_primary_filetab (cust)),
+ symtab_to_filename_for_display (cust->primary_filetab ()),
name, name);
}
m_objfile = objfile;
}
+ /* Return the primary filetab of the compunit. */
+ symtab *primary_filetab () const;
+
/* Set m_call_site_htab. */
void set_call_site_htab (htab_t call_site_htab);
return symtab_range (cu->filetabs);
}
-/* Return the primary symtab of CUST. */
-
-extern struct symtab *
- compunit_primary_filetab (const struct compunit_symtab *cust);
-
/* Return the language of CUST. */
extern enum language compunit_language (const struct compunit_symtab *cust);