cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.

* cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
	* call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not
	TREE_PERMANENT.
	* decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P.
	* decl2.c (lookup_arg_dependent): Use it.

	* cp-tree.h (cp_finish_decl): Change prototype.
	(finish_static_data_member_decl): Likewise.
	(push_permanent_obstack): Remove declaration.
	(push_expression_obstack): Likewise.
	(push_scratch_obstack): Likewise.
	(DECL_TEMPLATE_PARM_P): Robustify.
	(SET_DECL_TEMPLATE_PARM_P): New macro.
	* class.c (add_method): Don't manipulate obstacks.
	(finish_vtbls): Likewise.
	* cvt.c (build_up_reference): Adjust calls to cp_finish_decl.
	* decl.c (binding_for_name): Don't manipulate obstacks.
	(maybe_push_to_top_level): Likewise.
	(pop_from_top_level): Likewise.
	(duplicate_decls): Likewise.
	(pushdecl): Likewise.
	(implicitly_declare): Likewise.
	(build_typename_type): Likewise.
	(start_decl): Likewise.
	(cp_finish_decl): Likewise.
	(finish_decl): Likewise.
	(destroy_local_static): Likewise.
	(expand_static_init): Likewise.
	(complete_array_type): Likewise.
	(grokvardecl): Likewise.
	(build_ptrmemfnc_type): Likewise.
	(grokdeclarator): Likewise.
	(xref_tag): Likewise.
	(xref_basetypes): Likewise.
	(start_enum): Likewise.
	(finish_enum): Likewise.
	(start_function): Likewise.
	(finish_function): Likewise.
	(start_method): Adjust call to cp_finish_decl.
	* decl2.c (finish_static_data_member_decl): Don't manipulate
	obstacks.
	(grokfield): Likewise.
	(grokbitfield): Likewise.
	(get_temp_name): Likewise.
	(get_sentry): Likewise.
	(fnish_file): Likewise.
	(lookup_arg_dependent): Likewise.
	* except.c (call_eh_info): Likewise.
	(push_eh_info): Likewise.
	(do_pop_exception): Likewise.
	(initialize_handler_parm): Likewise.
	(expand_end_eh_spec): Likewise.
	(alloc_eh_object): Likewise.
	(expand_throw): Likewise.
	* expr.c (extract_scalar_init): Likewise.
	* init.c (build_java_class_ref): Likewise.
	* lex.c (get_time_identifier): Likewise.
	(snarf_defarg): Likewise.
	(add_defarg_fn): Likewise.
	(is_global): Simplify.
	(do_identifier): Don't check TREE_PERMANENT.
	* method.c (emit_thunk): Don't manipulate obstacks.
	* parse.y (condition): Adjust call to cp_finish_decl.
	(primary): Likewise.
	(initdcl): Likewise.
	(initdcl0_innards): Likewise.
	(nomods_initdcl0): Likewise.
	* pt.c (push_inline_template_parms_recursive): Use
	SET_DECL_TEMPLATE_PARM_P.
	(process_template_parm): Likewise.
	(lookup_template_class): Don't manipulate obstacks.
	(instantiate_class_template): Adjust call to
	finish_static_data_member_decl.
	(tsubst_decl): Don't manipulate obstacks.
	(tsubst_expr): Likewise.
	(instantiate_template): Likewise.
	(instantiate_decl): Adjust calls to cp_finish_decl.
	* rtti.c (call_void_fn): Don't manipulate obstacks.
	(get_tinfo_var): Likewise.
	(get_tinfo_fn_unused): Likewise.
	(build_dynamic_cast_1): Likewise.
	(expand_si_desc): Likewise.
	(expand_class_desc): Likewise.
	(expand_ptr_desc): Likewise.
	(expand_attr_desc): Likewise.
	(expand_generic_desc): Likewise.
	(synthesize_tinfo_fn): Likewise.
	* search.c (expand_upcast_fixups): Likewise.
	* semantics.c (finish_asm_stmt): Likewise.
	(finish_named_return_value): Likewise.
	(begin_class_definition): Likewise.
	(finish_class_definition): Likewise.
	(finish_typeof): Likewise.
	* tree.c (build_cplus_method_type): Likewise.
	(reverse_path): Likewise.
	(copy_template_template_parm): Likewise.
	(build_expr_ptr_wrapper): Likewise.
	(push_expression_obstack): Remove.
	(push_permanent_obstack): Likewise.
	* typeck.c (mark_addressable): Likewise.

From-SVN: r30527
This commit is contained in:
Mark Mitchell 1999-11-14 20:29:06 +00:00 committed by Mark Mitchell
parent ef835bb0c3
commit cd9f6678b3
20 changed files with 718 additions and 888 deletions

View File

@ -1,3 +1,106 @@
1999-11-14 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
* call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not
TREE_PERMANENT.
* decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P.
* decl2.c (lookup_arg_dependent): Use it.
* cp-tree.h (cp_finish_decl): Change prototype.
(finish_static_data_member_decl): Likewise.
(push_permanent_obstack): Remove declaration.
(push_expression_obstack): Likewise.
(push_scratch_obstack): Likewise.
(DECL_TEMPLATE_PARM_P): Robustify.
(SET_DECL_TEMPLATE_PARM_P): New macro.
* class.c (add_method): Don't manipulate obstacks.
(finish_vtbls): Likewise.
* cvt.c (build_up_reference): Adjust calls to cp_finish_decl.
* decl.c (binding_for_name): Don't manipulate obstacks.
(maybe_push_to_top_level): Likewise.
(pop_from_top_level): Likewise.
(duplicate_decls): Likewise.
(pushdecl): Likewise.
(implicitly_declare): Likewise.
(build_typename_type): Likewise.
(start_decl): Likewise.
(cp_finish_decl): Likewise.
(finish_decl): Likewise.
(destroy_local_static): Likewise.
(expand_static_init): Likewise.
(complete_array_type): Likewise.
(grokvardecl): Likewise.
(build_ptrmemfnc_type): Likewise.
(grokdeclarator): Likewise.
(xref_tag): Likewise.
(xref_basetypes): Likewise.
(start_enum): Likewise.
(finish_enum): Likewise.
(start_function): Likewise.
(finish_function): Likewise.
(start_method): Adjust call to cp_finish_decl.
* decl2.c (finish_static_data_member_decl): Don't manipulate
obstacks.
(grokfield): Likewise.
(grokbitfield): Likewise.
(get_temp_name): Likewise.
(get_sentry): Likewise.
(fnish_file): Likewise.
(lookup_arg_dependent): Likewise.
* except.c (call_eh_info): Likewise.
(push_eh_info): Likewise.
(do_pop_exception): Likewise.
(initialize_handler_parm): Likewise.
(expand_end_eh_spec): Likewise.
(alloc_eh_object): Likewise.
(expand_throw): Likewise.
* expr.c (extract_scalar_init): Likewise.
* init.c (build_java_class_ref): Likewise.
* lex.c (get_time_identifier): Likewise.
(snarf_defarg): Likewise.
(add_defarg_fn): Likewise.
(is_global): Simplify.
(do_identifier): Don't check TREE_PERMANENT.
* method.c (emit_thunk): Don't manipulate obstacks.
* parse.y (condition): Adjust call to cp_finish_decl.
(primary): Likewise.
(initdcl): Likewise.
(initdcl0_innards): Likewise.
(nomods_initdcl0): Likewise.
* pt.c (push_inline_template_parms_recursive): Use
SET_DECL_TEMPLATE_PARM_P.
(process_template_parm): Likewise.
(lookup_template_class): Don't manipulate obstacks.
(instantiate_class_template): Adjust call to
finish_static_data_member_decl.
(tsubst_decl): Don't manipulate obstacks.
(tsubst_expr): Likewise.
(instantiate_template): Likewise.
(instantiate_decl): Adjust calls to cp_finish_decl.
* rtti.c (call_void_fn): Don't manipulate obstacks.
(get_tinfo_var): Likewise.
(get_tinfo_fn_unused): Likewise.
(build_dynamic_cast_1): Likewise.
(expand_si_desc): Likewise.
(expand_class_desc): Likewise.
(expand_ptr_desc): Likewise.
(expand_attr_desc): Likewise.
(expand_generic_desc): Likewise.
(synthesize_tinfo_fn): Likewise.
* search.c (expand_upcast_fixups): Likewise.
* semantics.c (finish_asm_stmt): Likewise.
(finish_named_return_value): Likewise.
(begin_class_definition): Likewise.
(finish_class_definition): Likewise.
(finish_typeof): Likewise.
* tree.c (build_cplus_method_type): Likewise.
(reverse_path): Likewise.
(copy_template_template_parm): Likewise.
(build_expr_ptr_wrapper): Likewise.
(push_expression_obstack): Remove.
(push_permanent_obstack): Likewise.
* typeck.c (mark_addressable): Likewise.
1999-11-13 Mark Mitchell <mark@codesourcery.com>
* call.c (build_conditional_expr): Use build_target_expr_with_type.

