summaryrefslogtreecommitdiff
path: root/gcc/objc/objc-gnu-runtime-abi-01.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/objc/objc-gnu-runtime-abi-01.c')
-rw-r--r--gcc/objc/objc-gnu-runtime-abi-01.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/gcc/objc/objc-gnu-runtime-abi-01.c b/gcc/objc/objc-gnu-runtime-abi-01.c
index 6bdffac10e7..5cd39ef9307 100644
--- a/gcc/objc/objc-gnu-runtime-abi-01.c
+++ b/gcc/objc/objc-gnu-runtime-abi-01.c
@@ -104,8 +104,8 @@ static tree gnu_runtime_abi_01_get_class_super_ref (location_t, struct imp_entry
static tree gnu_runtime_abi_01_get_category_super_ref (location_t, struct imp_entry *, bool);
static tree gnu_runtime_abi_01_receiver_is_class_object (tree);
-static void gnu_runtime_abi_01_get_arg_type_list_base (VEC(tree,gc) **, tree,
- int, int);
+static void gnu_runtime_abi_01_get_arg_type_list_base (vec<tree, va_gc> **,
+ tree, int, int);
static tree gnu_runtime_abi_01_build_objc_method_call (location_t, tree, tree,
tree, tree, tree, int);
@@ -585,8 +585,8 @@ gnu_runtime_abi_01_get_class_reference (tree ident)
prototype. */
static void
-gnu_runtime_abi_01_get_arg_type_list_base (VEC(tree,gc) **argtypes, tree meth,
- int context,
+gnu_runtime_abi_01_get_arg_type_list_base (vec<tree, va_gc> **argtypes,
+ tree meth, int context,
int superflag ATTRIBUTE_UNUSED)
{
tree receiver_type;
@@ -596,9 +596,9 @@ gnu_runtime_abi_01_get_arg_type_list_base (VEC(tree,gc) **argtypes, tree meth,
else
receiver_type = objc_object_type;
- VEC_safe_push (tree, gc, *argtypes, receiver_type);
+ vec_safe_push (*argtypes, receiver_type);
/* Selector type - will eventually change to `int'. */
- VEC_safe_push (tree, gc, *argtypes, objc_selector_type);
+ vec_safe_push (*argtypes, objc_selector_type);
}
/* Unused for GNU runtime. */
@@ -662,8 +662,8 @@ build_objc_method_call (location_t loc, int super_flag, tree method_prototype,
: (flag_objc_direct_dispatch ? umsg_fast_decl
: umsg_decl));
tree rcv_p = (super_flag ? objc_super_type : objc_object_type);
- VEC(tree, gc) *parms;
- VEC(tree, gc) *tv;
+ vec<tree, va_gc> *parms;
+ vec<tree, va_gc> *tv;
unsigned nparm = (method_params ? list_length (method_params) : 0);
/* If a prototype for the method to be called exists, then cast
@@ -692,30 +692,30 @@ build_objc_method_call (location_t loc, int super_flag, tree method_prototype,
lookup_object = save_expr (lookup_object);
/* Param list + 2 slots for object and selector. */
- parms = VEC_alloc (tree, gc, nparm + 2);
- tv = VEC_alloc (tree, gc, 2);
+ vec_alloc (parms, nparm + 2);
+ vec_alloc (tv, 2);
/* First, call the lookup function to get a pointer to the method,
then cast the pointer, then call it with the method arguments. */
- VEC_quick_push (tree, tv, lookup_object);
- VEC_quick_push (tree, tv, selector);
+ tv->quick_push (lookup_object);
+ tv->quick_push (selector);
method = build_function_call_vec (loc, sender, tv, NULL);
- VEC_free (tree, gc, tv);
+ vec_free (tv);
/* Pass the appropriate object to the method. */
- VEC_quick_push (tree, parms, (super_flag ? self_decl : lookup_object));
+ parms->quick_push ((super_flag ? self_decl : lookup_object));
/* Pass the selector to the method. */
- VEC_quick_push (tree, parms, selector);
+ parms->quick_push (selector);
/* Now append the remainder of the parms. */
if (nparm)
for (; method_params; method_params = TREE_CHAIN (method_params))
- VEC_quick_push (tree, parms, TREE_VALUE (method_params));
+ parms->quick_push (TREE_VALUE (method_params));
/* Build an obj_type_ref, with the correct cast for the method call. */
t = build3 (OBJ_TYPE_REF, sender_cast, method, lookup_object, size_zero_node);
t = build_function_call_vec (loc, t, parms, NULL);
- VEC_free (tree, gc, parms);
+ vec_free (parms);
return t;
}
@@ -900,7 +900,7 @@ gnu_runtime_abi_01_build_const_string_constructor (location_t loc, tree string,
int length)
{
tree constructor, fields;
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
/* GNU: (NXConstantString *) & ((__builtin_ObjCString) { NULL, string, length }) */
fields = TYPE_FIELDS (internal_const_str_type);
@@ -1087,7 +1087,7 @@ build_protocol_initializer (tree type, tree protocol_name, tree protocol_list,
{
tree expr, ttyp;
location_t loc;
- VEC(constructor_elt,gc) *inits = NULL;
+ vec<constructor_elt, va_gc> *inits = NULL;
/* TODO: pass the loc in or find it from args. */
loc = input_location;
@@ -1122,7 +1122,7 @@ static tree
generate_protocol_list (tree i_or_p, tree klass_ctxt)
{
tree array_type, ptype, refs_decl, lproto, e, plist;
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
char buf[BUFSIZE];
int size = 0;
@@ -1200,7 +1200,7 @@ generate_v1_meth_descriptor_table (tree chain, tree protocol, const char *prefix
{
tree method_list_template, initlist, decl;
int size;
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
char buf[BUFSIZE];
if (!chain || !prefix)
@@ -1348,7 +1348,7 @@ static tree
generate_dispatch_table (tree chain, const char *name)
{
tree decl, method_list_template, initlist;
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
int size = list_length (chain);
if (!objc_method_template)
@@ -1380,7 +1380,7 @@ build_category_initializer (tree type, tree cat_name, tree class_name,
{
tree expr, ltyp;
location_t loc;
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
/* TODO: pass the loc in or find it from args. */
/* TODO: pass the loc in or find it from args. */
@@ -1488,7 +1488,7 @@ build_shared_structure_initializer (tree type, tree isa, tree super,
tree protocol_list)
{
tree expr, ltyp;
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
/* isa = */
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, isa);
@@ -1584,7 +1584,7 @@ generate_ivars_list (tree chain, const char *name)
{
tree initlist, ivar_list_template, decl;
int size;
- VEC(constructor_elt,gc) *inits = NULL;
+ vec<constructor_elt, va_gc> *inits = NULL;
if (!chain)
return NULL_TREE;
@@ -1807,8 +1807,8 @@ static void
build_gnu_selector_translation_table (void)
{
tree chain, expr;
- VEC(constructor_elt,gc) *inits = NULL;
- VEC(constructor_elt,gc) *v ;
+ vec<constructor_elt, va_gc> *inits = NULL;
+ vec<constructor_elt, va_gc> *v ;
/* Cause the selector table (previously forward-declared)
to be actually output. */
@@ -1857,7 +1857,7 @@ generate_static_references (void)
= build_array_type (build_pointer_type (void_type_node), NULL_TREE);
int num_inst, num_class;
char buf[BUFSIZE];
- VEC(constructor_elt,gc) *decls = NULL;
+ vec<constructor_elt, va_gc> *decls = NULL;
/* FIXME: Remove NeXT runtime code. */
if (flag_next_runtime)
@@ -1866,7 +1866,7 @@ generate_static_references (void)
for (cl_chain = objc_static_instances, num_class = 0;
cl_chain; cl_chain = TREE_CHAIN (cl_chain), num_class++)
{
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
for (num_inst = 0, in_chain = TREE_PURPOSE (cl_chain);
in_chain; num_inst++, in_chain = TREE_CHAIN (in_chain));
@@ -1917,7 +1917,7 @@ init_def_list (tree type)
tree expr;
struct imp_entry *impent;
location_t loc;
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
if (imp_count)
for (impent = imp_list; impent; impent = impent->next)
@@ -2004,7 +2004,7 @@ init_objc_symtab (tree type)
{
tree field, expr, ltyp;
location_t loc;
- VEC(constructor_elt,gc) *v = NULL;
+ vec<constructor_elt, va_gc> *v = NULL;
loc = UNKNOWN_LOCATION;
@@ -2207,12 +2207,13 @@ static tree
build_throw_stmt (location_t loc, tree throw_expr, bool rethrown ATTRIBUTE_UNUSED)
{
tree t;
- VEC(tree, gc) *parms = VEC_alloc (tree, gc, 1);
+ vec<tree, va_gc> *parms;
+ vec_alloc (parms, 1);
/* A throw is just a call to the runtime throw function with the
object as a parameter. */
- VEC_quick_push (tree, parms, throw_expr);
+ parms->quick_push (throw_expr);
t = build_function_call_vec (loc, objc_exception_throw_decl, parms, NULL);
- VEC_free (tree, gc, parms);
+ vec_free (parms);
return add_stmt (t);
}