Commit Graph

23 Commits

Author SHA1 Message Date
Josef Zlomek d5d4eae28d splay-tree.c (splay_tree_predecessor): Fix comment.
* splay-tree.c (splay_tree_predecessor): Fix comment.
	(splay_tree_successor): Fix comment.

From-SVN: r66569
2003-05-07 18:19:36 +00:00
John David Anglin f08b7eee21 cp-demangle.c (demangling_new): Cast 0 to enum.
* cp-demangle.c (demangling_new): Cast 0 to enum.
	(demangle_char): Cast return of strdup to char *.
	(is_gnu_v3_mangled_ctor): Cast 0 to enum.
	(is_gnu_v3_mangled_dtor): Likewise.
	* cplus-dem.c (grow_vect): Cast return of xrealloc to void *.
	(work_stuff_copy_to_from): Cast return of xmalloc to char **.
	* fibheap.c (fibnode_new): Cast return of xcalloc to fibnode_t.
	* md5.c (md5_process_bytes): Cast results back to const void *.
	(md5_process_block): Add cast to const md5_uint32 *.
	* regex.c (re_compile_fastmap): Cast enum to UCHAR_T.
	* safe-ctype.c (L, XL, U, XU, D, P, _, C, Z, M, V, T, S): Add cast to
	unsigned short.
	* splay-tree.c (splay_tree_xmalloc_allocate): Cast return of xmalloc
	to void *.
	* vasprintf.c (int_vasprintf): Cast return of malloc to char *.

