===================================================================
@@ -919,8 +919,8 @@ Enable inline checks for nil receivers with the Ne
; Nonzero means that we generate NeXT setjmp based exceptions.
fobjc-sjlj-exceptions
-ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1)
-Enable Objective-C setjmp exception handling runtime
+ObjC ObjC++ Ignore Warn(switch %qs has been removed and is set automatically where required)
+Option removed
fobjc-std=objc1
ObjC ObjC++ Var(flag_objc1_only)
===================================================================
@@ -894,12 +894,6 @@ c_common_post_options (const char **pfilename)
else if (!flag_gnu89_inline && !flag_isoc99)
error ("-fno-gnu89-inline is only supported in GNU99 or C99 mode");
- /* Default to ObjC sjlj exception handling if NeXT runtime. */
- if (flag_objc_sjlj_exceptions < 0)
- flag_objc_sjlj_exceptions = flag_next_runtime;
- if (flag_objc_exceptions && !flag_objc_sjlj_exceptions)
- flag_exceptions = 1;
-
/* -Wextra implies the following flags
unless explicitly overridden. */
if (warn_type_limits == -1)
===================================================================
@@ -98,6 +98,8 @@ along with GCC; see the file COPYING3. If not see
#define CLS_HAS_CXX_STRUCTORS 0x2000L
+#define FLAG_OBJC_SJLJ_EXCEPTIONS true
+
/* rt_trees identifiers - shared between NeXT implementations. These
allow the FE to tag meta-data in a manner that survives LTO and can
be used when the runtime requires that certain meta-data items
@@ -145,14 +147,11 @@ static tree finish_try_stmt (struct objc_try_conte
bool
objc_next_runtime_abi_01_init (objc_runtime_hooks *rthooks)
{
- if (flag_objc_exceptions
- && !flag_objc_sjlj_exceptions)
- {
- warning_at (UNKNOWN_LOCATION, OPT_Wall,
- "%<-fobjc-sjlj-exceptions%> is the only supported exceptions "
- "system for %<-fnext-runtime%> with %<-fobjc-abi-version%> < 2");
- }
+ /* NeXT V0/1 Objective-C and Objective-C++ exceptions (i.e. @throw) are
+ SjLj exceptions. */
+ flag_objc_sjlj_exceptions = FLAG_OBJC_SJLJ_EXCEPTIONS;
+
rthooks->initialize = next_runtime_01_initialize;
rthooks->default_constant_string_class_name = DEF_CONSTANT_STRING_CLASS_NAME;
rthooks->tag_getclass = TAG_GETCLASS;
@@ -384,7 +383,7 @@ static void next_runtime_01_initialize (void)
objc_setPropertyStruct_decl = NULL_TREE;
build_next_objc_exception_stuff ();
- if (flag_objc_exceptions && !flag_objc_sjlj_exceptions)
+ if (flag_objc_exceptions && !FLAG_OBJC_SJLJ_EXCEPTIONS)
using_eh_for_cleanups ();
lang_hooks.eh_runtime_type = objc_eh_runtime_type;
lang_hooks.eh_personality = objc_eh_personality;
@@ -2909,7 +2908,7 @@ build_throw_stmt (location_t loc, tree throw_expr,
static tree
objc_build_exc_ptr (struct objc_try_context **cur_try_context)
{
- if (flag_objc_sjlj_exceptions)
+ if (FLAG_OBJC_SJLJ_EXCEPTIONS)
{
tree var = (*cur_try_context)->caught_decl;
if (!var)
@@ -2957,7 +2956,7 @@ finish_try_stmt (struct objc_try_context **cur_try
tree stmt;
struct objc_try_context *c = *cur_try_context;
/* If we're doing Darwin setjmp exceptions, build the big nasty. */
- if (flag_objc_sjlj_exceptions)
+ if (FLAG_OBJC_SJLJ_EXCEPTIONS)
{
bool save = in_late_binary_op;
in_late_binary_op = true;
===================================================================
@@ -239,11 +239,17 @@ objc_next_runtime_abi_02_init (objc_runtime_hooks
{
extern_names = ggc_alloc_cleared_vec_hash (SIZEHASHTABLE);
- if (flag_objc_exceptions && flag_objc_sjlj_exceptions)
+ if (flag_objc_exceptions)
{
- inform (UNKNOWN_LOCATION, "%<-fobjc-sjlj-exceptions%> is ignored for "
- "%<-fnext-runtime%> when %<-fobjc-abi-version%> >= 2");
- flag_objc_sjlj_exceptions = 0;
+ /* If the User has not specified fexceptions, set it silently. */
+ if (!global_options_set.x_flag_exceptions)
+ flag_exceptions = 1;
+ else if (!flag_exceptions)
+ /* If the User has explicitly specified -fno-exceptions together
+ with -fobjc-exceptions, this is an error. */
+ error_at (UNKNOWN_LOCATION, "%<-fobjc-exceptions%> requires"
+ "%<-fexceptions%> for the 64 bit NeXT"
+ " runtime");
}
rthooks->initialize = next_runtime_02_initialize;
===================================================================
@@ -267,6 +267,11 @@ FILE *gen_declaration_file;
/* Hooks for stuff that differs between runtimes. */
objc_runtime_hooks runtime;
+/* We've removed the SjLj switch, but there is still one case where the
+ code generated here needs to account for it. */
+
+bool flag_objc_sjlj_exceptions = false;
+
/* Create a temporary variable of type 'type'. If 'name' is set, uses
the specified name, else use no name. Returns the declaration of
the type. The 'name' is mostly useful for debugging.
===================================================================
@@ -689,6 +689,11 @@ struct objc_try_context
tree rethrow_decl;
};
+/* We've removed the SjLj switch, but there is still one case where the
+ code generated in objc-act.c needs to account for it. */
+
+extern bool flag_objc_sjlj_exceptions;
+
/* A small number of routines used by the FE parser and the runtime code
generators. Put here as inlines for efficiency in non-lto builds rather
than making them externs. */
===================================================================
@@ -132,12 +132,17 @@ objc_gnu_runtime_abi_01_init (objc_runtime_hooks *
flag_objc_gc = 0;
}
- /* Although I guess we could, we don't currently support SJLJ exceptions for the
- GNU runtime. */
- if (flag_objc_sjlj_exceptions)
+ /* Objective C exceptions implies -fexceptions for the GNU Runtime. */
+ if (flag_objc_exceptions)
{
- inform (UNKNOWN_LOCATION, "%<-fobjc-sjlj-exceptions%> is ignored for %<-fgnu-runtime%>");
- flag_objc_sjlj_exceptions = 0;
+ /* If the User has not specified fexceptions, set it silently. */
+ if (!global_options_set.x_flag_exceptions)
+ flag_exceptions = 1;
+ else if (!flag_exceptions)
+ /* If the User has explicitly specified -fno-exceptions together
+ with -fobjc-exceptions, this is an error. */
+ error_at (UNKNOWN_LOCATION, "%<-fobjc-exceptions%> requires"
+ "%<-fexceptions%> for the GNU runtime");
}
/* TODO: Complain if -fobjc-abi-version=N was used. */
===================================================================
@@ -140,9 +140,6 @@ extern GTY(()) int darwin_ms_struct;
} while (0)
#define SUBTARGET_C_COMMON_OVERRIDE_OPTIONS do { \
- if (!global_options_set.x_flag_objc_sjlj_exceptions) \
- global_options.x_flag_objc_sjlj_exceptions = \
- flag_next_runtime && !TARGET_64BIT; \
if (flag_mkernel || flag_apple_kext) \
{ \
if (flag_use_cxa_atexit == 2) \