aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2024-11-07 17:17:46 +0000
committerIain Sandoe <iain@sandoe.co.uk>2024-11-09 16:29:43 +0000
commit7729df2f828a8a4f217a76e7ae763bdac95dee71 (patch)
treeac82a7148d86a123049957a6615bdc3d2e641eaf
parented88bc2344321ee21e92afdd83b50699c4e4df79 (diff)
downloadgcc-7729df2f828a8a4f217a76e7ae763bdac95dee71.zip
gcc-7729df2f828a8a4f217a76e7ae763bdac95dee71.tar.gz
gcc-7729df2f828a8a4f217a76e7ae763bdac95dee71.tar.bz2
Darwin: Support '-ObjC{,++}' as shorthand for -xobjective-c{,++} [PR117478].
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>
-rw-r--r--gcc/config/darwin-driver.cc10
-rw-r--r--gcc/config/darwin.opt6
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/darwin-driver.cc b/gcc/config/darwin-driver.cc
index 2aa0b0c..f2aa6be 100644
--- a/gcc/config/darwin-driver.cc
+++ b/gcc/config/darwin-driver.cc
@@ -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;
}
diff --git a/gcc/config/darwin.opt b/gcc/config/darwin.opt
index 1140480..b105828 100644
--- a/gcc/config/darwin.opt
+++ b/gcc/config/darwin.opt
@@ -261,6 +261,12 @@ noseglinkedit
Driver RejectNegative Negative(seglinkedit)
(Obsolete) This is the default.
+ObjC
+Driver RejectNegative
+
+ObjC++
+Driver RejectNegative
+
object
Driver RejectNegative