From-SVN: r57330
2002-09-20 02:40:51 +00:00
Mike Stump 6eedb9ca76 * splay-tree.c (splay_tree_successor): Fix comments.
From-SVN: r57044
2002-09-12 00:51:25 +00:00
Jim Blandy 957978a414 splay-tree.c (splay_tree_xmalloc_allocate, [...]): Use K&R-style definitions, not prototyped definitions.
* splay-tree.c (splay_tree_xmalloc_allocate,
splay_tree_xmalloc_deallocate): Use K&R-style definitions, not
prototyped definitions.  Mark `data' arguments as unused.

From-SVN: r50384
2002-03-07 00:20:12 +00:00
Jim Blandy 00c2f96f89 Allow the user to specify functions for allocating memory for splay tree roots and nodes.
include:
Allow the user to specify functions for allocating memory for
splay tree roots and nodes.
* splay-tree.h (splay_tree_allocate_fn, splay_tree_deallocate_fn):
New types.
(splay_tree): New fields: `allocate', `deallocate', and
`allocate_data'.
(splay_tree_new_with_allocator): New function declaration.

libiberty:
* splay-tree.c (splay_tree_xmalloc_allocate,
splay_tree_xmalloc_deallocate): New functions.
(splay_tree_new): Call splay_tree_new_with_allocator, passing the
above functions and a dummy data pointer.
(splay_tree_new_with_allocator): New function.
(splay_tree_delete_helper, splay_tree_delete, splay_tree_insert,
splay_tree_remove): Use the splay tree's allocation and
deallocation functions.

From-SVN: r49968
2002-02-22 17:01:23 +00:00
Mark Mitchell 5cdba4ff5f splay-tree.h (splay_tree_max): New function.
* splay-tree.h (splay_tree_max): New function.
	(splay_tree_min): Likewise.

From-SVN: r41895
2001-05-07 15:45:24 +00:00
Mark Mitchell f15b9af984 c-decl.c (c_expand_body): Don't generate RTL if flag_syntax_only.
* c-decl.c (c_expand_body): Don't generate RTL if flag_syntax_only.
	(lang_mark_false_label_stack): Remove.
	* c-lex.c (init_c_lex): Add file_info_tree as GC root.  Allocate
	<top level> string in GC area.
	(mark_splay_tree_node): New function.
	(mark_splay_tree): Likewise.
	* except.c (mark_eh_status): Only call lang_mark_false_label_stack
	if it exists.
	* ggc-callbacks.c (lang_mark_false_label_stack): Remove.
	* ggc-common.c (lang_mark_false_label_stack): Change type.
	* ggc.h (ggc_alloc_string): Add comment.
	(ggc_strdup): New function.

	* decl.c (lang_mark_false_label_stack): Remove.
	* lex.c (cp_mang_lang_type): Use ggc_alloc_cleared.

	* com.c (lang_mark_false_label_stack): Remove.

	Convert to GC.
	* Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
	* Makefile.in (BACKEND): Don't include ggc-callbacks.o.
	(typeck.o): Depend on ggc.h.
	* class.c (add_method_1): Use GC functions for allocation.
	(init_class_processing): Register roots.
	* decl.c (ggc_p): Set to 1.
	(pending_local_decls): Make it static.
	(push_jvm_slot): Use GC functions for allocation.
	(init_decl_processing): Register roots.
	(give_name_to_locals): Use GC functions for allocation.
	(lang_mark_tree): New function.
	* java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
	functions for allocation.
	* jcf-parse.c (jcf_parse_source): Use ggc_strdup.
	* lex.c (java_lex): Use build_string, rather than replicating it
	inline.
	* parse.y (goal): Add more roots.
	(mark_parser_ctxt): New function.
	* typeck.c: Include ggc.h.

	* splay-tree.c (splay_tree_insert): Fix formatting.

From-SVN: r36687
2000-10-01 19:19:30 +00:00
Mark Mitchell 8f17b5c5cb splay-tree.c (splay_tree_predecessor): Fix typo in comment.
* splay-tree.c (splay_tree_predecessor): Fix typo in comment.

	Convert the C front-end to use function-at-a-time mode.
	* c-common.h: Include splay-tree.h.
	(C_DECLARED_LABEL_FLAG): New macro.
	(struct language_function): Add x_scope_stmt_stack and
	x_function_name_declared_p.
	(RECHAIN_STMTS): Move definition.
	(lang_statment_code_p): Likewise.
	(lang_expand_stmt): Likewise.
	(lang_expand_decl_stmt): New variable.
	(lang_expand_function_end): Likewise.
	(current_scope_stmt_stack): New function.
	(add_decl_stmt): Likewise.
	(add_scope_stmt): Likewise.
	(mark_stmt_tree): Likewise.
	(struct c_lang_decl): New structure.
	(DECL_SAVED_TREE): Define.
	(c_mark_lang_decl): New function.
	(c_expand_start_cond): Change prototype.
	(c_finish_then): New function.
	(c_finish_else): Likewise.
	(current_function_name_declared): Remove.
	(set_current_function_name_declared): Likewise.
	(mark_c_language_function): Declare.
	(case_compare): Likewise.
	(c_add_case_label): Likewise.
	(c_expand_expr): Likewise.
	(c_safe_from_p): Likewise.
	* c-common.c (lang_expand_function_end): New variable.
	(struct if_elt): Add if_stmt.
	(c_expand_start_cond): Add the if-statement to the statement-tree,
	rather than generating RTL.
	(c_finish_then): New function.
	(c_expand_start_else): Don't generate RTL.
	(c_finish_else): New function.
	(c_expand_expr_stmt): Don't generate RTL.
	(statement_code_p): Add SCOPE_STMT.
	(case_compare): New function.
	(c_add_case_label): Likewise.
	(mark_stmt_tree): Likewise.
	(c_mark_lang_decl): Likewise.
	(mark_c_language_function): Likewise.
	(c_expand_expr): Likewise.
	(c_safe_from_p): Likewise.
	* c-decl.c (c_stmt_tree): New variable
	(c_scope_stmt_stack): Likewise.
	(c_function_name_declared_p): Likewise.
	(lang_expand_expr_stmt): Remove.
	(poplevel): Don't call output_inline_function for nested
	functions.
	(pushdecl): Don't set DECL_CONTEXT for a local declaration of an
	`extern' function.
	(redeclaration_error_message): Change means of computing whether
	or not a function is nested.
	(lookup_label): Don't call label_rtx.
	(init_decl_processing): Add more GC roots.
	(start_decl): Add DECL_STMTs to the statement-tree, rather than
	calling rest_of_decl_compilation.
	(finish_decl): Don't call expand_decl.
	(store_parm_decls): Begin the statement-tree, but don't generate
	RTL.
	(finish_function): Tie off the statement-tree.  Call c_expand_body
	if appropriate.
	(c_expand_body): New function.
	(push_c_function_context): Save more information.
	(pop_c_function_contxt): Likewise.
	(copy_lang_decl): Now that we use DECL_LANG_SPECIFIC, copy it.
	(lang_mark_tree): Mark it.
	(current_stmt_tree): Adjust.
	(current_scope_stmt_stack): New function.
	(do_case): Remove.
	(set_current_name_declared): Likewise.
	(c_begin_compound_stmt): Define.
	(c_expand_decl_stmt): Likewise.
	* c-lang.c: Include rtl.h and expr.h.
	(lang_init): Set more language-specific hooks.
	* c-lex.c: Include expr.h.
	* c-parse.in: Changes throughout to add statements to the
	statement-tree, rather than generating RTL after every statement.
	* c-semantics.c (lang_expand_decl_stmt): Define.
	(add_decl_stmt): New function.
	(add_scope_stmt): Likewise.
	(finish_stmt_tree): Tweak.
	(genrtl_expr_stmt): Likewise.
	(genrtl_decl_stmt): Handle local labels, and call
	lang_expand_decl_stmt if required.
	(genrtl_for_stmt): Fix line-number handling.
	(genrtl_case_label): Handle cleanups.
	(genrtl_asm_stmt): Don't call combine_strings.
	(genrtl_compound_stmt): Simplify.
	(expand_stmt): Handle SCOPE_STMTs.
	* c-tree.h (struct lang_decl): New structure.
	(C_DECLARED_LABEL_FLAG): Remove.
	(c_begin_compound_stmt): Declare.
	(c_expand_decl_stmt): Likewise.
	(c_expand_start_case): Rename to c_start_case.
	(c_finish_case): New function.
	* c-typeck.c (start_init): Tweak setting of
	constructor_incremental.
	(c_expand_asm_operands): Tweak error-handling.  Add to the
	statement-tree.
	(c_expand_return): Add to the statement-tree.
	(c_expand_start_case): Rename to ...
	(c_start_case): ... this.
	(struct c_switch): New type.
	(switch_stack): New variable.
	(do_case): Simplify.
	(c_finish_case): New function.
	* dependence.c: Include expr.h.
	(enum dependence_type): Change spelling of enumerals.
	(check_node_dependence): Adjust.
	* expr.h (lang_safe_from_p): Declare.
	(safe_from_p): Likewise.
	* expr.c (lang_safe_from_p): New variable.
	(safe_from_p): Give it external linkage.  Use lang_safe_from_p.
	* stmt.c (expand_expr_stmt): Avoid clobberring of last_expr_type.
	* toplev.c (rest_of_decl_compilation): Robustify.
	* tree.c (contains_placeholder_p): Likewise.
	* Makefile.in: Update dependencies.
	* objc/objc-act.h: Adjust calculation of value for dummy_tree_code.
	* objc/objc-act.c: Include rtl.h, expr.h, and c-common.h.
	(objc_expand_function_end): New function.
	(finish_method_def): Use it.
	(init_objc): Initialize more language-specific hooks.
	* objc/Make-lang.in: Update dependencies.

	* cp-tree.h (struct cp_language_function): Remove
	x_scope_stmt_stack and name_declared.
	(current_scope_stmt_stack): Remove.
	(function_name_declared_p): New macro.
	(struct lang_decl_flags): Use c_lang_decl as a base class.
	(context): Remove.
	(struct lang_decl): Replace saved_tree with context.
	(DECL_FRIEND_CONTEXT): Adjust accordingly.
	(SET_DECL_FRIEND_CONTEXT): Likewise.
	(DECL_VIRTUAL_CONTEXT): Likewise.
	(DECL_SAVED_TREE): Remove.
	(C_DECLARED_LABEL_FLAG): Likewise.
	(cplus_expand_expr_stmt): Don't declare.
	(add_decl_stmt): Likewise.
	(add_scope_stmt): Likewise.
	* decl.c (mark_stmt_tree): Remove.
	(case_compare): Likewise.
	(finish_case_label): Use c_add_case_label.
	(init_decl_processing): Set more language-specific hooks.
	(build_enumerator): Fix typo in comment.
	(cplus_expand_expr_stmt): Remove.
	(mark_lang_function): Use mark_c_language_function.
	(lang_mark_tree): Use c_mark_lang_decl.
	* decl2.c: Change order of inclusion.
	* except.c: Likewise.
	* expr.c (cplus_expand_expr): Remove handling of STMT_EXPR.  Fall
	back on c_expand_expr.
	* friend.c: Include expr.h.
	* init.c: Change order of inclusion.
	* Makefile.in: Update dependencies.
	* lex.h (free_lang_decl_chain): Remove.
	* optimize.c (maybe_clone_body): Use function_name_declared_p.
	* pt.c (build_template_decl): Don't copy DECL_VIRTUAL_CONTEXT if
	it doesn't exist.
	(instantiate_decl): Use function_name_declared_p.
	* semantics.c (lang_expand_expr_stmt): Remove.
	(set_current_function_name_declared): Likewise.
	(current_function_name_declared): Likewise.
	(begin_compound_stmt): Use function_name_declared_p.
	(add_decl_stmt): Remove.
	(setup_vtbl_ptr): Use function_name_declared_p.
	(add_scope_stmt): Remove.
	(current_scope_stmt_stack): New function.
	(cp_expand_stmt): Don't handle SCOPE_STMTs.
	(expand_body): Use function_name_declared_p.
	* tree.c (cp_statement_code_p): Don't include SCOPE_STMT.
	* typeck.c: Change order of includes.
	(convert_sequence): Remove.