View File

@ -4832,15 +4832,14 @@ add_warning (winner, loser)
}
/* Returns true iff functions are equivalent. Equivalent functions are
not identical only if one is a function-local extern function.
This assumes that function-locals don't have TREE_PERMANENT. */
not identical only if one is a function-local extern function. */
static inline int
equal_functions (fn1, fn2)
tree fn1;
tree fn2;
{
if (!TREE_PERMANENT (fn1) || !TREE_PERMANENT (fn2))
if (DECL_LOCAL_FUNCTION_P (fn1) || DECL_LOCAL_FUNCTION_P (fn2))
return decls_match (fn1, fn2);
return fn1 == fn2;
}

View File

@ -1067,8 +1067,6 @@ void
add_method (type, fields, method)
tree type, *fields, method;
{
push_permanent_obstack ();
/* Setting the DECL_CONTEXT and DECL_CLASS_CONTEXT here is probably
redundant. */
DECL_CONTEXT (method) = type;
@ -1239,7 +1237,6 @@ add_method (type, fields, method)
push_class_level_binding (DECL_NAME (method),
TREE_VEC_ELT (method_vec, slot));
}
pop_obstacks ();
}
/* Subroutines of finish_struct. */
@ -2233,7 +2230,7 @@ finish_vtbls (binfo, do_self, t)
context = DECL_CONTEXT (decl);
DECL_CONTEXT (decl) = 0;
DECL_INITIAL (decl) = build_vtbl_initializer (binfo);
cp_finish_decl (decl, DECL_INITIAL (decl), NULL_TREE, 0, 0);
cp_finish_decl (decl, DECL_INITIAL (decl), NULL_TREE, 0);
DECL_CONTEXT (decl) = context;
}
CLEAR_BINFO_NEW_VTABLE_MARKED (binfo);

View File

@ -85,6 +85,7 @@ Boston, MA 02111-1307, USA. */
Usage of DECL_LANG_FLAG_?:
0: DECL_ERROR_REPORTED (in VAR_DECL).
DECL_TEMPLATE_PARM_P (in CONST_DECL, TYPE_DECL, or TEMPLATE_DECL)
DECL_LOCAL_FUNCTION_P (in FUNCTION_DECL)
1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL).
DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL)
2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
@ -2095,6 +2096,11 @@ extern int flag_new_for_scope;
if we already emitted a warning about using it. */
#define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (VAR_DECL_CHECK (NODE))
/* Nonzero if NODE is a FUNCTION_DECL (for a function with global
scope) declared in a local scope. */
#define DECL_LOCAL_FUNCTION_P(NODE) \
DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE))
/* This _DECL represents a compiler-generated entity. */
#define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1)
@ -2478,9 +2484,17 @@ extern int flag_new_for_scope;
#define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE(NODE)
/* Nonzero for a DECL which is actually a template parameter. */
#define DECL_TEMPLATE_PARM_P(NODE) \
DECL_LANG_FLAG_0 (NODE)
#define DECL_TEMPLATE_PARM_P(NODE) \
(DECL_LANG_FLAG_0 (NODE) \
&& (TREE_CODE (NODE) == CONST_DECL \
|| TREE_CODE (NODE) == TYPE_DECL \
|| TREE_CODE (NODE) == TEMPLATE_DECL))
/* Mark NODE as a template parameter. */
#define SET_DECL_TEMPLATE_PARM_P(NODE) \
(DECL_LANG_FLAG_0 (NODE) = 1)
/* Nonzero if NODE is a template template parameter. */
#define DECL_TEMPLATE_TEMPLATE_PARM_P(NODE) \
(TREE_CODE (NODE) == TEMPLATE_DECL && DECL_TEMPLATE_PARM_P (NODE))
@ -3448,7 +3462,7 @@ extern void shadow_tag PROTO((tree));
extern tree groktypename PROTO((tree));
extern tree start_decl PROTO((tree, tree, int, tree, tree));
extern void start_decl_1 PROTO((tree));
extern void cp_finish_decl PROTO((tree, tree, tree, int, int));
extern void cp_finish_decl PROTO((tree, tree, tree, int));
extern void finish_decl PROTO((tree, tree, tree));
extern void maybe_inject_for_scope_var PROTO((tree));
extern void initialize_local_var PROTO((tree, tree, int));
@ -3569,7 +3583,7 @@ extern void check_default_args PROTO((tree));
extern void mark_used PROTO((tree));
extern tree handle_class_head PROTO((tree, tree, tree));
extern tree lookup_arg_dependent PROTO((tree, tree, tree));
extern void finish_static_data_member_decl PROTO((tree, tree, tree, int, int));
extern void finish_static_data_member_decl PROTO((tree, tree, tree, int));
/* in parse.y */
extern void cp_parse_init PROTO((void));
@ -3999,8 +4013,6 @@ extern int cp_tree_equal PROTO((tree, tree));
extern int can_free PROTO((struct obstack *, tree));
extern tree no_linkage_check PROTO((tree));
extern void debug_binfo PROTO((tree));
extern void push_expression_obstack PROTO((void));
extern void push_permanent_obstack PROTO((void));
extern tree build_dummy_object PROTO((tree));
extern tree maybe_dummy_object PROTO((tree, tree *));
extern int is_dummy_object PROTO((tree));
@ -4014,7 +4026,6 @@ extern tree cp_build_qualified_type_real PROTO((tree, int, int));
#define scratchalloc expralloc
#define build_scratch_list build_expr_list
#define push_scratch_obstack push_expression_obstack
/* in typeck.c */
extern int string_conv_p PROTO((tree, tree, int));

View File

@ -357,7 +357,7 @@ build_up_reference (type, arg, flags)
/* Process the initializer for the declaration. */
DECL_INITIAL (arg) = targ;
cp_finish_decl (arg, targ, NULL_TREE, 0,
cp_finish_decl (arg, targ, NULL_TREE,
LOOKUP_ONLYCONVERTING|DIRECT_BIND);
}
else if (!(flags & DIRECT_BIND) && ! lvalue_p (arg))

View File

