else
{
m_line_has_non_zero_discriminator = m_discriminator != 0;
- dwarf2_start_subfile (m_cu, *fe, *m_cu->line_header);
+ dwarf2_start_subfile (*m_cu, *fe);
}
}
const file_entry *fe = state_machine.current_file ();
if (fe != NULL)
- dwarf2_start_subfile (cu, *fe, *lh);
+ dwarf2_start_subfile (*cu, *fe);
/* Decode the table. */
while (line_ptr < line_end && !end_sequence)
buildsym_compunit *builder = cu->get_builder ();
struct compunit_symtab *cust = builder->get_compunit_symtab ();
- struct line_header *lh = cu->line_header;
- for (file_entry &fe : lh->file_names ())
+ for (file_entry &fe : cu->line_header->file_names ())
{
- dwarf2_start_subfile (cu, fe, *lh);
+ dwarf2_start_subfile (*cu, fe);
subfile *sf = builder->get_current_subfile ();
if (sf->symtab == nullptr)
for (i = 0; i < file_names.size (); ++i)
{
file_entry &fe = file_names[i];
- dwarf2_start_subfile (this, fe, *line_header);
+ dwarf2_start_subfile (*this, fe);
buildsym_compunit *b = get_builder ();
subfile *sf = b->get_current_subfile ();
/* See dwarf2/read.h. */
void
-dwarf2_start_subfile (dwarf2_cu *cu, const file_entry &fe,
- const line_header &lh)
+dwarf2_start_subfile (dwarf2_cu &cu, const file_entry &fe)
{
std::string filename_holder;
const char *filename = fe.name;
- const char *dirname = lh.include_dir_at (fe.d_index);
+ const char *dirname = cu.line_header->include_dir_at (fe.d_index);
/* In order not to lose the line information directory,
we concatenate it to the filename when it makes sense.
filename = filename_holder.c_str ();
}
- std::string filename_for_id = lh.file_file_name (fe);
- cu->get_builder ()->start_subfile (filename, filename_for_id.c_str ());
+ std::string filename_for_id = cu.line_header->file_file_name (fe);
+ cu.get_builder ()->start_subfile (filename, filename_for_id.c_str ());
}
static void
extern struct dwarf2_section_info *get_debug_line_section
(struct dwarf2_cu *cu);
-/* Start a subfile for DWARF. FILENAME is the name of the file and
- DIRNAME the name of the source directory which contains FILENAME
- or NULL if not known.
+/* Start a subfile for FE within CU.
+
This routine tries to keep line numbers from identical absolute and
relative file names in a common subfile.
start_subfile will ensure that this happens provided that we pass the
concatenation of files.files[1].dir and files.files[1].name as the
subfile's name. */
-extern void dwarf2_start_subfile (dwarf2_cu *cu, const file_entry &fe,
- const line_header &lh);
+extern void dwarf2_start_subfile (dwarf2_cu &cu, const file_entry &fe);
/* A helper function that decides if a given symbol is an Ada Pragma
Import or Pragma Export. */