This changes compunit_language to be a method on compunit_symtab.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
m_builder.reset (new struct buildsym_compunit
(cust->objfile (), "",
cust->dirname (),
- compunit_language (cust),
+ cust->language (),
0, cust));
list_in_scope = get_builder ()->get_file_symbols ();
}
m_builder.reset (new struct buildsym_compunit
(cust->objfile (), "",
cust->dirname (),
- compunit_language (cust),
+ cust->language (),
0, cust));
list_in_scope = get_builder ()->get_file_symbols ();
struct compunit_symtab *cust = find_pc_compunit_symtab (pc);
if (cust != NULL
- && compunit_language (cust) != current_language->la_language
- && compunit_language (cust) != language_unknown
+ && cust->language () != current_language->la_language
+ && cust->language () != language_unknown
&& language_mode == language_mode_auto)
- set_language (compunit_language (cust));
+ set_language (cust->language ());
}
}
}
struct compunit_symtab *cust = find_pc_compunit_symtab (pc);
if (cust != NULL)
- return compunit_language (cust);
+ return cust->language ();
}
return language_unknown;
compunit_symtab *cust
= find_pc_compunit_symtab (ecs->event_thread->stop_pc ());
- if (cust != NULL && compunit_language (cust) != language_asm)
+ if (cust != NULL && cust->language () != language_asm)
ecs->stop_func_start
= gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
fill_in_stop_func (gdbarch, ecs);
cust = find_pc_compunit_symtab (ecs->event_thread->stop_pc ());
- if (cust != NULL && compunit_language (cust) != language_asm)
+ if (cust != NULL && cust->language () != language_asm)
ecs->stop_func_start
= gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
symtab = allocate_symtab (cust, name);
symtab->set_linetable (new_linetable (maxlines));
- lang = compunit_language (cust);
+ lang = cust->language ();
/* All symtabs must have at least two blocks. */
bv = new_bvect (2);
/* See symtab.h. */
enum language
-compunit_language (const struct compunit_symtab *cust)
+compunit_symtab::language () const
{
- struct symtab *symtab = cust->primary_filetab ();
+ struct symtab *symtab = primary_filetab ();
-/* The language of the compunit symtab is the language of its primary
- source file. */
+ /* The language of the compunit symtab is the language of its
+ primary source file. */
return symtab->language ();
}
/* Find call_site info for PC. */
call_site *find_call_site (CORE_ADDR pc) const;
+ /* Return the language of this compunit_symtab. */
+ enum language language () const;
+
/* Unordered chain of all compunit symtabs of this objfile. */
struct compunit_symtab *next;
using compunit_symtab_range = next_range<compunit_symtab>;
-/* Return the language of CUST. */
-
-extern enum language compunit_language (const struct compunit_symtab *cust);
-
/* Return true if this symtab is the "main" symtab of its compunit_symtab. */
static inline bool