Commit 4dd7201e by Zack Weinberg

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
parent b5031ab7
2000-01-25 Zack Weinberg <zack@wolery.cumb.org>
* 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.
2000-01-25 Clinton Popetz <cpopetz@cygnus.com>
* config/mips/mips.md (zero_extendsidi2_internal): Disable for
......@@ -1030,7 +1046,7 @@ Thu Jan 13 23:44:03 2000 Richard Henderson <rth@cygnus.com>
Use emit_jump_insn for the return insn.
Thu Jan 13 14:46:03 2000 Jason Eckhardt <jle@cygnus.com>
Stan Cox <scox@cygnus.com>
Stan Cox <scox@cygnus.com>
* predict.c: New file. Preliminary infrastructure work for static
branch prediction and basic block reordering.
......@@ -3991,7 +4007,7 @@ Mon Nov 29 18:09:39 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
1999-11-28 Robert Lipe <robertl@cygnus.com>
* i386/sco5.h (FINI_SECTION_ASM_OP_COFF): Move destructor fn
table from .fini into .dtor.
table from .fini into .dtor.
1999-11-28 Anthony Green <green@cygnus.com>
......@@ -4849,7 +4865,7 @@ Wed Nov 10 10:52:42 1999 Tom Tromey <tromey@cygnus.com>
* gcc.c (do_spec_1): Support text between `%u' and `%O'.
Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cppinit.c: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
......@@ -7934,7 +7950,7 @@ Thu Oct 7 23:06:50 1999 Richard Henderson <rth@cygnus.com>
before the fctiwz insn.
Thu Oct 7 22:53:00 1999 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
Mark Mitchell <mark@codesourcery.com>
Mark Mitchell <mark@codesourcery.com>
* tree.c (make_lang_type_fn): New funtion pointer.
(make_lang_type): Call it.
......@@ -8083,7 +8099,7 @@ Tue Oct 5 11:34:52 1999 Michael Meissner <meissner@cygnus.com>
* ggc-simple.c (toplevel): Ditto.
Mon Oct 4 16:48:16 1999 Diego Novillo <dnovillo@cygnus.com>
Jonathan Larmour <jlarmour@cygnus.co.uk>
Jonathan Larmour <jlarmour@cygnus.co.uk>
* config/mips/mips.c (mips_move_2words): Split doubles if
ISA >= 3, !TARGET_64BIT, and destination is not an FP register.
......
......@@ -24,7 +24,6 @@ Boston, MA 02111-1307, USA. */
#include "c-lex.h"
#include "c-tree.h"
#include "flags.h"
#include "obstack.h"
#include "toplev.h"
#include "output.h"
#include "c-pragma.h"
......@@ -291,7 +290,6 @@ declare_hidden_char_array (name, value)
|| warn_larger_than)
type = build_array_type (char_type_node,
build_index_type (build_int_2 (vlen, 0)));
push_obstacks_nochange ();
decl = build_decl (VAR_DECL, get_identifier (name), type);
TREE_STATIC (decl) = 1;
TREE_READONLY (decl) = 1;
......@@ -345,7 +343,7 @@ combine_strings (strings)
if (wide_flag)
length = length * wchar_bytes + wide_length;
p = ggc_p ? ggc_alloc_string (NULL, length) : savealloc (length);
p = ggc_alloc_string (NULL, length);
/* Copy the individual strings into the new combined string.
If the combined string is wide, convert the chars to ints
......@@ -3491,7 +3489,7 @@ c_get_alias_set (t)
if (!TYPE_ALIAS_SET_KNOWN_P (type))
{
/* Types that are not allocated on the permanent obstack are not
/* Types that are not global ('permanent') are not
placed in the type hash table. Thus, there can be multiple
copies of identical types in local scopes. In the long run,
all types should be permanent. */
......
......@@ -194,7 +194,7 @@ finish_file ()
tree_cons (NULL_TREE, NULL_TREE,
void_list_node_1),
NULL_TREE),
NULL_TREE, NULL_TREE, 0);
NULL_TREE, NULL_TREE);
fnname = DECL_ASSEMBLER_NAME (current_function_decl);
store_parm_decls ();
......@@ -216,7 +216,7 @@ finish_file ()
tree_cons (NULL_TREE, NULL_TREE,
void_list_node_1),
NULL_TREE),
NULL_TREE, NULL_TREE, 0);
NULL_TREE, NULL_TREE);
fnname = DECL_ASSEMBLER_NAME (current_function_decl);
store_parm_decls ();
......
......@@ -759,14 +759,7 @@ linenum:
goto skipline;
}
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);
if (main_input_filename == 0)
main_input_filename = input_filename;
......
......@@ -303,17 +303,8 @@ handle_pragma_token (string, token)
#ifdef HANDLE_PRAGMA_WEAK
case ps_weak:
name = permalloc (strlen (string) + 1);
if (name == NULL)
{
warning ("Out of memory parsing #pragma weak");
state = ps_bad;
}
else
{
strcpy (name, string);
state = ps_name;
}
name = xstrdup (string);
state = ps_name;
break;
case ps_name:
......@@ -321,17 +312,8 @@ handle_pragma_token (string, token)
break;
case ps_equals:
value = permalloc (strlen (string) + 1);
if (value == NULL)
{
warning ("Out of memory parsing #pragma weak");
state = ps_bad;
}
else
{
strcpy (value, string);
state = ps_value;
}
value = xstrdup (string);
state = ps_value;
break;
case ps_value:
......
......@@ -235,7 +235,7 @@ extern void shadow_tag PARAMS ((tree));
extern void shadow_tag_warned PARAMS ((tree, int));
extern tree start_enum PARAMS ((tree));
extern int start_function PARAMS ((tree, tree, tree,
tree, int));
tree));
extern tree start_decl PARAMS ((tree, tree, int,
tree, tree));
extern tree start_struct PARAMS ((enum tree_code, tree));
......
......@@ -40,6 +40,7 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "intl.h"
#include "defaults.h"
#include "ggc.h"
/* Nonzero if we've already printed a "missing braces around initializer"
message within this initializer. */
......@@ -4825,7 +4826,8 @@ struct init_node
/* Tree of pending elements at this constructor level.
These are elements encountered out of order
which belong at places we haven't reached yet in actually
writing the output. */
writing the output.
Will never hold tree nodes across GC runs. */
static struct init_node *constructor_pending_elts;
/* The SPELLING_DEPTH of this constructor. */
......@@ -5099,19 +5101,10 @@ really_start_incremental_init (type)
if (constructor_incremental)
{
int momentary = suspend_momentary ();
push_obstacks_nochange ();
if (TREE_PERMANENT (constructor_decl))
end_temporary_allocation ();
make_decl_rtl (constructor_decl, constructor_asmspec,
constructor_top_level);
assemble_variable (constructor_decl, constructor_top_level, 0, 1);
pop_obstacks ();
resume_momentary (momentary);
}
if (constructor_incremental)
{
defer_addressed_constants ();
constructor_subconstants_deferred = 1;
}
......@@ -5392,29 +5385,15 @@ pop_init_level (implicit)
if (TREE_CODE (constructor_type) == ARRAY_TYPE
&& TYPE_DOMAIN (constructor_type) == 0)
{
int failure;
int momentary_p;
push_obstacks_nochange ();
if (TREE_PERMANENT (constructor_type))
end_temporary_allocation ();
momentary_p = suspend_momentary ();
/* We shouldn't have an incomplete array type within
some other type. */
if (constructor_stack->next)
abort ();
failure
= complete_array_type (constructor_type,
constructor, 0);
if (failure)
if (complete_array_type (constructor_type, constructor, 0))
abort ();
size = int_size_in_bytes (constructor_type);
resume_momentary (momentary_p);
pop_obstacks ();
}
output_constant (constructor, size);
......@@ -5448,23 +5427,17 @@ pop_init_level (implicit)
constructor = error_mark_node;
else
{
int momentary = suspend_momentary ();
constructor = build (CONSTRUCTOR, constructor_type, NULL_TREE,
nreverse (constructor_elements));
if (constructor_constant)
TREE_CONSTANT (constructor) = 1;
if (constructor_constant && constructor_simple)
TREE_STATIC (constructor) = 1;
resume_momentary (momentary);
}
}
else
{
tree filled;
int momentary = suspend_momentary ();
if (TREE_CODE (constructor_type) == RECORD_TYPE
|| TREE_CODE (constructor_type) == UNION_TYPE)
{
......@@ -5485,9 +5458,6 @@ pop_init_level (implicit)
constructor_unfilled_index,
integer_one_node);
push_obstacks_nochange ();
if (TREE_PERMANENT (constructor_type))
end_temporary_allocation ();
maxindex = copy_node (maxindex);
TYPE_DOMAIN (constructor_type) = build_index_type (maxindex);
TREE_TYPE (maxindex) = TYPE_DOMAIN (constructor_type);
......@@ -5502,7 +5472,6 @@ pop_init_level (implicit)
"zero or negative array size `%s'");
layout_type (constructor_type);
size = int_size_in_bytes (constructor_type);
pop_obstacks ();
}
filled = size_binop (MULT_EXPR, constructor_unfilled_index,
......@@ -5513,8 +5482,6 @@ pop_init_level (implicit)
if (filled != 0)
assemble_zeros (size - TREE_INT_CST_LOW (filled));
resume_momentary (momentary);
}
......@@ -5672,7 +5639,7 @@ add_pending_init (purpose, value)
}
}
r = (struct init_node *) oballoc (sizeof (struct init_node));
r = (struct init_node *) ggc_alloc_obj (sizeof (struct init_node), 0);
r->purpose = purpose;
r->value = value;
......@@ -6550,12 +6517,6 @@ process_init_element (value)
constructor_fields = 0;
break;
}
/* If the (lexically) previous elments are not now saved,
we can discard the storage for them. */
if (constructor_incremental && constructor_pending_elts == 0 && value != 0
&& constructor_stack == 0)
clear_momentary ();
}
/* Expand an ASM statement with operands, handling output operands
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment