diff options
author | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-09-12 02:45:30 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-09-12 02:45:30 +0000 |
commit | 5868eb4e0aa53750d7b6f916e5da5118961d083c (patch) | |
tree | 28184da20863a95f115b04d3f240978e07f36f9a /gcc | |
parent | 1ccbefcef21836d354e28c07e92fe9a5b5eaedcd (diff) | |
download | gcc-5868eb4e0aa53750d7b6f916e5da5118961d083c.zip gcc-5868eb4e0aa53750d7b6f916e5da5118961d083c.tar.gz gcc-5868eb4e0aa53750d7b6f916e5da5118961d083c.tar.bz2 |
decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.
* 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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/decl.c | 50 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 2 | ||||
-rw-r--r-- | gcc/cp/expr.c | 10 | ||||
-rw-r--r-- | gcc/cp/init.c | 11 | ||||
-rw-r--r-- | gcc/cp/lex.c | 9 | ||||
-rw-r--r-- | gcc/cp/pt.c | 5 | ||||
-rw-r--r-- | gcc/cp/spew.c | 14 | ||||
-rw-r--r-- | gcc/cp/tree.c | 9 |
8 files changed, 7 insertions, 103 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 547f7c6..22e61f0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -969,12 +969,6 @@ add_decl_to_level (decl, b) 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; @@ -6039,7 +6033,6 @@ init_decl_processing () 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; @@ -6694,26 +6687,6 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes) 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) @@ -9959,19 +9932,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) 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); @@ -11486,14 +11447,7 @@ grokparms (first_parm, funcdef_flag) 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; diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 8eed452..14dc741 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1685,7 +1685,6 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist) 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 @@ -2006,7 +2005,6 @@ mark_inline_for_output (decl) 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"); diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index c1f7263..a7b823fa 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -157,14 +157,10 @@ cplus_expand_expr (exp, target, tmode, modifier) 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 diff --git a/gcc/cp/init.c b/gcc/cp/init.c index a5b2417..764bb13 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1652,17 +1652,6 @@ build_offset_ref (type, name) 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); } diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index bcadd93..49dd728 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -2552,14 +2552,7 @@ linenum: 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); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1cb315d..704ac44 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1840,11 +1840,6 @@ process_template_parm (list, next) || 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, diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c index 8fe9c7e..8f853a8 100644 --- a/gcc/cp/spew.c +++ b/gcc/cp/spew.c @@ -269,19 +269,7 @@ yylex () /* 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 */ diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 9cf2ae7..d9db3b0 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -459,14 +459,6 @@ build_cplus_array_type_1 (elt_type, index_type) 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)) @@ -484,7 +476,6 @@ build_cplus_array_type_1 (elt_type, 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; } |