c-opts.c (c_common_parse_file): Only start/end main source file if debug hooks says...
authorDaniel Berlin <dberlin@dberlin.org>
Tue, 22 Mar 2005 23:18:43 +0000 (23:18 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Tue, 22 Mar 2005 23:18:43 +0000 (23:18 +0000)
2005-03-22  Daniel Berlin  <dberlin@dberlin.org>

* c-opts.c (c_common_parse_file): Only start/end main source file
if debug hooks says the writer wants it.
* dbxout.c (dbx_debug_hooks): Add start_end_main_source_file
member.
(xcoff_debug_hooks): Ditto.
* debug.c (do_nothing_hooks): Ditto.
* debug.h (gcc_debug_hooks): Ditto.
* dwarf2out.c (dwarf2_debug_hooks): Ditto.
* sdbout.c (sdb_debug_hooks): Ditto.
* vmsdbgout.c (vmsdbg_debug_hooks): Ditto.

From-SVN: r96902

gcc/ChangeLog
gcc/c-opts.c
gcc/dbxout.c
gcc/debug.c
gcc/debug.h
gcc/dwarf2out.c
gcc/sdbout.c
gcc/vmsdbgout.c

index 2da080afb841f155712ce95708a51856b817c0dc..a48df49a5284d3c277d5dc960cd2d45e8bf76540 100644 (file)
@@ -1,3 +1,16 @@
+2005-03-22  Daniel Berlin  <dberlin@dberlin.org>
+
+       * c-opts.c (c_common_parse_file): Only start/end main source file
+       if debug hooks says the writer wants it.
+       * dbxout.c (dbx_debug_hooks): Add start_end_main_source_file
+       member.
+       (xcoff_debug_hooks): Ditto.
+       * debug.c (do_nothing_hooks): Ditto.
+       * debug.h (gcc_debug_hooks): Ditto.
+       * dwarf2out.c (dwarf2_debug_hooks): Ditto.
+       * sdbout.c (sdb_debug_hooks): Ditto.
+       * vmsdbgout.c (vmsdbg_debug_hooks): Ditto.
+       
 2005-03-22  Mark Mitchell  <mark@codesourcery.com>
 
        * doc/extend.texi: Deprecate C++ min/max operators.
index 731511ab6ee5b16ee114453ff17bfef16beca916..42c8236fc03325b34bee6e3129718e4f068aea36 100644 (file)
@@ -1102,16 +1102,18 @@ c_common_parse_file (int set_yydebug)
   i = 0;
   for (;;)
     {
-      /* Start the main input file */
-      (*debug_hooks->start_source_file) (0, this_input_filename);
+      /* Start the main input file, if the debug writer wants it. */
+      if (debug_hooks->start_end_main_source_file)
+       (*debug_hooks->start_source_file) (0, this_input_filename);
       finish_options ();
       pch_init ();
       push_file_scope ();
       c_parse_file ();
       finish_file ();
       pop_file_scope ();
-      /* And end the main input file.  */
-      (*debug_hooks->end_source_file) (0);
+      /* And end the main input file, if the debug writer wants it  */
+      if (debug_hooks->start_end_main_source_file)
+       (*debug_hooks->end_source_file) (0);
       if (++i >= num_in_fnames)
        break;
       cpp_undef_all (parse_in);
index 6383d48d0e9434c4ab905713c66a3e1150eff16e..271cc1984031da5f901b3df4d8f25dfab84171e0 100644 (file)
@@ -378,7 +378,8 @@ const struct gcc_debug_hooks dbx_debug_hooks =
   debug_nothing_tree,                   /* outlining_inline_function */
   debug_nothing_rtx,                    /* label */
   dbxout_handle_pch,                    /* handle_pch */
-  debug_nothing_rtx                     /* var_location */
+  debug_nothing_rtx,                    /* var_location */
+  0                                      /* start_end_main_source_file */
 };
 #endif /* DBX_DEBUGGING_INFO  */
 
@@ -408,7 +409,8 @@ const struct gcc_debug_hooks xcoff_debug_hooks =
   debug_nothing_tree,                   /* outlining_inline_function */
   debug_nothing_rtx,                    /* label */
   dbxout_handle_pch,                    /* handle_pch */
-  debug_nothing_rtx                     /* var_location */
+  debug_nothing_rtx,                    /* var_location */
+  0                                      /* start_end_main_source_file */
 };
 #endif /* XCOFF_DEBUGGING_INFO  */
 \f
index 812920604ba636a5f13b39824c42e6a88b2e8fe2..226dc4ec60136d1382239e394c5eeaef6f7944ec 100644 (file)
@@ -47,7 +47,8 @@ const struct gcc_debug_hooks do_nothing_debug_hooks =
   debug_nothing_tree,                   /* outlining_inline_function */
   debug_nothing_rtx,                    /* label */
   debug_nothing_int,                    /* handle_pch */
-  debug_nothing_rtx                     /* var_location */
+  debug_nothing_rtx,                    /* var_location */
+  0                                      /* start_end_main_source_file */
 };
 
 /* This file contains implementations of each debug hook that do
index 547b7f68eab209d864e69d70a2e2b798fe463aa2..3feccc5331304260ee3b77f5b9a8aac1fc26741f 100644 (file)
@@ -119,6 +119,10 @@ struct gcc_debug_hooks
 
   /* Called from final_scan_insn for any NOTE_INSN_VAR_LOCATION note.  */
   void (* var_location) (rtx);
+
+  /* This is 1 if the debug writer wants to see start and end commands for the
+     main source files, and 0 otherwise.  */
+  int start_end_main_source_file;
 };
 
 extern const struct gcc_debug_hooks *debug_hooks;
index c4030f248b304fc43d29388acc50c6a8fee9e53f..24e573b2ea4cd3885eed324b324b25ce4d9c83d3 100644 (file)
@@ -3444,7 +3444,8 @@ const struct gcc_debug_hooks dwarf2_debug_hooks =
   dwarf2out_abstract_function, /* outlining_inline_function */
   debug_nothing_rtx,           /* label */
   debug_nothing_int,           /* handle_pch */
-  dwarf2out_var_location
+  dwarf2out_var_location,
+  1                             /* start_end_main_source_file */
 };
 #endif
 \f
index 91a7a2cc256e5516b30b0fbefc2ca12b12174a09..e6ab7fb6c40d0de6b85640ce50eafdcb8cd61686 100644 (file)
@@ -335,7 +335,8 @@ const struct gcc_debug_hooks sdb_debug_hooks =
   debug_nothing_tree,                   /* outlining_inline_function */
   sdbout_label,                                 /* label */
   debug_nothing_int,                    /* handle_pch */
-  debug_nothing_rtx                     /* var_location */
+  debug_nothing_rtx,                    /* var_location */
+  0                                      /* start_end_main_source_file */
 };
 
 /* Return a unique string to name an anonymous type.  */
index 158661daf6f94a5335289f3b163ea870216c1b36..d0f4abe6e0acf8fd179c737830ec7ab5793ddaaf 100644 (file)
@@ -209,7 +209,8 @@ const struct gcc_debug_hooks vmsdbg_debug_hooks
    vmsdbgout_abstract_function,
    debug_nothing_rtx,            /* label */
    debug_nothing_int,            /* handle_pch */
-   debug_nothing_rtx             /* var_location */
+   debug_nothing_rtx,            /* var_location */
+   0                              /* start_end_main_source_file */
 };
 
 /* Definitions of defaults for assembler-dependent names of various