]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/objc/objc-next-runtime-abi-02.c
Update copyright years.
[thirdparty/gcc.git] / gcc / objc / objc-next-runtime-abi-02.c
index ee43d2d0ce851275d26dfe0aa289f9dd3dba0a73..e401906ed012d69d1a0f76ac9fa2e3cd35e6f84d 100644 (file)
@@ -1,5 +1,5 @@
 /* Next Runtime (ABI-2) private.
-   Copyright (C) 2011-2014 Free Software Foundation, Inc.
+   Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
    Contributed by Iain Sandoe and based, in part, on an implementation in
    'branches/apple/trunk' contributed by Apple Computer Inc.
@@ -28,9 +28,9 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "tm.h"
 #include "tree.h"
 #include "stringpool.h"
+#include "attribs.h"
 
 #ifdef OBJCPLUS
 #include "cp/cp-tree.h"
@@ -49,7 +49,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "objcp-decl.h"
 #endif  /* OBJCPLUS */
 
-#include "ggc.h"
 #include "target.h"
 #include "tree-iterator.h"
 
@@ -238,12 +237,14 @@ static GTY ((length ("SIZEHASHTABLE"))) hash *extern_names;
 bool
 objc_next_runtime_abi_02_init (objc_runtime_hooks *rthooks)
 {
-  extern_names = ggc_alloc_cleared_vec_hash (SIZEHASHTABLE);
+  extern_names = ggc_cleared_vec_alloc<hash> (SIZEHASHTABLE);
 
   if (flag_objc_exceptions && flag_objc_sjlj_exceptions)
     {
-      inform (UNKNOWN_LOCATION, "%<-fobjc-sjlj-exceptions%> is ignored for "
-                               "%<-fnext-runtime%> when %<-fobjc-abi-version%> >= 2");
+      inform (UNKNOWN_LOCATION,
+             "%<-fobjc-sjlj-exceptions%> is ignored for "
+             "%<-fnext-runtime%> when %<-fobjc-abi-version%> "
+             "greater than 1");
       flag_objc_sjlj_exceptions = 0;
     }
 
@@ -344,6 +345,8 @@ next_runtime_abi_02_init_metadata_attributes (void)
   meta_ehtype = get_identifier ("V2_EHTY");
 
   meta_const_str = get_identifier ("V2_CSTR");
+
+  meta_ivar_ref = get_identifier ("V2_IVRF");
 }
 
 static void next_runtime_02_initialize (void)
@@ -857,7 +860,7 @@ hash_name_enter (hash *hashlist, tree id)
   hash obj;
   int slot = IDENTIFIER_HASH_VALUE (DECL_NAME (id)) % SIZEHASHTABLE;
 
-  obj = ggc_alloc_hashed_entry ();
+  obj = ggc_alloc<hashed_entry> ();
   obj->list = 0;
   obj->next = hashlist[slot];
   obj->key = id;
@@ -1012,10 +1015,10 @@ next_runtime_abi_02_string_decl (tree type, const char *name,  string_section wh
 
 /* NOTE --- entry --- */
 
-typedef struct GTY(()) ident_data_tuple {
+struct GTY(()) ident_data_tuple {
   tree ident;
   tree data;
-} ident_data_tuple ;
+};
 
 /* This routine creates a file scope static variable of type 'Class'
    to hold the address of a class.  */
@@ -1196,11 +1199,11 @@ build_v2_message_reference_decl (tree sel_name, tree message_func_ident)
   return decl;
 }
 
-typedef struct GTY(()) msgref_entry {
+struct GTY(()) msgref_entry {
   tree func;
   tree selname;
   tree refdecl;
-} msgref_entry;
+};
 
 static GTY (()) vec<msgref_entry, va_gc> *msgrefs;
 
@@ -1252,10 +1255,10 @@ build_v2_protocollist_ref_decl (tree protocol)
   return decl;
 }
 
-typedef struct GTY(()) prot_list_entry {
+struct GTY(()) prot_list_entry {
   tree id;
   tree refdecl;
-} prot_list_entry;
+};
 static GTY (()) vec<prot_list_entry, va_gc> *protrefs;
 
 static tree
@@ -1648,8 +1651,8 @@ build_v2_build_objc_method_call (int super_flag, tree method_prototype,
      /* ??? CHECKME.   */
       ret_val = build_conditional_expr (input_location,
                                        ifexp, 1,
-                                       ret_val, NULL_TREE,
-                                       ftree, NULL_TREE);
+                                       ret_val, NULL_TREE, input_location,
+                                       ftree, NULL_TREE, input_location);
 #endif
     }
   return ret_val;
@@ -2756,11 +2759,11 @@ generate_v2_category (struct imp_entry *impent)
 /* This routine declares a variable to hold the offset for ivar
    FIELD_DECL.  Variable name is .objc_ivar.ClassName.IvarName.  */
 
-typedef struct GTY(()) ivarref_entry
+struct GTY(()) ivarref_entry
 {
   tree decl;
   tree offset;
-} ivarref_entry;
+};
 
 static GTY (()) vec<ivarref_entry, va_gc> *ivar_offset_refs;
 
@@ -2794,8 +2797,8 @@ ivar_offset_ref (tree class_name, tree field_decl)
   else
     decl = create_hidden_decl (TREE_TYPE (size_zero_node), buf);
 
-  /* Make sure it ends up in an ObjC section.  */
-  OBJCMETA (decl, objc_meta, meta_base);
+  /* Identify so that we can indirect these where the ABI requires.  */
+  OBJCMETA (decl, objc_meta, meta_ivar_ref);
 
   e.decl = decl;
   e.offset = byte_position (field_decl);
@@ -3587,7 +3590,7 @@ next_runtime_02_eh_type (tree type)
         case, we use c++'s typeinfo decl.  */
       return build_eh_type_type (type);
 #else
-      error ("non-objective-c type '%T' cannot be caught", type);
+      error ("non-objective-c type %qT cannot be caught", type);
       goto err_mark_in;
 #endif
     }