@ -2043,15 +2043,13 @@ binding_for_name (name, scope)
}
if (b && (result = find_binding (name, scope)))
return result;
/* Not found, make a new permanent one. */
push_obstacks (&permanent_obstack, &permanent_obstack);
/* Not found, make a new one. */
result = make_node (CPLUS_BINDING);
TREE_CHAIN (result) = b;
IDENTIFIER_NAMESPACE_BINDINGS (name) = result;
BINDING_SCOPE (result) = scope;
BINDING_TYPE (result) = NULL_TREE;
BINDING_VALUE (result) = NULL_TREE;
pop_obstacks ();
return result;
}
@ -2382,8 +2380,6 @@ maybe_push_to_top_level (pseudo)
current_lang_name = lang_name_cplusplus;
strict_prototype = strict_prototypes_lang_cplusplus;
current_namespace = global_namespace;
push_obstacks (&permanent_obstack, &permanent_obstack);
}
void
@ -2402,8 +2398,6 @@ pop_from_top_level ()
if (previous_class_type)
invalidate_class_lookup_cache ();
pop_obstacks ();
VARRAY_FREE (current_lang_base);
scope_chain = s->prev;
@ -3310,12 +3304,6 @@ duplicate_decls (newdecl, olddecl)
tree oldtype = TREE_TYPE (olddecl);
tree newtype;
/* Make sure we put the new type in the same obstack as the old one. */
if (oldtype)
push_obstacks (TYPE_OBSTACK (oldtype), TYPE_OBSTACK (oldtype));
else
push_permanent_obstack ();
/* Merge the data types specified in the two decls. */
newtype = common_type (TREE_TYPE (newdecl), TREE_TYPE (olddecl));
@ -3387,8 +3375,6 @@ duplicate_decls (newdecl, olddecl)
/* Keep the old rtl since we can safely use it. */
DECL_RTL (newdecl) = DECL_RTL (olddecl);
pop_obstacks ();
}
/* If cannot merge, then use the new type and qualifiers,
and don't preserve the old rtl. */
@ -3632,6 +3618,15 @@ pushdecl (x)
DECL_CONTEXT (x) = current_function_decl;
if (!DECL_CONTEXT (x))
DECL_CONTEXT (x) = FROB_CONTEXT (current_namespace);
/* If this is the declaration for a namespace-scope function,
but the declaration itself is in a local scope, mark the
declaration. */
if (TREE_CODE (x) == FUNCTION_DECL
&& DECL_NAMESPACE_SCOPE_P (x)
&& current_function_decl
&& x != current_function_decl)
DECL_LOCAL_FUNCTION_P (x) = 1;
}
/* Type are looked up using the DECL_NAME, as that is what the rest of the
@ -3799,15 +3794,11 @@ pushdecl (x)
&& (!TYPE_NAME (type)
|| TYPE_NAME (type) != DECL_ABSTRACT_ORIGIN (x)))
{
push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
DECL_ORIGINAL_TYPE (x) = type;
type = build_type_copy (type);
TYPE_STUB_DECL (type) = TYPE_STUB_DECL (DECL_ORIGINAL_TYPE (x));
TYPE_NAME (type) = x;
TREE_TYPE (x) = type;
pop_obstacks ();
}
if (type != error_mark_node
@ -4469,15 +4460,6 @@ implicitly_declare (functionid)
tree functionid;
{
register tree decl;
int temp = allocation_temporary_p ();
push_obstacks_nochange ();
/* Save the decl permanently so we can warn if definition follows.
In ANSI C, warn_implicit is usually false, so the saves little space.
But in C++, it's usually true, hence the extra code. */
if (temp && (! warn_implicit || toplevel_bindings_p ()))
end_temporary_allocation ();
/* We used to reuse an old implicit decl here,
but this loses with inline functions because it can clobber
@ -4501,8 +4483,6 @@ implicitly_declare (functionid)
SET_IDENTIFIER_IMPLICIT_DECL (functionid, decl);
pop_obstacks ();
return decl;
}
@ -5227,8 +5207,6 @@ build_typename_type (context, name, fullname, base_type)
static struct hash_table ht;
push_obstacks (&permanent_obstack, &permanent_obstack);
if (!ht.table)
{
static struct hash_table *h = &ht;
@ -5259,8 +5237,6 @@ build_typename_type (context, name, fullname, base_type)
/* Insert the type into the table. */
hash_lookup (&ht, t, /*create=*/true, /*copy=*/0);
pop_obstacks ();
return t;
}
@ -6807,14 +6783,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
tem = maybe_push_decl (decl);
if (processing_template_decl)
{
if (at_function_scope_p ())
push_permanent_obstack ();
tem = push_template_decl (tem);
if (at_function_scope_p ())
pop_obstacks ();
}
tem = push_template_decl (tem);
#if ! defined (ASM_OUTPUT_BSS) && ! defined (ASM_OUTPUT_ALIGNED_BSS)
/* Tell the back-end to use or not use .common as appropriate. If we say
@ -6828,9 +6797,6 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
if (! processing_template_decl)
start_decl_1 (tem);
/* Corresponding pop_obstacks is done in `cp_finish_decl'. */
push_obstacks_nochange ();
return tem;
}
@ -7610,8 +7576,6 @@ emit_local_var (decl)
If the length of an array type is not known before,
it must be determined now, from the initial value, or it is an error.
Call `pop_obstacks' iff NEED_POP is nonzero.
For C++, `cp_finish_decl' must be fairly evasive: it must keep initializers
for aggregates that have constructors alive on the permanent obstack,
so that the global initializing functions can be written at the end.
@ -7628,15 +7592,13 @@ emit_local_var (decl)
ambiguity as it goes. This can be sped up later. */
void
cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
cp_finish_decl (decl, init, asmspec_tree, flags)
tree decl, init;
tree asmspec_tree;
int need_pop;
int flags;
{
register tree type;
tree ttype = NULL_TREE;
int temporary = allocation_temporary_p ();
const char *asmspec = NULL;
int was_readonly = 0;
@ -7678,12 +7640,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
type = TREE_TYPE (decl);
if (type == error_mark_node)
{
if (toplevel_bindings_p () && temporary)
end_temporary_allocation ();
return;
}
return;
/* Add this declaration to the statement-tree. */
if (building_stmt_tree ()
@ -7763,14 +7720,6 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
GNU_xref_decl (current_function_decl, decl);
/* For top-level declaration, the initial value was read in
the temporary obstack. MAXINDEX, rtl, etc. to be made below
must go in the permanent obstack; but don't discard the
temporary data yet. */
if (toplevel_bindings_p () && temporary)
end_temporary_allocation ();
if (TREE_CODE (decl) == VAR_DECL)
layout_var_decl (decl);
@ -7875,12 +7824,6 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
}
}
if (need_pop)
/* Resume permanent allocation, if not within a function. The
corresponding push_obstacks_nochange is in start_decl,
start_method, groktypename, and in grokfield. */
pop_obstacks ();
if (was_readonly)
TREE_READONLY (decl) = 1;
}
@ -7892,7 +7835,7 @@ finish_decl (decl, init, asmspec_tree)
tree decl, init;
tree asmspec_tree;
{
cp_finish_decl (decl, init, asmspec_tree, 1, 0);
cp_finish_decl (decl, init, asmspec_tree, 0);
}
/* Generate code to handle the destruction of the function-scoped
@ -7909,8 +7852,7 @@ destroy_local_static (decl)
if (atexit_node == 0)
{
tree atexit_fndecl, PFV, pfvlist;
/* Remember this information until end of file. */
push_obstacks (&permanent_obstack, &permanent_obstack);
PFV = build_pointer_type (build_function_type
(void_type_node, void_list_node));
@ -7928,7 +7870,6 @@ destroy_local_static (decl)
mark_used (atexit_fndecl);
atexit_node = default_conversion (atexit_fndecl);
pop_lang_context ();
pop_obstacks ();
}
/* Call build_cleanup before we enter the anonymous function so that
@ -7985,9 +7926,6 @@ expand_static_init (decl, init)
tree assignment;
tree temp_init;
/* Remember this information until end of file. */
push_obstacks (&permanent_obstack, &permanent_obstack);
/* Emit code to perform this initialization but once. This code
looks like:
@ -8061,9 +7999,6 @@ expand_static_init (decl, init)
finish_compound_stmt (/*has_no_scope=*/0, then_clause);
finish_then_clause (if_stmt);
finish_if_stmt ();
/* Resume old (possibly temporary) allocation. */
pop_obstacks ();
}
else
{
@ -8111,9 +8046,6 @@ complete_array_type (type, initial_value, do_default)
register tree maxindex = NULL_TREE;
int value = 0;
/* Allocate on the same obstack as TYPE. */
push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
if (initial_value)
{
/* Note MAXINDEX is really the maximum index,
@ -8181,8 +8113,6 @@ complete_array_type (type, initial_value, do_default)
TYPE_DOMAIN (TYPE_MAIN_VARIANT (type)) = domain;
}
pop_obstacks();
/* Lay out the type now that we can get the real answer. */
layout_type (type);
@ -8575,13 +8505,9 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
context = NULL_TREE;
if (processing_template_decl)
{
/* If we're in a template, we need DECL_LANG_SPECIFIC so that
we can call push_template_decl. */
push_permanent_obstack ();
decl = build_lang_decl (VAR_DECL, declarator, type);
pop_obstacks ();
}
/* If we're in a template, we need DECL_LANG_SPECIFIC so that
we can call push_template_decl. */
decl = build_lang_decl (VAR_DECL, declarator, type);
else
decl = build_decl (VAR_DECL, declarator, type);
@ -8671,8 +8597,6 @@ build_ptrmemfunc_type (type)
unqualified_variant
= build_ptrmemfunc_type (TYPE_MAIN_VARIANT (type));
push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
u = make_lang_type (UNION_TYPE);
SET_IS_AGGR_TYPE (u, 0);
fields[0] = build_lang_decl (FIELD_DECL, pfn_identifier, type);
@ -8695,8 +8619,6 @@ build_ptrmemfunc_type (type)
fields[2] = build_lang_decl (FIELD_DECL, pfn_or_delta2_identifier, u);
finish_builtin_type (t, "__ptrmemfunc_type", fields, 2, ptr_type_node);
pop_obstacks ();
/* Zap out the name so that the back-end will give us the debugging
information for this anonymous RECORD_TYPE. */
TYPE_NAME (t) = NULL_TREE;
@ -10517,14 +10439,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
/* Make sure this typedef lives as long as its type,
since it might be used as a template parameter. */
if (type != error_mark_node)
push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
if (processing_template_decl)
decl = build_lang_decl (TYPE_DECL, declarator, type);
else
decl = build_decl (TYPE_DECL, declarator, type);
if (type != error_mark_node)
pop_obstacks ();
}
/* If the user declares "typedef struct {...} foo" then the
@ -11976,7 +11894,6 @@ xref_tag (code_type_node, name, globalize)
{
enum tag_types tag_code;
enum tree_code code;
int temp = 0;
register tree ref, t;
struct binding_level *b = current_binding_level;
int got_type = 0;
@ -12117,22 +12034,12 @@ xref_tag (code_type_node, name, globalize)
}
}
push_obstacks_nochange ();
if (! ref)
{
/* If no such tag is yet defined, create a forward-reference node
and record it as the "definition".
When a real declaration of this type is found,
the forward-reference will be altered into a real type. */
/* In C++, since these migrate into the global scope, we must
build them on the permanent obstack. */
temp = allocation_temporary_p ();
if (temp)
end_temporary_allocation ();
if (code == ENUMERAL_TYPE)
{
cp_error ("use of enum `%#D' without previous declaration", name);
@ -12197,8 +12104,6 @@ xref_tag (code_type_node, name, globalize)
CLASSTYPE_DECLARED_CLASS (ref) = 0;
}
pop_obstacks ();
TREE_TYPE (ref) = attributes;
return ref;
@ -12250,7 +12155,6 @@ xref_basetypes (code_type_node, name, ref, binfo)
}
len = list_length (binfo);
push_obstacks (TYPE_OBSTACK (ref), TYPE_OBSTACK (ref));
/* First, make sure that any templates in base-classes are
instantiated. This ensures that if we call ourselves recursively
@ -12392,8 +12296,6 @@ xref_basetypes (code_type_node, name, ref, binfo)
/* Now that we know all the base-classes, set up the list of virtual
bases. */
CLASSTYPE_VBASECLASSES (ref) = get_vbase_types (ref);
pop_obstacks ();
}
@ -12410,10 +12312,6 @@ start_enum (name)
register tree enumtype = NULL_TREE;
struct binding_level *b = current_binding_level;
/* We are wasting space here and putting these on the permanent_obstack so
that typeid(local enum) will work correctly. */
push_obstacks (&permanent_obstack, &permanent_obstack);
/* If this is the real definition for a previous forward reference,
fill in the contents in the same object that used to be the
forward reference. */
@ -12567,9 +12465,6 @@ finish_enum (enumtype)
rest_of_type_compilation (enumtype, namespace_bindings_p ());
}
/* In start_enum we pushed obstacks. Here, we must pop them. */
pop_obstacks ();
return enumtype;
}
@ -13113,13 +13008,6 @@ start_function (declspecs, declarator, attrs, flags)
TREE_THIS_VOLATILE (DECL_RESULT (decl1)) = CP_TYPE_VOLATILE_P (restype);
}
/* Allocate further tree nodes temporarily during compilation
of this function only. Tiemann moved up here from bottom of fn. */
/* If this is a nested function, then we must continue to allocate RTL
on the permanent obstack in case we need to inline it later. */
if (! hack_decl_function_context (decl1))
temporary_allocation ();
++function_depth;
if (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (decl1))
@ -13806,12 +13694,6 @@ finish_function (lineno, flags)
--function_depth;
/* Free all the tree nodes making up this function. */
/* Switch back to allocating nodes permanently
until we start another function. */
if (! nested)
permanent_allocation (1);
if (!DECL_SAVED_INSNS (fndecl) && !DECL_SAVED_FUNCTION_DATA (fndecl))
{
tree t;
@ -13927,7 +13809,7 @@ start_method (declspecs, declarator, attrlist)
grok_op_properties (fndecl, DECL_VIRTUAL_P (fndecl), 0);
}
cp_finish_decl (fndecl, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (fndecl, NULL_TREE, NULL_TREE, 0);
/* Make a place for the parms */
pushlevel (0);

View File

@ -1454,14 +1454,13 @@ check_classfn (ctype, function)
/* We have just processed the DECL, which is a static data member.
Its initializer, if present, is INIT. The ASMSPEC_TREE, if
present, is the assembly-language name for the data member.
NEED_POP and FLAGS are as for cp_finish_decl. */
FLAGS is as for cp_finish_decl. */
void
finish_static_data_member_decl (decl, init, asmspec_tree, need_pop, flags)
finish_static_data_member_decl (decl, init, asmspec_tree, flags)
tree decl;
tree init;
tree asmspec_tree;
int need_pop;
int flags;
{
const char *asmspec = 0;
@ -1512,7 +1511,7 @@ finish_static_data_member_decl (decl, init, asmspec_tree, need_pop, flags)
DECL_CONTEXT (decl) = current_class_type;
DECL_CLASS_CONTEXT (decl) = current_class_type;
cp_finish_decl (decl, init, asmspec_tree, need_pop, flags);
cp_finish_decl (decl, init, asmspec_tree, flags);
}
/* Process the specs, declarator (NULL if omitted) and width (NULL if omitted)
@ -1670,9 +1669,6 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
}
}
/* The corresponding pop_obstacks is in cp_finish_decl. */
push_obstacks_nochange ();
if (processing_template_decl && ! current_function_decl
&& (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == FUNCTION_DECL))
value = push_template_decl (value);
@ -1684,7 +1680,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
if (TREE_CODE (value) == VAR_DECL)
{
finish_static_data_member_decl (value, init, asmspec_tree,
/*need_pop=*/1, flags);
flags);
return value;
}
if (TREE_CODE (value) == FIELD_DECL)
@ -1698,7 +1694,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
}
if (DECL_INITIAL (value) == error_mark_node)
init = error_mark_node;
cp_finish_decl (value, init, asmspec_tree, 1, flags);
cp_finish_decl (value, init, asmspec_tree, flags);
DECL_INITIAL (value) = init;
DECL_IN_AGGR_P (value) = 1;
return value;
@ -1712,7 +1708,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
DECL_RTL (value) = NULL_RTX;
DECL_ASSEMBLER_NAME (value) = get_identifier (asmspec);
}
cp_finish_decl (value, init, asmspec_tree, 1, flags);
cp_finish_decl (value, init, asmspec_tree, flags);
/* Pass friends back this way. */
if (DECL_FRIEND_P (value))
@ -1773,7 +1769,7 @@ grokbitfield (declarator, declspecs, width)
cp_error ("static member `%D' cannot be a bitfield", value);
return NULL_TREE;
}
cp_finish_decl (value, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (value, NULL_TREE, NULL_TREE, 0);
if (width != error_mark_node)
{
@ -1994,10 +1990,8 @@ get_temp_name (type, staticp)
tree decl;
int toplev = toplevel_bindings_p ();
push_obstacks_nochange ();
if (toplev || staticp)
{
end_temporary_allocation ();
sprintf (buf, AUTO_TEMP_FORMAT, global_temp_name_counter++);
decl = pushdecl_top_level (build_decl (VAR_DECL, get_identifier (buf), type));
}
@ -2019,7 +2013,6 @@ get_temp_name (type, staticp)
my_friendly_assert (DECL_INITIAL (decl) == NULL_TREE,
19990826);
}
pop_obstacks ();
return decl;
}
@ -2750,7 +2743,6 @@ get_sentry (base)
tree sentry = IDENTIFIER_GLOBAL_VALUE (sname);
if (! sentry)
{
push_permanent_obstack ();
sentry = build_decl (VAR_DECL, sname, integer_type_node);
TREE_PUBLIC (sentry) = 1;
DECL_ARTIFICIAL (sentry) = 1;
@ -2758,8 +2750,7 @@ get_sentry (base)
TREE_USED (sentry) = 1;
DECL_COMMON (sentry) = 1;
pushdecl_top_level (sentry);
cp_finish_decl (sentry, NULL_TREE, NULL_TREE, 0, 0);
pop_obstacks ();
cp_finish_decl (sentry, NULL_TREE, NULL_TREE, 0);
}
return sentry;
}
@ -3428,7 +3419,6 @@ finish_file ()
parse_time -= this_time - start_time;
varconst_time += this_time - start_time;
start_time = get_run_time ();
permanent_allocation (1);
do
{
@ -4806,14 +4796,12 @@ lookup_arg_dependent (name, fns, args)
/* Note that we've already looked at some namespaces during normal
unqualified lookup, unless we found a decl in function scope. */
if (fns && ! TREE_PERMANENT (OVL_CURRENT (fns)))
if (fns && DECL_LOCAL_FUNCTION_P (OVL_CURRENT (fns)))
k.namespaces = NULL_TREE;
else
unqualified_namespace_lookup (name, 0, &k.namespaces);
push_scratch_obstack ();
arg_assoc_args (&k, args);
pop_obstacks ();
return k.functions;
}

