aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-pch.c
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2003-04-05 07:01:51 +0000
committerGeoffrey Keating <geoffk@apple.com>2003-04-05 07:01:51 +0000
commit5116676bcbd7742cdf19e54dc6b4145469815031 (patch)
tree3da09cdc35a115a5b68c8b9d716e7e83e9721d11 /gcc/c-pch.c
parent57011c53305a82a20525e71402123bd0d14bd2be (diff)
2003-04-04 Geoffrey Keating <geoffk@apple.com>
* dbxout.c (scope_labelno): Add GTY. (have_used_extensions): Add GTY. (source_label_number): Add GTY. (lastfile): Add GTY. (lastfile_is_base): New. (base_input_file): New. (dbxout_handle_pch): New. (dbx_debug_hooks): Add handle_pch. (xcoff_debug_hooks): Likewise. (dbxout_function_end): Remove scope_labelno. (dbxout_init): Set base_input_file. (dbxout_handle_pch): New. (dbxout_source_file): Honour lastfile_is_base. * dwarfout.c (dwarf_debug_hooks): Add dummy handle_pch. * sdbout.c (sdb_debug_hooks): Add dummy handle_pch. * vmsdbgout.c (vmsdbg_debug_hooks): Add dummy handle_pch. * dwarf2out.c (dwarf2_debug_hooks): Add dummy handle_pch. * debug.c (do_nothing_debug_hooks): Add dummy handle_pch. * debug.h (struct gcc_debug_hooks): Add handle_pch. * c-pch.c (pch_init): Don't call start_source_file, but do call handle_pch. (c_common_write_pch): Call handle_pch. (c_common_read_pch): Don't call start_source_file, or end_source_file. Index: gcc/testsuite/ChangeLog 2003-04-04 Geoffrey Keating <geoffk@apple.com> * gcc.dg/pch/static-3.c: New. * gcc.dg/pch/static-3.hs: New. * gcc.dg/pch/pch.exp: Test with -O0 -g too. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@65266 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pch.c')
-rw-r--r--gcc/c-pch.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/c-pch.c b/gcc/c-pch.c
index 821eddba088..27a299ffd3e 100644
--- a/gcc/c-pch.c
+++ b/gcc/c-pch.c
@@ -68,10 +68,6 @@ pch_init ()
if (pch_file)
{
- /* We're precompiling a header file, so when it's actually used,
- it'll be at least one level deep. */
- (*debug_hooks->start_source_file) (lineno, input_filename);
-
f = fopen (pch_file, "w+b");
if (f == NULL)
fatal_io_error ("can't open %s", pch_file);
@@ -88,6 +84,9 @@ pch_init ()
asm_file_startpos = ftell (asm_out_file);
+ /* Let the debugging format deal with the PCHness. */
+ (*debug_hooks->handle_pch) (0);
+
cpp_save_state (parse_in, f);
}
}
@@ -100,6 +99,8 @@ c_common_write_pch ()
long written;
struct c_pch_header h;
+ (*debug_hooks->handle_pch) (1);
+
cpp_write_pch_deps (parse_in, pch_outfile);
asm_file_end = ftell (asm_out_file);
@@ -195,7 +196,7 @@ c_common_read_pch (pfile, name, fd, orig_name)
cpp_reader *pfile;
const char *name;
int fd;
- const char *orig_name;
+ const char *orig_name ATTRIBUTE_UNUSED;
{
FILE *f;
struct c_pch_header h;
@@ -203,10 +204,6 @@ c_common_read_pch (pfile, name, fd, orig_name)
unsigned long written;
struct save_macro_data *smd;
- /* Before we wrote the file, we started a source file, so we have to start
- one here to match. */
- (*debug_hooks->start_source_file) (lineno, orig_name);
-
f = fdopen (fd, "rb");
if (f == NULL)
{
@@ -243,6 +240,4 @@ c_common_read_pch (pfile, name, fd, orig_name)
return;
fclose (f);
-
- (*debug_hooks->end_source_file) (lineno);
}