OSDN Git Service

PR c++/60046
[pf3gnuchains/gcc-fork.git] / gcc / objc / objc-runtime-shared-support.c
index 78505f4..7d478d9 100644 (file)
@@ -41,16 +41,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "objcp-decl.h"
 #endif  /* OBJCPLUS */
 
-#include "obstack.h"
-
-/* These are only used for encoding ivars.  */
-extern struct obstack util_obstack;
-extern char *util_firstobj;
-
 /* Hooks for string decls etc.  */
 #include "objc-runtime-hooks.h"
 
 #include "objc-runtime-shared-support.h"
+#include "objc-encoding.h"
 
 /* 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
@@ -550,16 +545,9 @@ build_ivar_list_initializer (tree type, tree field_decl)
        CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, build_int_cst (NULL_TREE, 0));
 
       /* Set type.  */
-      encode_field_decl (field_decl,
-                        obstack_object_size (&util_obstack),
-                        OBJC_ENCODE_DONT_INLINE_DEFS);
-
-      /* Null terminate string.  */
-      obstack_1grow (&util_obstack, 0);
-      id = add_objc_string (get_identifier (XOBFINISH (&util_obstack, char *)),
+      id = add_objc_string (encode_field_decl (field_decl),
                             meth_var_types);
       CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, id);
-      obstack_free (&util_obstack, util_firstobj);
 
       /* Set offset.  */
       CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, byte_position (field_decl));