]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cppinit.c (cpp_handle_option): Don't set no_output here...
authorJakub Jelinek <jakub@redhat.com>
Wed, 1 May 2002 20:04:46 +0000 (22:04 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 1 May 2002 20:04:46 +0000 (22:04 +0200)
* cppinit.c (cpp_handle_option) [-dM]: Don't set no_output here...
(cpp_post_options): ...but here.  Disable -dD, -dN and -dI when
-M -or -MM is in effect.

From-SVN: r53012

gcc/ChangeLog
gcc/cppinit.c

index a08f356851e6d4ea08a3511c66311957a46f20cb..f6cae50896476f35e61f5ed4115dd185ae0d3396 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * cppinit.c (cpp_handle_option) [-dM]: Don't set no_output here...
+       (cpp_post_options): ...but here.  Disable -dD, -dN and -dI when
+       -M -or -MM is in effect.
+
 2002-05-01  Zack Weinberg  <zack@codesourcery.com>
 
        * config.gcc: Correct test of --enable-obsolete.  Obsolete all
index cfba872a9871bda48ca92e3ead6983679d88ad58..872ba6d60394ff3e7074d5104500ea8e3723d4ec 100644 (file)
@@ -1554,7 +1554,6 @@ cpp_handle_option (pfile, argc, argv, ignore)
                {
                case 'M':
                  CPP_OPTION (pfile, dump_macros) = dump_only;
-                 CPP_OPTION (pfile, no_output) = 1;
                  break;
                case 'N':
                  CPP_OPTION (pfile, dump_macros) = dump_names;
@@ -1821,6 +1820,21 @@ cpp_post_options (pfile)
   if (CPP_OPTION (pfile, preprocessed))
     pfile->state.prevent_expansion = 1;
 
+  /* -dM makes no normal output.  This is set here so that -dM -dD
+     works as expected.  */
+  if (CPP_OPTION (pfile, dump_macros) == dump_only)
+    CPP_OPTION (pfile, no_output) = 1;
+
+  /* Disable -dD, -dN and -dI if we should make no normal output
+     (such as with -M). Allow -M -dM since some software relies on
+     this.  */
+  if (CPP_OPTION (pfile, no_output))
+    {
+      if (CPP_OPTION (pfile, dump_macros) != dump_only)
+       CPP_OPTION (pfile, dump_macros) = dump_none;
+      CPP_OPTION (pfile, dump_includes) = 0;
+    }
+
   /* We need to do this after option processing and before
      cpp_start_read, as cppmain.c relies on the options->no_output to
      set its callbacks correctly before calling cpp_start_read.  */