public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PR objc/24538 (inconsistent objective-c objective-c++ language list)
@ 2010-11-22 23:55 Nicola Pero
  2010-11-23  3:49 ` Mike Stump
  0 siblings, 1 reply; 2+ messages in thread
From: Nicola Pero @ 2010-11-22 23:55 UTC (permalink / raw)
  To: gcc-patches

This is a patch for PR objc/24358.

The problem is that the list of languages for objective-c and objective-c++ 
is incorrect.  The GCC documentation mentions as valid languages

 objective-c
 objective-c-header
 objective-c-cpp-output

 objective-c++
 objective-c++-header
 objective-c++-cpp-output

which is nicely consistent with the list for c and c++ (eg, c++ has c++, c++-header, 
c++-cpp-output).

Unfortunately (PR objc/24358), the actual compiler is missing objective-c-cpp-output, 
and has objc-cpp-output instead.  It also supports the undocumented objc++-cpp-output 
in addition to objective-c++-cpp-output.

This patch changes the compiler to support the list of languages described in the GCC 
documentation.

Of course, there is the problem of what to do with objc-cpp-output and objc++-cpp-output.
In this patch I have left them as duplicates of objective-c-cpp-output and objective-c++-cpp-output 
for backwards-compatibility, but I hacked the lang spec for objc-cpp-output and objc++-cpp-output
to print a deprecation notice whenever they are used, inviting people to switch to objective-c-cpp-output 
and objective-c++-cpp-output.  We could leave objc-cpp-output and objc++-cpp-output there 
for a few years/releases, then remove them once people had time to update their software 
(assuming there is anyone using "-x objc-cpp-output").

Ok to commit ?

Thanks

PS: I tried clang and it supports the same list as in the GCC documentation, so we're also reducing
incompatibilities.

Index: objc/lang-specs.h
===================================================================
--- objc/lang-specs.h   (revision 167054)
+++ objc/lang-specs.h   (working copy)
@@ -19,8 +19,8 @@ along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
 
-/* This is the contribution to the `default_compilers' array in gcc.c for
-   objc.  */
+/* This is the contribution to the `default_compilers' array in gcc.c
+   for objc.  */
 
   {".m", "@objective-c", 0, 0, 0},
   {"@objective-c",
@@ -34,10 +34,6 @@ along with GCC; see the file COPYING3.  If not see
        %{!save-temps:%{!no-integrated-cpp:\
            cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\
         %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
-  {".mi", "@objc-cpp-output", 0, 0, 0},
-  {"@objc-cpp-output",
-     "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
-                            %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
   {"@objective-c-header",
      "%{E|M|MM:cc1obj -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}\
           %(cpp_options) %(cpp_debug_options)}\
@@ -52,3 +48,11 @@ along with GCC; see the file COPYING3.  If not see
            cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
                         -o %g.s %{!o*:--output-pch=%i.gch}\
                         %W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0},
+  {".mi", "@objective-c-cpp-output", 0, 0, 0},
+  {"@objective-c-cpp-output",
+     "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
+                            %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+  {"@objc-cpp-output",
+      "%nobjc-cpp-output is deprecated; please use objective-c-cpp-output instead\n\
+       %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
+                            %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
Index: objc/ChangeLog
===================================================================
--- objc/ChangeLog      (revision 167054)
+++ objc/ChangeLog      (working copy)
@@ -1,5 +1,12 @@
 2010-11-22  Nicola Pero  <nicola.pero@meta-innovation.com>
 
+       PR objc/24358
+       * lang-specs.h: Added objective-c-cpp-output.  Mapped .mi to
+       objective-c-cpp-output instead of objc-cpp-output.  Print a
+       deprecation note every time objc-cpp-output is requested.
+
+2010-11-22  Nicola Pero  <nicola.pero@meta-innovation.com>
+
        PR objc/41108
        * objc-act.c (objc_generate_write_barrier): Added assert to make sure
        this function is only called with the next runtime.
Index: objcp/lang-specs.h
===================================================================
--- objcp/lang-specs.h  (revision 167054)
+++ objcp/lang-specs.h  (working copy)
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3.  If not see
     cc1objplus -fpreprocessed %i %(cc1_options) %2\
     %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
   {"@objc++-cpp-output",
-   "%{!M:%{!MM:%{!E:\
+   "%nobjc++-cpp-output is deprecated; please use objective-c++-cpp-output instead\n\
+    %{!M:%{!MM:%{!E:\
     cc1objplus -fpreprocessed %i %(cc1_options) %2\
     %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
Index: objcp/ChangeLog
===================================================================
--- objcp/ChangeLog     (revision 167054)
+++ objcp/ChangeLog     (working copy)
@@ -1,3 +1,9 @@
+2010-11-22  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+       PR objc/24358
+       * lang-specs.h: Print a deprecation note every time
+       objc++-cpp-output is requested.
+
 2010-10-24  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * objcp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Do not define.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PR objc/24538 (inconsistent objective-c objective-c++ language list)
  2010-11-22 23:55 PR objc/24538 (inconsistent objective-c objective-c++ language list) Nicola Pero
@ 2010-11-23  3:49 ` Mike Stump
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Stump @ 2010-11-23  3:49 UTC (permalink / raw)
  To: Nicola Pero; +Cc: gcc-patches

On Nov 22, 2010, at 3:01 PM, Nicola Pero wrote:
> This is a patch for PR objc/24358.

> Ok to commit ?

Ok.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-22 23:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-22 23:55 PR objc/24538 (inconsistent objective-c objective-c++ language list) Nicola Pero
2010-11-23  3:49 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).