aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2021-08-15 12:52:30 +0100
committerIain Sandoe <iain@sandoe.co.uk>2021-08-19 19:37:11 +0100
commitde0b250b2badb475f8c09f3cd2c57fd3f9127fe3 (patch)
tree4cbcbafbc21877aac7efd0b50d628735eea8a6ab /gcc/objc
parent18e9e7db7afb8635316414b560c10852db13c4c1 (diff)
downloadgcc-de0b250b2badb475f8c09f3cd2c57fd3f9127fe3.zip
gcc-de0b250b2badb475f8c09f3cd2c57fd3f9127fe3.tar.gz
gcc-de0b250b2badb475f8c09f3cd2c57fd3f9127fe3.tar.bz2
Objective-C, NeXT runtime: Correct the default for fobjc-nilcheck.
It is intended that the default for the NeXT runtime at ABI 2 is to check for nil message receivers. This updates this to match the documented behaviour and to match the behaviour of the system tools. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Default receiver nilchecks on.
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/objc-next-runtime-abi-02.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c
index 0d963e3..ce831fc 100644
--- a/gcc/objc/objc-next-runtime-abi-02.c
+++ b/gcc/objc/objc-next-runtime-abi-02.c
@@ -254,6 +254,10 @@ objc_next_runtime_abi_02_init (objc_runtime_hooks *rthooks)
flag_objc_sjlj_exceptions = 0;
}
+ /* NeXT ABI 2 is intended to default to checking for nil receivers. */
+ if (! global_options_set.x_flag_objc_nilcheck)
+ flag_objc_nilcheck = 1;
+
rthooks->initialize = next_runtime_02_initialize;
rthooks->default_constant_string_class_name = DEF_CONSTANT_STRING_CLASS_NAME;
rthooks->tag_getclass = TAG_GETCLASS;