View File

@ -192,7 +192,6 @@ call_eh_info ()
/* Declare cp_eh_info * __start_cp_handler (void),
as defined in exception.cc. */
push_permanent_obstack ();
/* struct cp_eh_info. This must match exception.cc. Note that this
type is not pushed anywhere. */
@ -251,7 +250,6 @@ call_eh_info ()
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
return build_function_call (fn, NULL_TREE);
@ -272,7 +270,7 @@ push_eh_info ()
DECL_ARTIFICIAL (decl) = 1;
DECL_INITIAL (decl) = fn;
decl = pushdecl (decl);
cp_finish_decl (decl, fn, NULL_TREE, 0, 0);
cp_finish_decl (decl, fn, NULL_TREE, 0);
}
/* Returns a reference to the cp_eh_info node for the current exception. */
@ -414,7 +412,6 @@ do_pop_exception ()
{
/* Declare void __cp_pop_exception (void *),
as defined in exception.cc. */
push_permanent_obstack ();
fn = build_lang_decl
(FUNCTION_DECL, fn,
build_function_type (void_type_node, tree_cons
@ -424,7 +421,6 @@ do_pop_exception ()
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
@ -501,7 +497,7 @@ initialize_handler_parm (decl)
decl = pushdecl (decl);
start_decl_1 (decl);
cp_finish_decl (decl, init, NULL_TREE, 0,
cp_finish_decl (decl, init, NULL_TREE,
LOOKUP_ONLYCONVERTING|DIRECT_BIND);
}
@ -619,7 +615,7 @@ expand_end_eh_spec (raises, try_block)
decl = build_decl (VAR_DECL, NULL_TREE, tmp);
DECL_ARTIFICIAL (decl) = 1;
DECL_INITIAL (decl) = types;
cp_finish_decl (decl, types, NULL_TREE, 0, 0);
cp_finish_decl (decl, types, NULL_TREE, 0);
decl = decay_conversion (decl);
@ -628,8 +624,6 @@ expand_end_eh_spec (raises, try_block)
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
{
push_permanent_obstack ();
tmp = tree_cons
(NULL_TREE, integer_type_node, tree_cons
(NULL_TREE, TREE_TYPE (decl), void_list_node));
@ -642,7 +636,6 @@ expand_end_eh_spec (raises, try_block)
TREE_THIS_VOLATILE (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
@ -750,7 +743,6 @@ alloc_eh_object (type)
{
/* Declare __eh_alloc (size_t), as defined in exception.cc. */
tree tmp;
push_permanent_obstack ();
tmp = tree_cons (NULL_TREE, sizetype, void_list_node);
fn = build_lang_decl (FUNCTION_DECL, fn,
build_function_type (ptr_type_node, tmp));
@ -759,7 +751,6 @@ alloc_eh_object (type)
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
@ -841,7 +832,7 @@ expand_throw (exp)
{
tree temp = create_temporary_var (TREE_TYPE (exp));
DECL_INITIAL (temp) = exp;
cp_finish_decl (temp, exp, NULL_TREE, 0, LOOKUP_ONLYCONVERTING);
cp_finish_decl (temp, exp, NULL_TREE, LOOKUP_ONLYCONVERTING);
exp = temp;
}
@ -894,7 +885,6 @@ expand_throw (exp)
/* Declare __cp_push_exception (void*, void*, void (*)(void*, int)),
as defined in exception.cc. */
tree tmp;
push_permanent_obstack ();
tmp = tree_cons
(NULL_TREE, ptr_type_node, tree_cons
(NULL_TREE, ptr_type_node, tree_cons
@ -906,7 +896,6 @@ expand_throw (exp)
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
@ -928,7 +917,6 @@ expand_throw (exp)
{
/* Declare void __uncatch_exception (void)
as defined in exception.cc. */
push_permanent_obstack ();
fn = build_lang_decl (FUNCTION_DECL, fn,
build_function_type (void_type_node,
void_list_node));
@ -937,7 +925,6 @@ expand_throw (exp)
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);

View File

@ -311,14 +311,12 @@ extract_scalar_init (decl, init)
extern struct obstack temporary_obstack;
tree t = NULL_TREE;
push_obstacks (&temporary_obstack, &temporary_obstack);
start_sequence ();
value = expand_expr (init, NULL_RTX, VOIDmode, 0);
insns = get_insns ();
end_sequence ();
reg_scan (insns, max_reg_num (), 0);
jump_optimize (insns, 0, 0, 1);
pop_obstacks ();
for (insn = insns; insn; insn = NEXT_INSN (insn))
{

View File

@ -2076,7 +2076,6 @@ build_java_class_ref (type)
class_decl = IDENTIFIER_GLOBAL_VALUE (name);
if (class_decl == NULL_TREE)
{
push_permanent_obstack ();
class_decl = build_decl (VAR_DECL, name, TREE_TYPE (jclass_node));
TREE_STATIC (class_decl) = 1;
DECL_EXTERNAL (class_decl) = 1;
@ -2085,7 +2084,6 @@ build_java_class_ref (type)
DECL_IGNORED_P (class_decl) = 1;
pushdecl_top_level (class_decl);
make_decl_rtl (class_decl, NULL_PTR, 1);
pop_obstacks ();
}
return class_decl;
}

View File

@ -379,13 +379,11 @@ get_time_identifier (name)
time_identifier = get_identifier (buf);
if (TIME_IDENTIFIER_TIME (time_identifier) == NULL_TREE)
{
push_permanent_obstack ();
TIME_IDENTIFIER_TIME (time_identifier) = build_int_2 (0, 0);
TIME_IDENTIFIER_FILEINFO (time_identifier)
= build_int_2 (0, 1);
SET_IDENTIFIER_GLOBAL_VALUE (time_identifier, filename_times);
filename_times = time_identifier;
pop_obstacks ();
}
return time_identifier;
}
@ -1851,11 +1849,9 @@ snarf_defarg ()
len = obstack_object_size (&inline_text_obstack);
buf = obstack_finish (&inline_text_obstack);
push_obstacks (&inline_text_obstack, &inline_text_obstack);
arg = make_node (DEFAULT_ARG);
DEFARG_LENGTH (arg) = len - 1;
DEFARG_POINTER (arg) = buf;
pop_obstacks ();
return arg;
}
@ -1872,11 +1868,7 @@ add_defarg_fn (decl)
if (TREE_CODE (decl) == FUNCTION_DECL)
TREE_VALUE (defarg_fns) = decl;
else
{
push_obstacks (&inline_text_obstack, &inline_text_obstack);
defarg_fns = tree_cons (current_class_type, decl, defarg_fns);
pop_obstacks ();
}
defarg_fns = tree_cons (current_class_type, decl, defarg_fns);
}
/* Helper for do_pending_defargs. Starts the parsing of a default arg. */
@ -3058,13 +3050,7 @@ is_global (d)
default:
my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (d)) == 'd', 980629);
/* A template parameter is not really global, even though it
has no enclosing scope. */
if (DECL_TEMPLATE_PARM_P (d))
return 0;
d = CP_DECL_CONTEXT (d);
return TREE_CODE (d) == NAMESPACE_DECL;
return DECL_NAMESPACE_SCOPE_P (d);
}
}
@ -3216,10 +3202,6 @@ do_identifier (token, parsing, args)
local variables and then finding matching instantiations. */
if (current_template_parms
&& (is_overloaded_fn (id)
/* If it's not going to be around at instantiation time, we
look it up then. This is a hack, and should go when we
really get dependent/independent name lookup right. */
|| !TREE_PERMANENT (id)
/* Some local VAR_DECLs (such as those for local variables
in member functions of local classes) are built on the
permanent obstack. */
@ -4491,11 +4473,7 @@ real_yylex ()
/* We have read the entire constant.
Construct a STRING_CST for the result. */
if (processing_template_decl)
push_obstacks (&permanent_obstack, &permanent_obstack);
yylval.ttype = build_string (p - (token_buffer + 1), token_buffer + 1);
if (processing_template_decl)
pop_obstacks ();
if (wide_flag)
TREE_TYPE (yylval.ttype) = wchar_array_type_node;

View File

@ -2149,7 +2149,6 @@ emit_thunk (thunk_fndecl)
/* Make sure we build up its RTL before we go onto the
temporary obstack. */
make_function_rtl (thunk_fndecl);
temporary_allocation ();
DECL_RESULT (thunk_fndecl)
= build_decl (RESULT_DECL, 0, integer_type_node);
fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
@ -2158,7 +2157,6 @@ emit_thunk (thunk_fndecl)
assemble_start_function (thunk_fndecl, fnname);
ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function);
assemble_end_function (thunk_fndecl, fnname);
permanent_allocation (1);
current_function_decl = 0;
current_function = 0;
}
@ -2211,10 +2209,7 @@ emit_thunk (thunk_fndecl)
/* Don't let the backend defer this function. */
if (DECL_DEFER_OUTPUT (thunk_fndecl))
{
output_inline_function (thunk_fndecl);
permanent_allocation (1);
}
output_inline_function (thunk_fndecl);
}
#endif /* ASM_OUTPUT_MI_THUNK */

