static int inclLength; /* table length */
static int inclDepth; /* nested include depth */
+/* subfile structure for the main compilation unit. */
+static subfile *main_subfile;
+
static void allocate_include_entry (void);
static void
inclTable = XCNEWVEC (InclTable, INITIAL_INCLUDE_TABLE_LENGTH);
inclLength = INITIAL_INCLUDE_TABLE_LENGTH;
inclIndx = 0;
+ main_subfile = new subfile;
}
else if (inclIndx >= inclLength)
{
file_ptr max_offset
= XCOFF_DATA (this_symtab_objfile)->max_lineno_offset;
- /* subfile structure for the main compilation unit. */
- struct subfile main_subfile;
-
/* In the main source file, any time we see a function entry, we
reset this variable to function's absolute starting line number.
All the following line numbers in the function are relative to
/* All source lines were in the main source file. None in include
files. */
- enter_line_range (&main_subfile, offset, 0, start, end,
+ enter_line_range (main_subfile, offset, 0, start, end,
&main_source_baseline);
else
if (offset < inclTable[ii].begin)
{
enter_line_range
- (&main_subfile, offset, inclTable[ii].begin - linesz,
+ (main_subfile, offset, inclTable[ii].begin - linesz,
start, 0, &main_source_baseline);
}
main_source_baseline = inclTable[ii].funStartLine;
enter_line_range
- (&main_subfile, inclTable[ii].begin, inclTable[ii].end,
+ (main_subfile, inclTable[ii].begin, inclTable[ii].end,
start, 0, &main_source_baseline);
- inclTable[ii].subfile = &main_subfile;
+ inclTable[ii].subfile = main_subfile;
}
else
{
enter remaining lines of the main file, if any left. */
if (offset < max_offset + 1 - linesz)
{
- enter_line_range (&main_subfile, offset, 0, start, end,
+ enter_line_range (main_subfile, offset, 0, start, end,
&main_source_baseline);
}
}
/* Process main file's line numbers. */
- if (!main_subfile.line_vector_entries.empty ())
+ if (!main_subfile->line_vector_entries.empty ())
{
/* Line numbers are not necessarily ordered. xlc compilation will
put static function to the end. */
- arrange_linetable (main_subfile.line_vector_entries);
+ arrange_linetable (main_subfile->line_vector_entries);
}
/* Now, process included files' line numbers. */
for (int ii = 0; ii < inclIndx; ++ii)
{
- if (inclTable[ii].subfile != ((struct subfile *) &main_subfile)
+ if (inclTable[ii].subfile != main_subfile
&& !inclTable[ii].subfile->line_vector_entries.empty ())
{
/* Line numbers are not necessarily ordered. xlc compilation will
{
xfree (inclTable);
inclTable = NULL;
+ delete main_subfile;
}
inclIndx = inclLength = inclDepth = 0;
}