From patchwork Mon Nov 22 23:01:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 72609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 95283B70FC for ; Tue, 23 Nov 2010 10:02:00 +1100 (EST) Received: (qmail 5232 invoked by alias); 22 Nov 2010 23:01:57 -0000 Received: (qmail 5219 invoked by uid 22791); 22 Nov 2010 23:01:54 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL, BAYES_00, SARE_SUB_ENC_UTF8, TW_BJ, TW_JC, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Nov 2010 23:01:48 +0000 Received: from eggs.gnu.org ([140.186.70.92]:47470) by fencepost.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PKfOK-0006ye-IW for gcc-patches@gnu.org; Mon, 22 Nov 2010 18:01:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKfOL-0001Rb-BL for gcc-patches@gnu.org; Mon, 22 Nov 2010 18:01:46 -0500 Received: from smtp191.iad.emailsrvr.com ([207.97.245.191]:53482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PKfOL-0001RR-8s for gcc-patches@gnu.org; Mon, 22 Nov 2010 18:01:45 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp39.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id AA1A5985E3 for ; Mon, 22 Nov 2010 18:01:44 -0500 (EST) Received: from dynamic4.wm-web.iad.mlsrvr.com (dynamic4.wm-web.iad1a.rsapps.net [192.168.2.153]) by smtp39.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 33B2398609 for ; Mon, 22 Nov 2010 18:01:44 -0500 (EST) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic4.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id 0ADDD1D4A26B for ; Mon, 22 Nov 2010 18:01:44 -0500 (EST) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Tue, 23 Nov 2010 00:01:44 +0100 (CET) Date: Tue, 23 Nov 2010 00:01:44 +0100 (CET) Subject: =?UTF-8?Q?PR=20objc/24538=20(inconsistent=20objective-c=20objective-c++?= =?UTF-8?Q?=20language=20list)?= From: "Nicola Pero" To: "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain Message-ID: <1290466904.04214888@192.168.2.227> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 . */ -/* 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 + 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 + 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 + + PR objc/24358 + * lang-specs.h: Print a deprecation note every time + objc++-cpp-output is requested. + 2010-10-24 Nicola Pero * objcp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Do not define.