Added -fobjc-abi-version=N and -fobjc-nilcheck flags, and documented them
authorNicola Pero <nicola@gcc.gnu.org>
Thu, 17 Feb 2011 21:34:10 +0000 (21:34 +0000)
committerNicola Pero <nicola@gcc.gnu.org>
Thu, 17 Feb 2011 21:34:10 +0000 (21:34 +0000)
From-SVN: r170257

gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/doc/invoke.texi

index 40d80410b8e454e6c5229af5ebf70cc2b331ac88..26a0c96f366d2d8ff64aa7ebe62334439fca838c 100644 (file)
@@ -1,3 +1,10 @@
+2011-02-17  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+       * doc/invoke.texi (fobjc-abi-version): Documented.
+       (fobjc-nilcheck): Documented.
+       (fno-nil-receiver): Updated documentation to refer to the NeXT ABI
+       version.
+
 2011-02-17  Joseph Myers  <joseph@codesourcery.com>
 
        PR driver/47390
index ec0acab6ee10d3ddbc2b4d744d36645307fb02f6..fece41158c1de5e6e610a751b037f74624223164 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-17  Iain Sandoe  <iains@gcc.gnu.org>
+
+       * c.opt (fobjc-abi-version=) New.
+       (fobjc-nilcheck): New.
+
 2011-02-03  Nathan Froyd  <froydnj@codesourcery.com>
 
        PR c++/46890
index b0d9e5bed89f771ebdc8fc9f1dcd6944dcdc2a96..bb928fa914618e6a4d606ee14e95ffc8e84d8a43 100644 (file)
@@ -853,6 +853,10 @@ fnothrow-opt
 C++ ObjC++ Optimization Var(flag_nothrow_opt)
 Treat a throw() exception specification as noexcept to improve code size
 
+fobjc-abi-version=
+ObjC ObjC++ Joined Report RejectNegative UInteger Var(flag_objc_abi)
+Specify which ABI to use for Objective-C family code and meta-data generation.
+
 ; Generate special '- .cxx_construct' and '- .cxx_destruct' methods
 ; to initialize any non-POD ivars in Objective-C++ classes.
 fobjc-call-cxx-cdtors
@@ -873,6 +877,10 @@ fobjc-gc
 ObjC ObjC++ Var(flag_objc_gc)
 Enable garbage collection (GC) in Objective-C/Objective-C++ programs
 
+fobjc-nilcheck
+ObjC ObjC++ Var(flag_objc_nilcheck,1)
+Enable inline checks for nil receivers with the NeXT runtime and ABI version 2.
+
 ; Nonzero means that we generate NeXT setjmp based exceptions.
 fobjc-sjlj-exceptions
 ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1)
index a916e4ea141afc6e48f3d2573e23420b4dc5719c..5295c39b09ca41ef9b45baaeb1460e1efcc9f294 100644 (file)
@@ -208,10 +208,12 @@ Objective-C and Objective-C++ Dialects}.
 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
 -fgnu-runtime  -fnext-runtime @gol
 -fno-nil-receivers @gol
+-fobjc-abi-version=@var{n} @gol
 -fobjc-call-cxx-cdtors @gol
 -fobjc-direct-dispatch @gol
 -fobjc-exceptions @gol
 -fobjc-gc @gol
+-fobjc-nilcheck @gol
 -fobjc-std=objc1 @gol
 -freplace-objc-classes @gol
 -fzero-link @gol
@@ -2555,8 +2557,19 @@ used.
 Assume that all Objective-C message dispatches (@code{[receiver
 message:arg]}) in this translation unit ensure that the receiver is
 not @code{nil}.  This allows for more efficient entry points in the
-runtime to be used.  Currently, this option is only available in
-conjunction with the NeXT runtime on Mac OS X 10.3 and later.
+runtime to be used.  This option is only available in conjunction with
+the NeXT runtime and ABI version 0 or 1.
+
+@item -fobjc-abi-version=@var{n}
+@opindex fobjc-abi-version
+Use version @var{n} of the Objective-C ABI for the selected runtime.
+This option is currently supported only for the NeXT runtime.  In that
+case, Version 0 is the traditional (32-bit) ABI without support for
+properties and other Objective-C 2.0 additions.  Version 1 is the
+traditional (32-bit) ABI with support for properties and other
+Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
+nothing is specified, the default is Version 0 on 32-bit target
+machines, and Version 2 on 64-bit target machines.
 
 @item -fobjc-call-cxx-cdtors
 @opindex fobjc-call-cxx-cdtors
@@ -2605,6 +2618,16 @@ programs.  This option is only available with the NeXT runtime; the
 GNU runtime has a different garbage collection implementation that
 does not require special compiler flags.
 
+@item -fobjc-nilcheck
+@opindex fobjc-nilcheck
+For the NeXT runtime with version 2 of the ABI, check for a nil
+receiver in method invocations before doing the actual method call.
+This is the default and can be disabled using
+@option{-fno-objc-nilcheck}.  Class methods and super calls are never
+checked for nil in this way no matter what this flag is set to.
+Currently this flag does nothing when the GNU runtime, or an older
+version of the NeXT runtime ABI, is used.
+
 @item -fobjc-std=objc1
 @opindex fobjc-std
 Conform to the language syntax of Objective-C 1.0, the language