From-SVN: r36464
2000-09-17 07:38:23 +00:00
Michael Sokolov 4eaa189a5c * splay-tree.c: #include <stdio.h>.
From-SVN: r36432
2000-09-15 11:16:14 -04:00
Mark Mitchell 2c9f4db73a splay-tree.h (splay_tree_predecessor): Declare.
* splay-tree.h (splay_tree_predecessor): Declare.

	* splay-tree.c (splay_tree_predecessor): New function.
	(splay_tree_successor): Likewise.

From-SVN: r36304
2000-09-10 21:28:21 +00:00
Richard Henderson dc17cc7bec * splay-tree.c (splay_tree_remove): New.
From-SVN: r32949
2000-04-05 17:13:50 -07:00
Mark Mitchell 08230f26ce splay-tree.h (struct splay_tree_node): Rename to ...
* splay-tree.h (struct splay_tree_node): Rename to ...
	(struct splay_tree_node_s): ... this.
	(struct splay_tree): Rename to ...
	(struct splay_tree_s): ... this.

	* splay-tree.c (splay_tree_new): Use struct splay_tree_node_s
	rather than struct splay_tree_node.
	(splay_tree_insert): Use struct splay_tree_s rather than struct
	splay_tree.

From-SVN: r30790
1999-12-05 18:13:48 +00:00
Mark Mitchell d080bbfa45 * splay-tree.h (splay_tree_insert): Return the new node.
From-SVN: r28389
1999-08-02 05:54:50 +00:00
Ian Lance Taylor 652374d338 splay-tree.c (splay_tree_insert): Add initialization to avoid warning.
* splay-tree.c (splay_tree_insert): Add initialization to avoid
        warning.

