diff options
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r-- | gcc/objc/objc-act.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 7ee3306..2173092 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -2950,12 +2950,14 @@ synth_module_prologue (void) objc_class_reference = xref_tag (RECORD_TYPE, objc_class_id); objc_object_type = build_pointer_type (objc_object_reference); + objc_instancetype_type = build_pointer_type (objc_object_reference); objc_class_type = build_pointer_type (objc_class_reference); objc_object_name = get_identifier (OBJECT_TYPEDEF_NAME); + objc_instancetype_name = get_identifier (INSTANCE_TYPEDEF_NAME); objc_class_name = get_identifier (CLASS_TYPEDEF_NAME); - /* Declare the 'id' and 'Class' typedefs. */ + /* Declare the 'id', 'instancetype' and 'Class' typedefs. */ type = lang_hooks.decls.pushdecl (build_decl (input_location, TYPE_DECL, objc_object_name, @@ -2964,6 +2966,12 @@ synth_module_prologue (void) type = lang_hooks.decls.pushdecl (build_decl (input_location, TYPE_DECL, + objc_instancetype_name, + objc_instancetype_type)); + TREE_NO_WARNING (type) = 1; + + type = lang_hooks.decls.pushdecl (build_decl (input_location, + TYPE_DECL, objc_class_name, objc_class_type)); TREE_NO_WARNING (type) = 1; |