OSDN Git Service

* cppinit.c (cpp_handle_option) [-dM]: Don't set no_output here...
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 May 2002 20:07:36 +0000 (20:07 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 May 2002 20:07:36 +0000 (20:07 +0000)
(cpp_post_options): ...but here.  Disable -dD, -dN and -dI when
-M -or -MM is in effect.

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

gcc/ChangeLog
gcc/cppinit.c

index 2481179..0a2d1c5 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 c4f5942..cee7571 100644 (file)
@@ -1549,7 +1549,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;
@@ -1820,6 +1819,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.  */