From-SVN: r28269
1999-07-26 11:57:25 -06:00
Mark Mitchell ae7f727035 splay-tree.h (splay_tree_compare_pointers): Declare.
1999-04-02  Mark Mitchell  <mark@codesourcery.com>
	* splay-tree.h (splay_tree_compare_pointers): Declare.
1999-04-02  Mark Mitchell  <mark@codesourcery.com>
	* splay-tree.h (splay_tree_compare_pointers): Define.

From-SVN: r26132
1999-04-02 15:18:06 +00:00
Mark Mitchell 30f7237966 alias.c (alias_set_compare): Remove.
* alias.c (alias_set_compare): Remove.
	(record_alias_subset): Use splay_tree_compare_ints instaed of
	alias_set_compare.
	(init_alias_once): Likewise.
	* cse.c: Include splay-tree.h.
	(reg_qty): Remove.
	(reg_tick): Likewise.
	(reg_table): Likewise.
	(cse_reg_info): New structure.
	(cse_reg_info_free_list): New variable.
	(cse_reg_info_tree): Likewise.
	(cached_regno): Likewise.
	(cached_cse_reg_info): Likewise.
	(all_minus_one): Remove.
	(consec_ints): Likewise.
	(GET_CSE_REG_INFO): New macro.
	(REG_TICK): Likewise.  Use throughout instead of reg_tick.
	(REG_IN_TABLE): Likewise.  Use throughout instead of reg_in_table.
	(REG_QTY): Likewise.  Use throughout instead of reg_qty.
	(get_cse_reg_info): New function.
	(free_cse_reg_info): Likewise.
	(new_basic_block): Reinitialize cse_reg_info_tree instead of
	reg_tick, all_minus_one, and consec_ints.
	* Makefile.in (cse.o): Depend on splay-tree.h
	* splay-tree.h (splay_tree_compare_ints): Declare.
	* splay-tree.c (splay_tree_compare_ints): Define.

