Commit Graph

22 Commits

Author SHA1 Message Date
Mark Mitchell 46e8c075d0 Make-lang.in (CXX_SRCS): Add optimize.c.
1999-11-25  Mark Mitchell  <mark@codesourcery.com>

	* Make-lang.in (CXX_SRCS): Add optimize.c.
	* Makefile.in (CXX_OBJS): Add optimize.o.
	(CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
	(spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
	(class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
	(search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
	(xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
	(dump.o): Likewise.
	(optimize.o): New target.
	* class.c: Don't include splay-tree.h.
	* cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
	* cp-tree.h: Include splay-tree.h.
	(DECL_UNINLINABLE): New macro.
	(CTOR_BEGIN_P, CTOR_END_P): New macros.
	(flag_inline_trees): New variable.
	(local_variable_p): New function.
	(nonstatic_local_decl_p): Likewise.
	(optimize_function): Likewise.
	(cplus_unsave_expr_now): Remove.
	(copy_tree_r): Declare.
	(remap_save_expr): Likewise.
	* decl.c (local_variable_p): Don't
	make it static.
	(local_variable_p_walkfn): New function.
	(make_rtl_for_local_static): Remove code to try to avoid writing
	out static constants.
	(emit_local_var): Fix indentation.
	(nonstatic_local_decl_p): New function.
	(check_default_argument): Use local_variable_p_walkfn, not
	local_variable_p, when walking the tree.
	(start_function): Set the DECL_CONTEXT for automatically generated
	labels.
	(finish_constructor_body): Use CTOR_STMT to mark the end of a
	constructor.
	* decl2.c: Don't include splay-tree.h.
	(flag_inline_trees): Define.
	* dump.c: Don't include
	splay-tree.h.
	* except.c (expand_end_catch_block): Fix comment formatting.
	(expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
	(expand_throw): Tidy comment.
	* init.c (build_vec_delete_1): Use create_temporary_var.
	* lex.c (cplus_tree_code_type): Make it static.
	(cplus_tree_code_length): Likewise.
	(cplus_tree_code_name): Likewise.
	* optimize.c: New file.
	* semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
	with computed gotos.
	(setup_vtbl_ptr): Mark the beginnings of constructors with
	CTOR_STMT.
	(expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
	(expand_body): Call optimize_function.  Save bodies if we're doing
	inlining on trees.
	* tree.c: Don't include splay-tree.h.  Include insn-config.h and
	integrate.h.
	(copy_tree_r): Make it public.
	(statement_code_p): New function.
	(mark_local_for_remap_r): Likewise.
	(cp_usave_r): Likewise.
	(cp_unsave): Likewise.
	(build_cplus_new): Set DECL_CONTEXT for temporary variables.
	(walk_tree): Walk into `s' class nodes.  Walk statement chains.
	(copy_tree_r): Handle 's' class nodes.  Restore chains for
	statements.  Nullify scopes.  Don't copy types.
	(init_tree): Set lang_unsave to cp_unsave.
	(remap_save_expr): Define.
	* ir.texi: Document CTOR_STMT.

From-SVN: r30669
1999-11-25 20:32:04 +00:00
Mark Mitchell 083eb5756f cp-tree.def (CTOR_COMPLETE): New tree node.
* cp-tree.def (CTOR_COMPLETE): New tree node.
	(finish_constructor_body): Add it, to mark the end of the
	constructor.
	(finish_function): Don't call end_protect_partials here.
	* ir.texi (CTOR_COMPLETE): Document it.
	* semantics.c (expand_stmt): Handle it.

From-SVN: r30630
1999-11-23 07:31:07 +00:00
Mark Mitchell a2edce31a6 dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs.
* dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs.  Dump
	CLEANUP_P for a TRY_BLOCK.
	* ir.texi: Document SAVE_EXPR.

From-SVN: r30218
1999-10-27 18:19:17 +00:00
Mark Mitchell 699ed0ce1f cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
* cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
	* call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
	* expr.c (cplus_expand_expr): Expand it.
	* ir.texi: Document EMPTY_CLASS_EXPR.

From-SVN: r30116
1999-10-21 07:10:36 +00:00
Mark Mitchell 7192e1387b dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR.
* dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR.

	* ir.texi: Clean up documentation of RETURN_INIT.

From-SVN: r30056
1999-10-17 17:40:12 +00:00
Mark Mitchell f8191e640d pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch paramter.
* pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
	paramter.

	* semantics.c (expand_stmt): Don't pretend to have asmspecs for
	local statics if we don't really have them.

	* ir.texi: Improve documentation for STMT_EXPR.  Describe
	CLEANUP_POINT_EXPR.

From-SVN: r29863
1999-10-08 05:42:36 +00:00
Mark Mitchell d3a3fb6add cp-tree.h (CLASSTYPE_VFIELD): Remove.
* cp-tree.h (CLASSTYPE_VFIELD): Remove.
	* call.c (build_vfield_ref): Use TYPE_VFIELD, not
	CLASSTYPE_VFIELD.
	* class.c (get_vfield_offset): Likewise.
	(finish_base_struct): Likewise.
	(modify_one_vtable): Likewise.
	(fixup_vtable_deltas): Likewise.
	(finish_struct_1): Likewise.
	* init.c (expand_virtual_init): Likewise.
	* search.c (lookup_field_1): Likewise.
	(expand_upcast_fixups): Likewise.
	* typeck.c (build_component_ref): Likewise.
	(build_binary_op_nodefault): Likewise.

	* dump.c (dqueue_and_dump): Dump TYPE_VFIELD.
	* ir.texi: Document TYPE_VFIELD.

From-SVN: r29843
1999-10-06 19:01:44 +00:00
Mark Mitchell 3651fb44bb ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
* ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
	* dump.c (dequeue_and_dump): Dump them.

From-SVN: r29835
1999-10-05 23:59:27 +00:00
Mark Mitchell cd6642cbec * ir.texi: Document LOOP_EXPR and EXIT_EXPR.
From-SVN: r29834
1999-10-05 23:40:00 +00:00
Mark Mitchell 807625cf45 tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for bitfields, rather than DECL_BIT_FIELD.
* tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
	bitfields, rather than DECL_BIT_FIELD.
	* ir.texi: Document how to tell whether or not a field is a
	bitfield.

	* lex.c (make_lang_type): Fix typo in comment.

From-SVN: r29781
1999-10-03 16:04:30 +00:00
Mark Mitchell af3b4e599c cp-tree.h (lang_decl_flags): Add global_ctor_p and global_dtor_p.
* cp-tree.h (lang_decl_flags): Add global_ctor_p and
	global_dtor_p.  Add init_priority.
	(DECL_ACCESS): Adjust accordingly.
	(DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros.
	(GLOBAL_INIT_PRIORITY): Likewise.
	* decl.c (lang_mark_tree): Adjust accordingly.
	(start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P,
	and GLOBAL_INIT_PRIORITY.
	* dump.c (dequeue_and_dump): Print them.
	* ir.texi: Document them.

From-SVN: r29733
1999-09-30 17:43:44 +00:00
Mark Mitchell 3bc6a13bb6 dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
* dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
	* ir.texi: Document DECL_EXTERNAL.

From-SVN: r29710
1999-09-29 20:07:56 +00:00
Mark Mitchell e9e7f18109 dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
* dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
	* ir.texi: Document THUNK_DECLs.

From-SVN: r29709
1999-09-29 19:00:46 +00:00
Mark Mitchell 2f53bab57a * ir.texi: Improve documentation for TARGET_EXPR.
From-SVN: r29688
1999-09-28 07:40:15 +00:00
Mark Mitchell 59ccf49da3 cp-tree.h (expand_throw): Remove prototype.
* cp-tree.h (expand_throw): Remove prototype.
	* except.c (expand_throw): Make it static.  Use tree-generation
	functions, rather than RTL-generation functions.
	(build_throw): Use it.
	* expr.c: Include except.h.
	(cplus_expand_expr): Don't call expand_throw here.
	* Makefile.in (expr.o): Depend on except.h.
	* ir.texi: Update documentation for THROW_EXPR.

	* decl.c (start_function): Set x_dont_save_pending_sizes rather
	than calling get_pending_sizes.
	* init.c (build_new): Don't save and restore
	immediate_size_expand; instead, assert that it has the expected
	value already.

From-SVN: r29671
1999-09-27 01:27:18 +00:00
Mark Mitchell 57151693bc dump.c (dequeue_and_dump): Handle RESULT_DECL.
* dump.c (dequeue_and_dump): Handle RESULT_DECL.
	* ir.texi: Document RESULT_DECL and DECL_RESULT.

From-SVN: r29664
1999-09-25 18:16:08 +00:00
Mark Mitchell 8d54f0f03b ir.texi: Improve documentation for TARGET_EXPRs.
* ir.texi: Improve documentation for TARGET_EXPRs.  Discuss
	STMT_IS_FULL_EXPR_P.

From-SVN: r29647
1999-09-24 01:43:49 +00:00
Martin v. Löwis 7369be0af4 * ir.texi: Fix formatting errors and typos.
From-SVN: r29617
1999-09-23 13:55:27 +00:00
Mark Mitchell 203a051fdd * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT.
From-SVN: r29610
1999-09-23 02:10:55 +00:00
Mark Mitchell bce9471e0c cp-tree.h (finish_stmt_expr): Change prototype.
* cp-tree.h (finish_stmt_expr): Change prototype.
	* expr.c (cplus_expand_expr): Adjust call accordingly.
	* init.c (finish_init_stmts): Likewise.
	* parse.y (primary): Likewise.
	* pt.c (tsubst_copy): Likewise.
	* semantics.c (finish_stmt_expr): Don't take two parameters.
	Don't remove generated BLOCKs from the block-tree.

From-SVN: r29537
1999-09-21 07:41:01 +00:00
Mark Mitchell 9bfadf57a2 Remove support for assigning to `this'.
* NEWS: Note that fact.
	* class.c (build_vbase_path): Don't check flag_this_is_variable.
	* cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove.
	(language_function): Remove assigns_this, just_assigned_this, and
	x_base_init_expr.  Add x_vcalls_possible_p.  Add vtbls_set_up_p.
	(base_init_expr): Remove.
	(current_vcalls_possible_p): New macro.
	(vtbls_set_up_p): Likewise.
	(emit_base_init): Change prototype.
	* decl.c (finish_destructor_body): New function, split out from
	finish_function.
	(current_function_assigns_this): Remove.
	(current_function_just_assigned_this): Likewise.
	(start_function): Don't set them.
	(finish_function): Don't check them.  Don't emit
	base-initialization code here.  Generate code for destructors when
	doing semantic analysis.
	(finish_stmt): Don't check current_function_just_assigned_this.
	* decl2.c (lang_f_options): Remove this-is-variable.
	(lang_decode_option): Likewise.
	(grokclassfn): Don't check flag_this_is_variable.
	* init.c (emit_base_init): Return the expression generated.
	(construct_virtual_bases): Don't push/pop obstacks.  Fix
	typo.
	(build_new_1): Don't check flag_this_is_variable.
	(get_temp_regvar): Don't set DECL_REGISTER.
	(build_vec_init): Don't call use_variable.
	* lang-options.h: Remove "-fthis-is-variable" and
	"-fno-this-is-variable".
	* pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS.
	* search.c (expand_upcast_fixups): Use finish_expr_stmt, not
	expand_expr_stmt.
	* semantics.c (finish_expr_stmt_real): Rename to ...
	(finish_expr_stmt): This.  Remove assigned_this parameter.
	(begin_if_stmt): Call do_pushlevel before starting the statement.
	(begin_compound_stmt): Don't declare __FUNCTION__ in scope-less
	blocks.
	(setup_vtbl_ptr): Emit initialization code for bases and members
	at semantic-analysis time.  Emit code to initialize vtables in
	destructors here.
	(expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real.
	Don't handle CTOR_INITIALIZER any more.
	* typeck.c (build_modify_expr): Don't check for assignments to
	this.
	(c_expand_return): Don't suggest assigning to `this'.

	* Makefile.in (decl.o): Depend on RTL_H.
	(decl2.o): Likewise.
	(class.o): Likewise.
	(call.o): Likewise.
	(method.o): Likewise.
	(search.o): Likewise.
	(tree.o): Likewise.
	(pt.o): Likewise.

	* decl.c (duplicate_decls): When a builtin function is redeclared
	as static, make sure it is mangled correctly.

	* ir.texi (CTOR_INITIALIZER): Remove mention.  Fix typo.  Add
	detail about the statement-tree.

From-SVN: r29531
1999-09-20 20:19:04 +00:00
Mark Mitchell 47d7090eeb * ir.texi: New file.
From-SVN: r29508
1999-09-19 15:50:40 +00:00