aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc/objc-act.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2000-01-25 17:13:14 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-01-25 17:13:14 +0000
commit4dd7201eac0b2f44f0f5b91dc2150a68aff5e389 (patch)
treee3f4e1a3212b662d8c287e2abd1a0473dd49789b /gcc/objc/objc-act.c
parentb5031ab715c5dcae4a61492da51b796934647f16 (diff)
downloadgcc-4dd7201eac0b2f44f0f5b91dc2150a68aff5e389.zip
gcc-4dd7201eac0b2f44f0f5b91dc2150a68aff5e389.tar.gz
gcc-4dd7201eac0b2f44f0f5b91dc2150a68aff5e389.tar.bz2
c-common.c, [...]: Remove all references to obstack functions obsoleted by GC...
* c-common.c, c-decl.c, c-lang.c, c-lex.c, c-parse.in, c-pragma.c, c-typeck.c, objc/objc-act.c: Remove all references to obstack functions obsoleted by GC, such as push_obstacks_nochange, end_temporary_allocation, savealloc, saveable_tree_cons, etc. and code which existed only to decide whether or not to call them. Remove now-unused NESTED argument from start_function; all callers changed. Do not change behavior based on ggc_p. The use of the ixp_obstack in c-iterate.c and the util_obstack in objc/objc-act.c remain; these are not obsoleted by garbage collection. * c-tree.h: Update prototype for start_function. * c-parse.y, c-parse.c, objc/objc-parse.c, objc/objc-parse.y: Rebuild. From-SVN: r31611
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r--gcc/objc/objc-act.c89
1 files changed, 13 insertions, 76 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 035cc2b..87ccf78 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -1022,11 +1022,8 @@ get_static_reference (interface, protocols)
{
tree t, m = TYPE_MAIN_VARIANT (type);
- push_obstacks_nochange ();
- end_temporary_allocation ();
t = copy_node (type);
TYPE_BINFO (t) = make_tree_vec (2);
- pop_obstacks ();
/* Add this type to the chain of variants of TYPE. */
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m);
@@ -1072,11 +1069,8 @@ get_object_reference (protocols)
{
tree t, m = TYPE_MAIN_VARIANT (type);
- push_obstacks_nochange ();
- end_temporary_allocation ();
t = copy_node (type);
TYPE_BINFO (t) = make_tree_vec (2);
- pop_obstacks ();
/* Add this type to the chain of variants of TYPE. */
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m);
@@ -1362,8 +1356,6 @@ build_objc_string_object (strings)
if (! flag_next_runtime)
{
- push_obstacks_nochange ();
- end_temporary_allocation ();
if (! TREE_PERMANENT (strings))
string = my_build_string (length + 1,
TREE_STRING_POINTER (string));
@@ -1382,7 +1374,6 @@ build_objc_string_object (strings)
{
constructor
= objc_add_static_instance (constructor, constant_string_type);
- pop_obstacks ();
}
return (build_unary_op (ADDR_EXPR, constructor, 1));
@@ -1398,9 +1389,6 @@ objc_add_static_instance (constructor, class_decl)
tree *chain, decl;
char buf[256];
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
/* Find the list of static instances for the CLASS_DECL. Create one if
not found. */
for (chain = &objc_static_instances;
@@ -1427,7 +1415,6 @@ objc_add_static_instance (constructor, class_decl)
/* Add the DECL to the head of this CLASS' list. */
TREE_PURPOSE (*chain) = tree_cons (NULL_TREE, decl, TREE_PURPOSE (*chain));
- pop_obstacks ();
return decl;
}
@@ -1805,7 +1792,7 @@ build_module_descriptor ()
tree_cons (NULL_TREE, NULL_TREE,
void_list_node_1),
NULL_TREE),
- NULL_TREE, NULL_TREE, 0);
+ NULL_TREE, NULL_TREE);
#if 0 /* This should be turned back on later
for the systems where collect is not needed. */
/* Make these functions nonglobal
@@ -1942,7 +1929,6 @@ generate_static_references ()
TREE_USED (static_instances_decl) = 1;
DECL_CONTEXT (static_instances_decl) = 0;
DECL_ARTIFICIAL (static_instances_decl) = 1;
- end_temporary_allocation ();
expr = build_constructor (TREE_TYPE (static_instances_decl),
nreverse (decls));
finish_decl (static_instances_decl, expr, NULL_TREE);
@@ -1966,7 +1952,6 @@ generate_strings ()
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_CHAR], sc_spec);
expr_decl = build_nt (ARRAY_REF, DECL_NAME (decl), NULL_TREE);
decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
- end_temporary_allocation ();
string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
IDENTIFIER_POINTER (string));
finish_decl (decl, string_expr, NULL_TREE);
@@ -2010,9 +1995,6 @@ build_selector_reference_decl ()
sprintf (buf, "_OBJC_SELECTOR_REFERENCES_%d", idx++);
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
ident = get_identifier (buf);
decl = build_decl (VAR_DECL, ident, selector_type);
@@ -2026,8 +2008,6 @@ build_selector_reference_decl ()
make_decl_rtl (decl, 0, 1);
pushdecl_top_level (decl);
- pop_obstacks ();
-
return decl;
}
@@ -2085,11 +2065,6 @@ build_selector_translation_table ()
int offset = 0;
tree decl = NULL_TREE, var_decl, name;
- /* The corresponding pop_obstacks is in finish_decl,
- called at the end of this function. */
- if (! flag_next_runtime)
- push_obstacks_nochange ();
-
for (chain = sel_ref_chain; chain; chain = TREE_CHAIN (chain))
{
tree expr;
@@ -2193,7 +2168,7 @@ build_typed_selector_reference (ident, proto)
chain = &TREE_CHAIN (*chain);
}
- *chain = perm_tree_cons (proto, ident, NULL_TREE);
+ *chain = tree_cons (proto, ident, NULL_TREE);
return_at_index:
expr = build_unary_op (ADDR_EXPR,
@@ -2225,7 +2200,7 @@ build_selector_reference (ident)
expr = build_selector_reference_decl ();
- *chain = perm_tree_cons (expr, ident, NULL_TREE);
+ *chain = tree_cons (expr, ident, NULL_TREE);
return (flag_next_runtime
? expr
@@ -2242,9 +2217,6 @@ build_class_reference_decl ()
sprintf (buf, "_OBJC_CLASS_REFERENCES_%d", idx++);
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
ident = get_identifier (buf);
decl = build_decl (VAR_DECL, ident, objc_class_type);
@@ -2258,8 +2230,6 @@ build_class_reference_decl ()
make_decl_rtl (decl, 0, 1);
pushdecl_top_level (decl);
- pop_obstacks ();
-
return decl;
}
@@ -2286,10 +2256,10 @@ add_class_reference (ident)
while (chain);
/* Append to the end of the list */
- TREE_CHAIN (tail) = perm_tree_cons (NULL_TREE, ident, NULL_TREE);
+ TREE_CHAIN (tail) = tree_cons (NULL_TREE, ident, NULL_TREE);
}
else
- cls_ref_chain = perm_tree_cons (NULL_TREE, ident, NULL_TREE);
+ cls_ref_chain = tree_cons (NULL_TREE, ident, NULL_TREE);
}
/* Get a class reference, creating it if necessary. Also create the
@@ -2314,7 +2284,7 @@ get_class_reference (ident)
}
decl = build_class_reference_decl ();
- *chain = perm_tree_cons (decl, ident, NULL_TREE);
+ *chain = tree_cons (decl, ident, NULL_TREE);
return decl;
}
else
@@ -2367,7 +2337,7 @@ add_objc_string (ident, section)
decl = build_objc_string_decl (section);
- *chain = perm_tree_cons (decl, ident, NULL_TREE);
+ *chain = tree_cons (decl, ident, NULL_TREE);
return build_unary_op (ADDR_EXPR, decl, 1);
}
@@ -2389,8 +2359,6 @@ build_objc_string_decl (section)
else if (section == meth_var_types)
sprintf (buf, "_OBJC_METH_VAR_TYPE_%d", meth_var_types_idx++);
- push_obstacks_nochange ();
- end_temporary_allocation ();
ident = get_identifier (buf);
decl = build_decl (VAR_DECL, ident, build_array_type (char_type_node, 0));
@@ -2405,8 +2373,6 @@ build_objc_string_decl (section)
make_decl_rtl (decl, 0, 1);
pushdecl_top_level (decl);
- pop_obstacks ();
-
return decl;
}
@@ -5315,9 +5281,6 @@ build_protocol_reference (p)
{
tree decl, ident, ptype;
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
/* extern struct objc_protocol _OBJC_PROTOCOL_<mumble>; */
ident = synth_id_with_class_suffix ("_OBJC_PROTOCOL", p);
@@ -5341,7 +5304,6 @@ build_protocol_reference (p)
}
PROTOCOL_FORWARD_DECL (p) = decl;
- pop_obstacks ();
}
tree
@@ -5676,10 +5638,6 @@ add_class_method (class, method)
tree mth;
hash hsh;
- /* We will have allocated the method parameter declarations on the
- maybepermanent_obstack. Need to make sure they stick around! */
- preserve_data ();
-
if (!(mth = lookup_method (CLASS_CLS_METHODS (class), method)))
{
/* put method on list in reverse order */
@@ -5722,10 +5680,6 @@ add_instance_method (class, method)
tree mth;
hash hsh;
- /* We will have allocated the method parameter declarations on the
- maybepermanent_obstack. Need to make sure they stick around! */
- preserve_data ();
-
if (!(mth = lookup_method (CLASS_NST_METHODS (class), method)))
{
/* Put method on list in reverse order. */
@@ -6129,10 +6083,7 @@ check_protocols (proto_list, type, name)
/* Make sure that the class CLASS_NAME is defined
CODE says which kind of thing CLASS_NAME ought to be.
It can be CLASS_INTERFACE_TYPE, CLASS_IMPLEMENTATION_TYPE,
- CATEGORY_INTERFACE_TYPE, or CATEGORY_IMPLEMENTATION_TYPE.
-
- If CODE is CLASS_INTERFACE_TYPE, we also do a push_obstacks_nochange
- whose matching pop is in continue_class. */
+ CATEGORY_INTERFACE_TYPE, or CATEGORY_IMPLEMENTATION_TYPE. */
tree
start_class (code, class_name, super_name, protocol_list)
@@ -6143,12 +6094,6 @@ start_class (code, class_name, super_name, protocol_list)
{
tree class, decl;
- if (code == CLASS_INTERFACE_TYPE)
- {
- push_obstacks_nochange ();
- end_temporary_allocation ();
- }
-
if (!doing_objc_thang)
objc_fatal ();
@@ -6178,8 +6123,8 @@ start_class (code, class_name, super_name, protocol_list)
IDENTIFIER_POINTER (class_name));
return error_mark_node;
}
- implemented_classes = perm_tree_cons (NULL_TREE, class_name,
- implemented_classes);
+ implemented_classes = tree_cons (NULL_TREE, class_name,
+ implemented_classes);
}
/* Pre-build the following entities - for speed/convenience. */
@@ -7103,12 +7048,7 @@ comp_method_with_proto (method, proto)
/* Create a function_type node once. */
if (!function_type)
- {
- push_obstacks_nochange ();
- end_temporary_allocation ();
- function_type = make_node (FUNCTION_TYPE);
- pop_obstacks ();
- }
+ function_type = make_node (FUNCTION_TYPE);
/* Install argument types - normally set by build_function_type. */
TYPE_ARG_TYPES (function_type) = get_arg_type_list (proto, METHOD_DEF, 0);
@@ -7130,11 +7070,8 @@ comp_proto_with_proto (proto1, proto2)
/* Create a couple function_type node's once. */
if (!function_type1)
{
- push_obstacks_nochange ();
- end_temporary_allocation ();
function_type1 = make_node (FUNCTION_TYPE);
function_type2 = make_node (FUNCTION_TYPE);
- pop_obstacks ();
}
/* Install argument types; normally set by build_function_type. */
@@ -7198,7 +7135,7 @@ really_start_method (method, parmlist)
method_decl = ret_decl;
/* Fool the parser into thinking it is starting a function. */
- start_function (decl_specs, method_decl, NULL_TREE, NULL_TREE, 0);
+ start_function (decl_specs, method_decl, NULL_TREE, NULL_TREE);
/* Unhook: this has the effect of restoring the abstract declarator. */
TREE_OPERAND (save_expr, 0) = NULL_TREE;
@@ -7209,7 +7146,7 @@ really_start_method (method, parmlist)
TREE_VALUE (TREE_TYPE (method)) = method_decl;
/* Fool the parser into thinking it is starting a function. */
- start_function (decl_specs, method_decl, NULL_TREE, NULL_TREE, 0);
+ start_function (decl_specs, method_decl, NULL_TREE, NULL_TREE);
/* Unhook: this has the effect of restoring the abstract declarator. */
TREE_VALUE (TREE_TYPE (method)) = NULL_TREE;