File diff suppressed because it is too large Load Diff

View File

@ -1033,7 +1033,7 @@ condition:
}
init
{
cp_finish_decl ($<ttype>6, $7, $4, 1, LOOKUP_ONLYCONVERTING);
cp_finish_decl ($<ttype>6, $7, $4, LOOKUP_ONLYCONVERTING);
$$ = convert_from_reference ($<ttype>6);
if (TREE_CODE (TREE_TYPE ($$)) == ARRAY_TYPE)
cp_error ("definition of array `%#D' in condition", $$);
@ -1381,8 +1381,6 @@ primary:
| boolean.literal
| string
{
if (processing_template_decl)
push_obstacks (&permanent_obstack, &permanent_obstack);
$$ = combine_strings ($$);
/* combine_strings doesn't set up TYPE_MAIN_VARIANT of
a const array the way we want, so fix it. */
@ -1390,8 +1388,6 @@ primary:
TREE_TYPE ($$) = build_cplus_array_type
(TREE_TYPE (TREE_TYPE ($$)),
TYPE_DOMAIN (TREE_TYPE ($$)));
if (processing_template_decl)
pop_obstacks ();
}
| '(' expr ')'
{ $$ = finish_parenthesized_expr ($2); }
@ -1867,11 +1863,11 @@ initdcl:
$3, prefix_attributes); }
init
/* Note how the declaration of the variable is in effect while its init is parsed! */
{ cp_finish_decl ($<ttype>5, $6, $2, 1, LOOKUP_ONLYCONVERTING); }
{ cp_finish_decl ($<ttype>5, $6, $2, LOOKUP_ONLYCONVERTING); }
| declarator maybeasm maybe_attribute
{ $<ttype>$ = start_decl ($<ttype>1, current_declspecs, 0,
$3, prefix_attributes);
cp_finish_decl ($<ttype>$, NULL_TREE, $2, 1, 0); }
cp_finish_decl ($<ttype>$, NULL_TREE, $2, 0); }
;
/* This rule assumes a certain configuration of the parser stack.
@ -1886,12 +1882,12 @@ initdcl0_innards:
/* Note how the declaration of the variable is in effect
while its init is parsed! */
init
{ cp_finish_decl ($<ttype>3, $4, $<ttype>0, 1,
{ cp_finish_decl ($<ttype>3, $4, $<ttype>0,
LOOKUP_ONLYCONVERTING); }
| maybe_attribute
{ tree d;
parse_decl ($<ttype>-1, $<ttype>-2, $1, 0, &d);
cp_finish_decl (d, NULL_TREE, $<ttype>0, 1, 0); }
cp_finish_decl (d, NULL_TREE, $<ttype>0, 0); }
;
initdcl0:
@ -1914,7 +1910,7 @@ nomods_initdcl0:
| constructor_declarator maybeasm maybe_attribute
{ tree d;
parse_decl($1, NULL_TREE, $3, 0, &d);
cp_finish_decl (d, NULL_TREE, $2, 1, 0); }
cp_finish_decl (d, NULL_TREE, $2, 0); }
;
/* the * rules are dummies to accept the Apollo extended syntax

View File

@ -336,7 +336,7 @@ push_inline_template_parms_recursive (parmlist, levels)
TREE_TYPE (parm));
SET_DECL_ARTIFICIAL (decl);
DECL_INITIAL (decl) = DECL_INITIAL (parm);
DECL_TEMPLATE_PARM_P (decl) = 1;
SET_DECL_TEMPLATE_PARM_P (decl);
pushdecl (decl);
}
break;
@ -1815,7 +1815,7 @@ process_template_parm (list, next)
decl, TREE_TYPE (parm));
}
SET_DECL_ARTIFICIAL (decl);
DECL_TEMPLATE_PARM_P (decl) = 1;
SET_DECL_TEMPLATE_PARM_P (decl);
pushdecl (decl);
parm = build_tree_list (defval, parm);
return chainon (list, parm);
@ -3888,11 +3888,6 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
/*globalize=*/1);
return found;
}
/* Since we didn't find the type, we'll have to create it.
Since we'll be saving this type on the
DECL_TEMPLATE_INSTANTIATIONS list, it must be permanent. */
push_obstacks (&permanent_obstack, &permanent_obstack);
/* Create the type. */
if (TREE_CODE (template_type) == ENUMERAL_TYPE)
@ -4000,9 +3995,6 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
the instantiation and exit above. */
tsubst_enum (template_type, t, arglist);
/* We're done with the permanent obstack, now. */
pop_obstacks ();
/* Reset the name of the type, now that CLASSTYPE_TEMPLATE_INFO
is set up. */
if (TREE_CODE (t) != ENUMERAL_TYPE)
@ -4970,7 +4962,6 @@ instantiate_class_template (type)
finish_static_data_member_decl (r, init,
/*asmspec_tree=*/NULL_TREE,
/*need_pop=*/0,
/*flags=*/0);
if (DECL_DEFINED_IN_CLASS_P (r))
@ -5894,10 +5885,7 @@ tsubst_decl (t, args, type, in_decl)
/* This declaration is going to have to be around for a while,
so me make sure it is on a saveable obstack. */
push_obstacks_nochange ();
saveable_allocation ();
r = copy_node (t);
pop_obstacks ();
TREE_TYPE (r) = type;
c_apply_type_quals_to_decl (CP_TYPE_QUALS (type), r);
@ -7119,7 +7107,7 @@ tsubst_expr (t, args, complain, in_decl)
if (TREE_CODE (decl) == VAR_DECL)
DECL_TEMPLATE_INSTANTIATED (decl) = 1;
maybe_push_decl (decl);
cp_finish_decl (decl, init, NULL_TREE, 0, 0);
cp_finish_decl (decl, init, NULL_TREE, 0);
}
return decl;
}
@ -7350,8 +7338,6 @@ instantiate_template (tmpl, targ_ptr)
tree gen_tmpl;
tree spec;
int i, len;
struct obstack *old_fmp_obstack;
extern struct obstack *function_maybepermanent_obstack;
tree inner_args;
if (tmpl == error_mark_node)
@ -7381,10 +7367,6 @@ instantiate_template (tmpl, targ_ptr)
else
gen_tmpl = tmpl;
push_obstacks (&permanent_obstack, &permanent_obstack);
old_fmp_obstack = function_maybepermanent_obstack;
function_maybepermanent_obstack = &permanent_obstack;
len = DECL_NTPARMS (gen_tmpl);
inner_args = innermost_args (targ_ptr);
i = len;
@ -7414,9 +7396,6 @@ instantiate_template (tmpl, targ_ptr)
add_pending_template (fndecl);
out:
function_maybepermanent_obstack = old_fmp_obstack;
pop_obstacks ();
return fndecl;
}
@ -9540,7 +9519,7 @@ instantiate_decl (d)
DECL_EXTERNAL (d) = 1;
DECL_NOT_REALLY_EXTERN (d) = 1;
}
cp_finish_decl (d, DECL_INITIAL (d), NULL_TREE, 0, 0);
cp_finish_decl (d, DECL_INITIAL (d), NULL_TREE, 0);
}
else if (TREE_CODE (d) == FUNCTION_DECL)
{

View File

@ -143,8 +143,6 @@ call_void_fn (name)
d = IDENTIFIER_GLOBAL_VALUE (d);
else
{
push_obstacks (&permanent_obstack, &permanent_obstack);
type = build_function_type (void_type_node, void_list_node);
d = build_lang_decl (FUNCTION_DECL, d, type);
DECL_EXTERNAL (d) = 1;
@ -152,7 +150,6 @@ call_void_fn (name)
DECL_ARTIFICIAL (d) = 1;
pushdecl_top_level (d);
make_function_rtl (d);
pop_obstacks ();
}
mark_used (d);
@ -340,8 +337,6 @@ get_tinfo_var (type)
else
size = 2 * POINTER_SIZE;
push_obstacks (&permanent_obstack, &permanent_obstack);
/* The type for a character array of the appropriate size. */
arrtype = build_cplus_array_type
(unsigned_char_type_node,
@ -353,11 +348,9 @@ get_tinfo_var (type)
DECL_ARTIFICIAL (tdecl) = 1;
push_to_top_level ();
pushdecl (tdecl);
cp_finish_decl (tdecl, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (tdecl, NULL_TREE, NULL_TREE, 0);
pop_from_top_level ();
pop_obstacks ();
return tdecl;
}
@ -390,8 +383,6 @@ get_tinfo_fn_unused (type)
if (IDENTIFIER_GLOBAL_VALUE (name))
return IDENTIFIER_GLOBAL_VALUE (name);
push_obstacks (&permanent_obstack, &permanent_obstack);
d = build_lang_decl (FUNCTION_DECL, name, tinfo_fn_type);
DECL_EXTERNAL (d) = 1;
TREE_PUBLIC (d) = 1;
@ -403,7 +394,6 @@ get_tinfo_fn_unused (type)
pushdecl_top_level (d);
make_function_rtl (d);
mark_inline_for_output (d);
pop_obstacks ();
return d;
}
@ -674,7 +664,6 @@ build_dynamic_cast_1 (type, expr)
{
tree tmp;
push_obstacks (&permanent_obstack, &permanent_obstack);
tmp = tree_cons
(NULL_TREE, TREE_TYPE (td1), tree_cons
(NULL_TREE, TREE_TYPE (td1), tree_cons
@ -689,7 +678,6 @@ build_dynamic_cast_1 (type, expr)
DECL_ARTIFICIAL (dcast_fn) = 1;
pushdecl_top_level (dcast_fn);
make_function_rtl (dcast_fn);
pop_obstacks ();
}
mark_used (dcast_fn);
@ -774,7 +762,6 @@ expand_si_desc (tdecl, type)
else
{
tree tmp;
push_obstacks (&permanent_obstack, &permanent_obstack);
tmp = tree_cons
(NULL_TREE, ptr_type_node, tree_cons
(NULL_TREE, const_string_type_node, tree_cons
@ -788,7 +775,6 @@ expand_si_desc (tdecl, type)
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
@ -825,7 +811,6 @@ expand_class_desc (tdecl, type)
/* A reasonably close approximation of __class_type_info::base_info */
push_obstacks (&permanent_obstack, &permanent_obstack);
base_info_type_node = make_lang_type (RECORD_TYPE);
/* Actually const __user_type_info * */
@ -852,7 +837,6 @@ expand_class_desc (tdecl, type)
finish_builtin_type (base_info_type_node, "__base_info", fields,
3, ptr_type_node);
pop_obstacks ();
}
while (--i >= 0)
@ -955,7 +939,6 @@ expand_class_desc (tdecl, type)
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
{
push_obstacks (&permanent_obstack, &permanent_obstack);
tmp = tree_cons
(NULL_TREE, ptr_type_node, tree_cons
(NULL_TREE, const_string_type_node, tree_cons
@ -969,7 +952,6 @@ expand_class_desc (tdecl, type)
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
@ -1002,7 +984,6 @@ expand_ptr_desc (tdecl, type)
else
{
tree tmp;
push_obstacks (&permanent_obstack, &permanent_obstack);
tmp = tree_cons
(NULL_TREE, ptr_type_node, tree_cons
(NULL_TREE, const_string_type_node, tree_cons
@ -1016,7 +997,6 @@ expand_ptr_desc (tdecl, type)
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
@ -1049,7 +1029,6 @@ expand_attr_desc (tdecl, type)
else
{
tree tmp;
push_obstacks (&permanent_obstack, &permanent_obstack);
tmp = tree_cons
(NULL_TREE, ptr_type_node, tree_cons
(NULL_TREE, const_string_type_node, tree_cons
@ -1064,7 +1043,6 @@ expand_attr_desc (tdecl, type)
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
@ -1092,7 +1070,6 @@ expand_generic_desc (tdecl, type, fnname)
else
{
tree tmp;
push_obstacks (&permanent_obstack, &permanent_obstack);
tmp = tree_cons
(NULL_TREE, ptr_type_node, tree_cons
(NULL_TREE, const_string_type_node, void_list_node));
@ -1104,7 +1081,6 @@ expand_generic_desc (tdecl, type, fnname)
DECL_ARTIFICIAL (fn) = 1;
pushdecl_top_level (fn);
make_function_rtl (fn);
pop_obstacks ();
}
mark_used (fn);
@ -1149,7 +1125,7 @@ synthesize_tinfo_fn (fndecl)
DECL_COMMON (tdecl) = 1;
TREE_USED (tdecl) = 1;
DECL_ALIGN (tdecl) = TYPE_ALIGN (ptr_type_node);
cp_finish_decl (tdecl, NULL_TREE, NULL_TREE, 0, 0);
cp_finish_decl (tdecl, NULL_TREE, NULL_TREE, 0);
/* Begin processing the function. */
start_function (NULL_TREE, fndecl, NULL_TREE,

View File

@ -2670,7 +2670,7 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
DECL_ARTIFICIAL (nvtbl) = 1;
nvtbl = pushdecl (nvtbl);
init = NULL_TREE;
cp_finish_decl (nvtbl, init, NULL_TREE, 0,
cp_finish_decl (nvtbl, init, NULL_TREE,
LOOKUP_ONLYCONVERTING);
/* We don't set DECL_VIRTUAL_P and DECL_CONTEXT on nvtbl

View File

@ -992,17 +992,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
tree clobbers;
{
if (TREE_CHAIN (string))
{
if (building_stmt_tree ())
/* We need to build the combined string on the permanent
obstack so that we can use it during instantiations. */
push_permanent_obstack ();
string = combine_strings (string);
if (building_stmt_tree ())
pop_obstacks ();
}
string = combine_strings (string);
if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE])
@ -1163,7 +1153,7 @@ finish_named_return_value (return_id, init)
add_tree (build_min_nt (RETURN_INIT, return_id, init));
else
{
cp_finish_decl (decl, init, NULL_TREE, 0, 0);
cp_finish_decl (decl, init, NULL_TREE, 0);
store_return_init (decl);
}
}
@ -1749,8 +1739,6 @@ tree
begin_class_definition (t)
tree t;
{
push_permanent_obstack ();
if (t == error_mark_node
|| ! IS_AGGR_TYPE (t))
{
@ -1972,8 +1960,6 @@ finish_class_definition (t, attributes, semi, pop_scope_p)
note_got_semicolon (t);
}
pop_obstacks ();
if (! semi)
check_for_missing_semicolon (t);
if (pop_scope_p)
@ -2164,10 +2150,8 @@ finish_typeof (expr)
{
tree t;
push_permanent_obstack ();
t = make_lang_type (TYPEOF_TYPE);
TYPE_FIELDS (t) = expr;
pop_obstacks ();
return t;
}

View File

@ -464,11 +464,9 @@ build_cplus_method_type (basetype, rettype, argtypes)
which is "this". Put it into the list of argument types. Make
sure that the new argument list is allocated on the same obstack
as the type. */
push_obstacks (TYPE_OBSTACK (t), TYPE_OBSTACK (t));
argtypes = tree_cons (NULL_TREE, ptype, argtypes);
TYPE_ARG_TYPES (t) = argtypes;
TREE_SIDE_EFFECTS (argtypes) = 1; /* Mark first argtype as "artificial". */
pop_obstacks ();
/* If we already have such a type, use the old one and free this one.
Note that it also frees up the above cons cell if found. */
@ -1278,14 +1276,12 @@ reverse_path (path)
tree path;
{
register tree prev = NULL_TREE, cur;
push_expression_obstack ();
for (cur = path; cur; cur = BINFO_INHERITANCE_CHAIN (cur))
{
tree r = copy_node (cur);
BINFO_INHERITANCE_CHAIN (r) = prev;
prev = r;
}
pop_obstacks ();
return prev;
}
@ -1538,15 +1534,10 @@ copy_template_template_parm (t)
tree template = TYPE_NAME (t);
tree t2;
/* Make sure these end up on the permanent_obstack. */
push_permanent_obstack ();
t2 = make_lang_type (TEMPLATE_TEMPLATE_PARM);
template = copy_node (template);
copy_lang_decl (template);
pop_obstacks ();
TREE_TYPE (template) = t2;
TYPE_NAME (t2) = template;
TYPE_STUB_DECL (t2) = template;
@ -2325,11 +2316,7 @@ tree
build_expr_ptr_wrapper (ptr)
void *ptr;
{
tree t;
push_expression_obstack ();
t = build_ptr_wrapper (ptr);
pop_obstacks ();
return t;
return build_ptr_wrapper (ptr);
}
/* Build a wrapper around some integer I so we can use it as a tree. */
@ -2363,24 +2350,6 @@ build_srcloc_here ()
return build_srcloc (input_filename, lineno);
}
void
push_expression_obstack ()
{
push_obstacks_nochange ();
current_obstack = expression_obstack;
}
/* Begin allocating on the permanent obstack. When you're done
allocating there, call pop_obstacks to return to the previous set
of obstacks. */
void
push_permanent_obstack ()
{
push_obstacks_nochange ();
end_temporary_allocation ();
}
/* The type of ARG when used as an lvalue. */
tree

View File

@ -4979,10 +4979,6 @@ mark_addressable (exp)
&& DECL_RTL (x) != 0
&& ! DECL_IN_MEMORY_P (x))
{
/* We thought this would make a good constant variable,
but we were wrong. */
push_permanent_obstack ();
TREE_ASM_WRITTEN (x) = 0;
DECL_RTL (x) = 0;
rest_of_decl_compilation (x, 0,
@ -4990,8 +4986,6 @@ mark_addressable (exp)
0);
TREE_ADDRESSABLE (x) = 1;
pop_obstacks ();
return 1;
}
/* Caller should not be trying to mark initialized