From-SVN: r26069
1999-03-30 20:52:33 +00:00
Jeff Law 0cd4357773 More address fixes
From-SVN: r24644
1999-01-12 12:09:02 -07:00
Jeff Law 2892309926 More address fixes.
From-SVN: r24618
1999-01-11 07:06:22 -07:00
Kaveh R. Ghazi 11a0bb74cd choose-temp.c: Don't check IN_GCC anymore.
* choose-temp.c: Don't check IN_GCC anymore.
        * floatformat.c (floatformat_from_double): Use `const', not `CONST'.
        * memchr.c (memchr): Likewise.
        * memcpy.c (memcpy): Likewise.
        * memmove.c (memmove): Likewise.
        * mkstemp.c: Don't check IN_GCC anymore.
        * pexecute.c: Likewise.
        * splay-tree.c: Likewise.
        * strchr.c (strchr): Use `const', not `CONST'.
        * strrchr.c (strrchr): Likewise.
        * strtol.c (strtol): Likewise.
        * strtoul.c (strtoul): Likewise.

From-SVN: r24307
1998-12-14 07:01:03 +00:00
Kaveh R. Ghazi 9b1a92d882 choose-temp.c: Always include libiberty.h.
* choose-temp.c: Always include libiberty.h.  Avoid redundancies.
        * cplus-dem.c: Likewise.  Conform to libiberty.h.
        * pexecute.c: Likewise.
        * splay-tree.c: Likewise.

From-SVN: r23935
1998-11-27 10:28:57 +00:00
Mark Mitchell ad3ef78e25 splay-tree.c: Tweak include directives to make sure declarations of xmalloc and free are...
* splay-tree.c: Tweak include directives to make sure declarations of
	xmalloc and free are available.

From-SVN: r23358
1998-10-26 23:24:48 +00:00
Kaveh R. Ghazi b056ad1c68 splay-tree.c (splay_tree_foreach_helper): Make definition static to match prototype.
* splay-tree.c (splay_tree_foreach_helper): Make definition static
        to match prototype.

From-SVN: r23230
1998-10-22 17:00:43 +00:00
Mark Mitchell ed87f9c827 splay-tree.c: New file.
* splay-tree.c: New file.
	* Makefile.in (CFILES): Add it.
	(REQUIRED_OFILES): Likewise.
	(splay-tree.o): Add dependencies.

From-SVN: r23210
1998-10-21 09:19:13 +00:00