* decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.
(init_decl_processing): Don't set TREE_PERMANENT for the
error_mark_node.
(start_decl): Don't rebuild non-permanent ARRAY_TYPEs.
(grokdeclarator): Likewise.
(grokparms): Don't check TREE_PERMANENT when building up lists.
* decl2.c (grokfield): Don't assert TREE_PERMANENT.
(mark_inline_for_output): Likewise.
* expr.c (cplus_expand_expr): Don't check TREE_PERMANENT.
* init.c (build_offset_ref): Don't check TREE_PERMANENT.
* lex.c (check_newline): Don't check ggc_p; it is always one.
* pt.c (process_template_parm): Don't check TREE_PERMANENT.
* spew.c (yylex): Don't copy_node or probe_obstacks for
non-permanent CONSTANTs and STRINGs.
* tree.c (build_cplus_array_type_1): Don't fuss with
TREE_PERMANENT on ARRAY_TYPEs.
From-SVN: r29350
tree decl;
struct binding_level *b;
{
- /* Only things that will live forever should go in the global
- binding level. */
- my_friendly_assert (!(b == global_binding_level
- && !TREE_PERMANENT (decl)),
- 19990817);
-
/* We build up the list in reverse order, and reverse it later if
necessary. */
TREE_CHAIN (decl) = b->names;
build_common_tree_nodes (flag_signed_char);
- TREE_PERMANENT (error_mark_node) = 1;
error_mark_list = build_tree_list (error_mark_node, error_mark_node);
TREE_TYPE (error_mark_list) = error_mark_node;
if (type == error_mark_node)
return NULL_TREE;
- /* Don't lose if destructors must be executed at file-level. */
- if (! processing_template_decl && TREE_STATIC (decl)
- && TYPE_NEEDS_DESTRUCTOR (complete_type (type))
- && !TREE_PERMANENT (decl))
- {
- push_obstacks (&permanent_obstack, &permanent_obstack);
- decl = copy_node (decl);
- if (TREE_CODE (type) == ARRAY_TYPE)
- {
- tree itype = TYPE_DOMAIN (type);
- if (itype && ! TREE_PERMANENT (itype))
- {
- itype = build_index_type (TYPE_MAX_VALUE (itype));
- type = build_cplus_array_type (TREE_TYPE (type), itype);
- TREE_TYPE (decl) = type;
- }
- }
- pop_obstacks ();
- }
-
context
= (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl))
? DECL_CLASS_CONTEXT (decl)
TREE_OVERFLOW (itype) = 0;
}
- /* If we're a parm, we need to have a permanent type so
- mangling checks for re-use will work right. If both the
- element and index types are permanent, the array type
- will be, too. */
- if (decl_context == PARM
- && allocation_temporary_p () && TREE_PERMANENT (type))
- {
- push_obstacks (&permanent_obstack, &permanent_obstack);
- itype = build_index_type (itype);
- pop_obstacks ();
- }
- else
- itype = build_index_type (itype);
+ itype = build_index_type (itype);
dont_grok_size:
resume_momentary (yes);
TREE_CHAIN (last_decl) = decl;
last_decl = decl;
}
- if (! current_function_decl && TREE_PERMANENT (list_node))
- {
- TREE_PURPOSE (list_node) = init;
- TREE_VALUE (list_node) = type;
- TREE_CHAIN (list_node) = NULL_TREE;
- }
- else
- list_node = tree_cons (init, type, NULL_TREE);
+ list_node = tree_cons (init, type, NULL_TREE);
if (result == NULL_TREE)
{
result = list_node;
init = decl_constant_value (init);
else if (TREE_CODE (init) == CONSTRUCTOR)
init = digest_init (TREE_TYPE (value), init, (tree *)0);
- my_friendly_assert (TREE_PERMANENT (init), 192);
if (init == error_mark_node)
/* We must make this look different than `error_mark_node'
because `decl_const_value' would mis-interpret it
decl = DECL_MAIN_VARIANT (decl);
if (DECL_SAVED_INLINE (decl))
return;
- my_friendly_assert (TREE_PERMANENT (decl), 363);
DECL_SAVED_INLINE (decl) = 1;
if (!saved_inlines)
VARRAY_TREE_INIT (saved_inlines, 32, "saved_inlines");
if (AGGR_INIT_VIA_CTOR_P (exp))
{
type = build_pointer_type (type);
- /* Don't clobber a value that might be part of a default
- parameter value. */
mark_addressable (slot);
- if (TREE_PERMANENT (args))
- args = tree_cons (0, build1 (ADDR_EXPR, type, slot),
- TREE_CHAIN (args));
- else
- TREE_VALUE (args) = build1 (ADDR_EXPR, type, slot);
+ args = tree_cons (NULL_TREE,
+ build1 (ADDR_EXPR, type, slot),
+ TREE_CHAIN (args));
call_target = 0;
}
else
return build (OFFSET_REF, TREE_TYPE (t), decl, t);
}
- /* FNFIELDS is most likely allocated on the search_obstack,
- which will go away after this class scope. If we need
- to save this value for later (i.e. for use as an initializer
- for a static variable), then do so here.
-
- ??? The smart thing to do for the case of saving initializers
- is to resolve them before we're done with this scope. */
- if (!TREE_PERMANENT (fnfields)
- && ! allocation_temporary_p ())
- fnfields = copy_list (fnfields);
-
TREE_TYPE (fnfields) = unknown_type_node;
return build (OFFSET_REF, unknown_type_node, decl, fnfields);
}
body_time = this_time;
}
- if (! ggc_p && !TREE_PERMANENT (yylval.ttype))
- {
- input_filename
- = (char *) permalloc (TREE_STRING_LENGTH (yylval.ttype) + 1);
- strcpy (input_filename, TREE_STRING_POINTER (yylval.ttype));
- }
- else
- input_filename = TREE_STRING_POINTER (yylval.ttype);
+ input_filename = TREE_STRING_POINTER (yylval.ttype);
GNU_xref_file (input_filename);
|| TREE_CODE (TREE_TYPE (parm)) == COMPLEX_TYPE))
cp_pedwarn ("`%T' is not a valid type for a template constant parameter",
TREE_TYPE (parm));
- if (TREE_PERMANENT (parm) == 0)
- {
- parm = copy_node (parm);
- TREE_PERMANENT (parm) = 1;
- }
decl = build_decl (CONST_DECL, DECL_NAME (parm), TREE_TYPE (parm));
DECL_INITIAL (parm) = DECL_INITIAL (decl)
= build_template_parm_index (idx, processing_template_decl,
/* if we've got tokens, send them */
else if (num_tokens ())
- {
- tmp_token= *nth_token (0);
-
- /* TMP_TOKEN.YYLVAL.TTYPE may have been allocated on the wrong obstack.
- If we don't find it in CURRENT_OBSTACK's current or immediately
- previous chunk, assume it was and copy it to the current obstack. */
- if ((tmp_token.yychar == CONSTANT
- || tmp_token.yychar == STRING)
- && ! TREE_PERMANENT (tmp_token.yylval.ttype)
- && ! probe_obstack (current_obstack, tmp_token.yylval.ttype, 2)
- && ! probe_obstack (saveable_obstack, tmp_token.yylval.ttype, 2))
- tmp_token.yylval.ttype = copy_node (tmp_token.yylval.ttype);
- }
+ tmp_token= *nth_token (0);
else
{
/* if not, grab the next one and think about it */
if (elt_type == error_mark_node || index_type == error_mark_node)
return error_mark_node;
- push_obstacks_nochange ();
-
- /* If both ELT_TYPE and INDEX_TYPE are permanent,
- make this permanent too. */
- if (TREE_PERMANENT (elt_type)
- && (index_type == 0 || TREE_PERMANENT (index_type)))
- end_temporary_allocation ();
-
if (processing_template_decl
|| uses_template_parms (elt_type)
|| uses_template_parms (index_type))
= TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (elt_type));
TYPE_NEEDS_DESTRUCTOR (t)
= TYPE_NEEDS_DESTRUCTOR (TYPE_MAIN_VARIANT (elt_type));
- pop_obstacks ();
return t;
}