]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Darwin: Support '-ObjC{,++}' as shorthand for -xobjective-c{,++} [PR117478].
authorIain Sandoe <iain@sandoe.co.uk>
Thu, 7 Nov 2024 17:17:46 +0000 (17:17 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 9 Nov 2024 16:29:43 +0000 (16:29 +0000)
This improves compatibility with clang, and is used by some projects.

PR target/117478

gcc/ChangeLog:

* config/darwin-driver.cc (darwin_driver_init): Handle ObjC/ObjC++
* config/darwin.opt: Add ObjC/ObjC++ as driver-only options.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/config/darwin-driver.cc
gcc/config/darwin.opt

index 2aa0b0cd9e4f91e7baaa1caf74e54aeb3c535329..f2aa6be6eea1b5de50a7d73074d2769b3a21f01a 100644 (file)
@@ -351,6 +351,16 @@ darwin_driver_init (unsigned int *decoded_options_count,
            noexport_p = false;
          break;
 
+       case OPT_ObjC:
+         (*decoded_options)[i].opt_index = OPT_x;
+         (*decoded_options)[i].arg = "objective-c";
+         break;
+
+       case OPT_ObjC__:
+         (*decoded_options)[i].opt_index = OPT_x;
+         (*decoded_options)[i].arg = "objective-c++";
+         break;
+
        default:
          break;
        }
index 114048045b90c5e506fa5b47e20cf0493ae9a382..b105828551c5104af7c60c9bf027ef4819e87ae6 100644 (file)
@@ -261,6 +261,12 @@ noseglinkedit
 Driver RejectNegative Negative(seglinkedit)
 (Obsolete) This is the default.
 
+ObjC
+Driver RejectNegative
+
+ObjC++
+Driver RejectNegative
+
 object
 Driver RejectNegative