Suppress extra '#1 <built-in> or '#1 <command line>' on -dD output.
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Jun 2006 16:36:25 +0000 (16:36 +0000)
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Jun 2006 16:36:25 +0000 (16:36 +0000)
* c-opts.c (finish_options): Use internal line 0 for <command-line>.
* c-ppoutput.c (cb_define): Don't increment line 0.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114311 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-opts.c
gcc/c-ppoutput.c

index e842227..c02569e 100644 (file)
@@ -1,3 +1,9 @@
+2006-06-01  Per Bothner  <bothner@bothner.com>
+
+       Suppress extra '#1 <built-in> or '#1 <command line>' on -dD output.
+       * c-opts.c (finish_options): Use internal line 0 for <command-line>.
+       * c-ppoutput.c (cb_define): Don't increment line 0.
+
 2006-06-01  Pete Steinmetz  <steinmtz@us.ibm.com>
 
        * doc/invoke.texi: Add cpu_type power6.
index ea631b0..2937b79 100644 (file)
@@ -1373,7 +1373,10 @@ finish_options (void)
         their acceptance on the -std= setting.  */
       cpp_opts->warn_dollars = (cpp_opts->pedantic && !cpp_opts->c99);
 
-      cpp_change_file (parse_in, LC_RENAME, _("<command line>"));
+      cb_file_change (parse_in,
+                     linemap_add (&line_table, LC_RENAME, 0,
+                                  _("<command-line>"), 0));
+
       for (i = 0; i < deferred_count; i++)
        {
          struct deferred_opt *opt = &deferred_opts[i];
index 2c4640c..10540b7 100644 (file)
@@ -324,7 +324,8 @@ cb_define (cpp_reader *pfile, source_location line, cpp_hashnode *node)
     fputs ((const char *) NODE_NAME (node), print.outf);
 
   putc ('\n', print.outf);
-  print.src_line++;
+  if (linemap_lookup (&line_table, line)->to_line != 0)
+    print.src_line++;
 }
 
 static void