Commit Graph

107 Commits

Author SHA1 Message Date
Mark Mitchell
447cfcb9e1 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: r29533
1999-09-20 21:26:06 +00:00
Mark Mitchell
b35d4555e6 Turn on function-at-a-time processing.
* cp-tree.h (doing_semantic_analysis_p): New macro.
	(SF_DEFAULT): Define to zero, not SF_EXPAND.
	(start_handler_parms): Change prototype.
	(expand_start_catch_block): Likewise.
	(expand_end_catch_block): Likewise.
	(expand_start_eh_spec): Likewise.
	(expand_end_eh_spec): Declare.
	(finish_handler_parms): Change prototype.
	(begin_catch_block): Declare.
	(finish_handler): Change prototype.
	(do_pushlevel): Declare.
	(do_poplevel): Likewise.
	* decl.c (pushlevel): Don't create
	binding levels when not doing semantic analysis.
	(poplevel): Don't pop them.
	(pushdecl): Assert that we are never called when not doing
	semantic analysis.
	(pushdecl_top_level): Use push_to_top_level.
	(make_label_decl): Don't fiddle with obstacks.  Make RTL For the
	label when expanding.
	(cp_finish_decl): Only inject for-scope variables when doing
	semantic analysis.  Add comments.
	(start_handler_parms): Return the handler parm.
	(start_function): Reorganize.  Don't clear DECL_INITIAL if it is
	already set.  Reinitialize from saved function data if available.
	Don't pushlevel when not doing semantic analysis.
	(store_parm_decls): Only generate RTL when expanding.  Only
	pushdecl when doing semantic analysis.  Set
	current_eh_spec_try_block if appropriate.
	(finish_function): Simplify.  Use do_pushlevel and do_poplevel.
	Combine common code.  Don't poplevel when not doing semantic
	analysis.
	(push_cp_function_context): Don't expand functions without an
	explicit call to expand_body.
	(mark_lang_function): Make eh_spec_try_block and
	x_scope_stmt_stack.
	* except.c (expand_end_eh_spec): Don't
	declare.
	(process_start_catch_block): Likewise.
	(push_eh_cleanup): Use finish_decl_cleanup.
	(initialize_handler_parm): New function.
	(expand_start_catch_block): Use it.
	(expand_end_catch_block): Use tree-generation functions, not
	RTL-generation functions.
	(expand_start_eh_spec): Likewise.
	(expand_end_eh_spec): Likewise.
	(expand_exception_blocks): Simplify.
	(start_anon_func): Use do_pushlevel.
	(end_anon_func): Use do_poplvel.  Call expand_body for the
	function.
	* expr.c (do_case): Don't call define_case_label.
	* init.c (create_temporary_var): Set DECL_CONTEXT for local
	variables.
	* method.c (emit_thunk): Call expand_body for the
	thunk.
	(sythesize_method): Likewise.
	* parse.y (handler_args): Give it ttype.
	(eat_saved_input): Call expand_body.
	(base_init): Use do_pushlevel.
	(pending_inline): Call expand_body.
	(handler): Adjust calls to finish_handler_parms and
	finish_handler.
	(handler_args): Don't call expand_start_catch_block.  Return the
	catch parameter.  * pt.c (tsubst_expr): Adjust HANDLER handling.
	* parse.c: Regenerated.
	* rtti.c (synthesize_tinfo_fn): Call finish_function.
	* semantics.c (do_pushlevel): Give it external linkage.  Build
	SCOPE_STMTs.
	(do_poplevel): Likewise.
	(finish_case_label): Call define_case_label when doing semantic
	analysis.
	(finish_goto_stmt): Create RTL for labels.
	(finish_function_try_block): Set in_function_try_handler
	unconditionally.
	(finish_function_handler_sequence): Unset it.
	(finish_handler_parms): Use expand_start_catch_block even when
	building a statement-tree.
	(begin_catch_block): New function.
	(finish_handler): Move a little RTL-generation logic here.
	(finish_decl_cleanup): Allow cleanups for empty declarations.
	(finish_named_return_value): Don't pushdecl when not doing
	semantic analysis.
	(expand_stmt): Don't do semantic analysis for variable
	declarations.  Handle START_CATCH_STMT.  Call expand_label
	directly for a LABEL_STMT.  Tweak handling of GOTO_STMT.  Adjust
	HANDLERs.  Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT.
	(expand_body): Let expand_stmt handle CTOR_INITIALIZER,
	RETURN_INIT and function try blocks.

From-SVN: r29490
1999-09-18 01:23:20 +00:00
Mark Mitchell
5868eb4e0a 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
1999-09-12 02:45:30 +00:00
Mark Mitchell
e1b3e07d15 cp-tree.h (scratch_tree_cons): Remove.
* cp-tree.h (scratch_tree_cons): Remove.
	* call.c: Replace all uses of expr_tree_cons, saveable_tree_cons,
	and perm_tree_cons with plain tree_cons.
	* class.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* init.c: Likewise.
	* lex.c: Likewise.
	* method.c: Likewise.
	* parse.y: Likewise.
	* pt.c: Likewise.
	* repo.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.
	* typeck.c: Likewise.
	* parse.c: Regenerated.
	* tree.c (build_srcloc): Simplify.

From-SVN: r29225
1999-09-09 06:17:13 +00:00
Mark Mitchell
e1376b008f cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.
* cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.
	* tree.c (build_cplus_new): Set it.
	* expr.c (cplus_expand_expr): Use it.

From-SVN: r28915
1999-08-27 04:58:19 +00:00
Mark Mitchell
f1dedc319f cp-tree.def (SUBOBJECT): New tree node.
* cp-tree.def (SUBOBJECT): New tree node.
	* cp-tree.h (CLEANUP_P): New macro.
	(SUBOBJECT_CLEANUP): Likewise.
	(keep_next_level): Add parameter.
	(get_temp_regvar): Don't declare.
	(emit_base_init): Remove parameter.
	(expand_aggr_init): Rename to build_aggr_init.
	(expand_vec_init): Rename to build_vec_init.
	(do_pushlevel): Remove.
	(do_poplevel): Likewise.
	(finish_cleanup): New function.
	(finish_subobject): Likewise.
	(stmts_are_full_exprs_p): New variable.
	* decl.c (keep_next_level): Add parameter.
	(cp_finish_decl): Use build_aggr_init, not
	expand_aggr_init.  Use finish_expr_stmt to expand the code.
	(expand_static_init): Use tree-generating, not RTL-generating,
	functions to handle the initialization.
	(start_function): Remove dead code.  Always have a momentary
	obstack inside the function, even before hitting the first curly
	brace.
	(cplus_expand_expr_stmt): Move calls to
	expand_{start,end}_target_temps into semantics.c.
	(cp_function): Add stmts_are_full_exprs_p.
	(push_cp_function_context): Save it.
	(pop_cp_function_context): Restore it.
	* decl2.c (get_temp_regvar): Move to init.c.
	(do_static_initialization): Use build_{aggr,vec}_init.
	(do_static_destruction): Fix typo in comment.
	* dump.c (dequeue_and_dump): Handle INIT_EXPR.
	* except.c (expand_throw): Use create_temporary_var.
	* expr.c (cplus_expand_expr): Use build_{aggr,vec}_init.
	* init.c (expand_vec_init_try_block): Remove.
	(expand_vec_init_catch_clause): Likewise.
	(get_temp_regvar): New function.
	(begin_init_stmts): Likewise.
	(finish_init_stmts): Likewise.
	(perform_member_init): Use build_{aggr,vec}_init.  Build up tree
	structure here.
	(emit_base_init): Likewise.  Remove unused parameter.
	(expand_virtual_init): Likewise.
	(expand_cleanup_for_base): Use finish_subobject.
	(expand_aggr_vbase_init_1): Simplify.
	(construct_virtual_bases): Use tree-generating functions to build
	up initialization.
	(expand_aggr_init): Likewise.  Rename to build_aggr_init.
	(expand_default_init): Likewise.
	(expand_aggr_init_1): Likewise.
	(expand_vec_init): Rename to build_vec_init.
	* method.c (do_build_copy_constructor): Use tree-generating
	functions.  Don't call clear_last_expr.
	(do_build_assign_ref): Likewise.
	(synthesize_method): Call clear_last_expr here.
	* parse.y (base_init): Don't call clear_last_expr here.
	(nodecls): Likewise.
	* pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set.
	* semantics.c (do_pushlevel): Move to here.
	(do_poplevel): Likewise.
	(stmts_are_full_exprs_p): New variable.
	(finish_expr_stmt): Handle logic for temoprary cleanup here.
	(finish_for_stmt): Use finish_expr_stmt.
	(finish_cleanup): New function.
	(finish_function_try_block): Fix indentation.
	(finish_subobject): New function.
	(setup_vtbl_ptr): Call keep_next_level here.
	(finish_stmt_expr): Handle a block with no scope inside the
	statement-expression.
	(expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set.  Handle
	SUBOBJECT.
	* tree.c (search_tree): Handle INIT_EXPR.
	(mapcar): Likewise.
	* typeck.c (build_modify_expr): Don't build an RTL_EXPR.
	* typeck2.c (store_init_value): Change expand_aggr_init to
	build_aggr_init in comment.

From-SVN: r28878
1999-08-25 22:07:18 +00:00
Mark Mitchell
558475f07c cp-tree.def (STMT_EXPR): New tree node.
* cp-tree.def (STMT_EXPR): New tree node.
	* cp-tree.h (STMT_EXPR_STMT): New macro.
	(store_return_init): Change prototype.
	(finish_named_return_value): New function.
	(expand_stmt): Likewise.
	(expand_body): Likewise.
	(begin_stmt_tree): Likewise.
	(finish_stmt_tree): Likewise.
	(expanding_p): New variable.
	(last_expr_type): Likewise.
	(building_stmt_tree): New macro.
	* decl.c (start_function): Use building_stmt_tree, not
	processing_template_decl, where appropriate.
	(store_parm_decls): Likewise.
	(store_return_init): Move most of the body to semantics.c.
	(finish_function): Use building_stmt_tree.
	(finish_stmt): Clear last_expr_type here.
	(cp_function): Add expanding_p, last_tree, last_expr_type.
	(push_cp_function_context): Save them.
	(pop_cp_function_context): Restore them.
	* decl2.c (setup_vtbl_ptr): Move to semantics.c.
	* error.c (dump_expr): Handle STMT_EXPR.
	* except.c (expand_start_catch_block): Use building_stmt_tree.
	Use add_decl_stmt.
	* expr.c (cplus_expand_expr): Handle STMT_EXPR.
	(do_case): Move add_tree call to semantics.c.
	* parse.y (return_init): Use finish_named_return_value.
	(for.init.statement): Use finish_expr_stmt.
	* parse.c: Regenerated.
	* pt.c (do_pushlevel): Move to semantics.c.
	(do_poplevel): Likewise.
	(tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR.
	(tsubst_expr): Don't expand all the way to RTL here.  Handle
	RETURN_INIT and CTOR_INITIALIZER.
	(instantiate_decl): Call expand_body after tsubst'ing into
	DECL_SAVED_TREE.
	* semantics.c (expand_stmts): New function.
	(expanding_p): New variable.
	(last_expr_type): Likewise.
	(finish_expr_stmt): Use building_stmt_tree.
	(begin_if_stmt): Likewise.
	(finish_if_stmt_cond): Likewise.
	(finish_then_clause): Likewise.
	(begin_else_clause): Likewise.
	(finish_else_clause): Likewise.
	(begin_while_stmt): Likewise.
	(finish_while_stmt_cond): Likewise.
	(finish_while_stmt): Likewise.
	(finish_do_body): Likewise.
	(finish_do_stmt): Likewise.
	(finish_return_stmt): Likewise.
	(begin_for_stmt): Likewise.
	(fnish_for_init_stmt): Likewise.
	(finish_for_cond): Likewise.
	(finish_for_expr): Likewise.
	(finish_for_stmt): Likewise.
	(finish_break_stmt): Likewise.
	(finish_continue_stmt): Likewise.
	(finish_switch_cond): Likewise.
	(finish_switch_stmt): Likewise.
	(finish_case_label): Call add_tree here if necessary.
	(finish_goto_statement): Use building_stmt_tree.
	(begin_try_block): Likewise.
	(begin_function_try_block): Likewise.
	(finish_try_block): Likewise.
	(finish_function_try_block): Likewise.
	(finish_handler_sequence): Likewise.
	(finish_function_handler_sequence): Likewise.
	(begin_handler): Likewise.
	(finish_handler_parms): Likewise.
	(finish_handler): Likewise.
	(begin_compound_stmt): Likewise.
	(finish_compound_stmt): Likewise.
	(finish_asm_stmt): Likewise.
	(finish_label_stmt): Likewise.
	(finish_named_return_value): New function.
	(setup_vtbl_ptr): Moved here from decl2.c.
	(do_pushlevel): Moved here from pt.c.
	(do_poplevel): Likewise.
	(begin_stmt_expr): Use building_stmt_tree.
	(finish_stmt_expr): Likewise.  Build a STMT_EXPR, not a BIND_EXPR,
	when building_stmt_tree.
	(begin_stmt_tree): New function.
	(finish_stmt_tree): Likewise.
	(expand_stmt): Likewise.
	(expand_body): Likewise.
	* tree.c (build_cplus_method_type): Make sure the argument types
	end up on the same obstack as the METHOD_TYPE.
	(search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR,
	THROW_EXPR, STMT_EXPR.
	(mapcar): Break out common cases.  Handle COMPOUND_EXPR,
	MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR.  Abort, rather than
	sorry, if an unsupported node is encountered.
	* typeck.c (require_complete_type_in_void): Handle BIND_EXPR.
	(c_expand_return): Don't call add_tree here.

From-SVN: r28729
1999-08-16 19:01:36 +00:00
Mark Mitchell
b928a6517e cp-tree.h (cplus_expand_constant): Declare.
* cp-tree.h (cplus_expand_constant): Declare.
	* cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're
	converted from one pointer-to-object type to another.
	* expr.c (cplus_expand_constant): Don't make it static.
	* typeck.c (build_component_ref): Don't crash when presented with
	a component which is a TEMPLATE_DECL.
	(build_ptrmemfunc): Tidy.  Clarify comment.  Make sure that even a
	cast from a pointer-to-member constant to its own type does not
	result in a valid non-type template argument.

From-SVN: r27092
1999-05-22 01:30:11 +00:00
Mark Mitchell
87533b37c7 cp-tree.h (make_ptrmem_cst): New function.
* cp-tree.h (make_ptrmem_cst): New function.
	* expr.c (cplus_expand_constant): Split out from ...
	(cplus_expand_expr): Here.  Use cplus_expand_constant.
	(init_cplus_expand): Set lang_expand_constant.
	* pt.c (convert_nontype_argument): Use make_ptrmem_cst.
	* tree.c (make_ptrmem_cst): Define.
	* typeck.c (unary_complex_lvalue): Use make_ptrmem_cst.
	* typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst.

From-SVN: r27060
1999-05-20 10:44:47 +00:00
Mark Mitchell
337c90cc04 cp-tree.h (build_binary_op): Remove unneeded parameter.
* cp-tree.h (build_binary_op): Remove unneeded parameter.
	* class.c (build_vrable_entry_ref): Adjust call to
	build_binary_op.
	* decl.c (expand_static_init): Likewise.
	(grokdeclarator): Likewise.
	(finish_function): Likewise.
	* decl2.c (delete_sanity): Likewise.
	(do_dtors): Likewise.
	(do_ctors): Likewise.
	* error.c (dump_type_suffix): Likewise.
	* expr.c (cplus_expand_expr): Likewise.
	* init.c (resolve_offset_ref): Likewise.
	(build_new): Likewise.
	(build_new_1): Likewise.
	(build_vec_delete_1): Likewise.
	(expand_vec_init_catch_clause): Likewise.
	(build_delete): Likewise.
	* pt.c (tsubst): Likewise.
	* rtti.c (synthesize_tinfo_fn): Likewise.
	* search.c (expand_upcast_fixups): Likewise.
	(expand_direct_vtbls_init): Likewise.
	* typeck.c (get_member_function_from_ptrfunc): Likewise.
	(build_binary_op_nodefault): Likewise.
	(point_int_sum): Likewise.
	(pointer_diff): Likewise.
	(build_unary_op): Likewise.
	(build_modify_expr): Likewise.
	(get_delta_difference): Likewise.
	(build_ptrmemfunc): Likewise.
	(expand_ptrmemfunc_cst): Likewise.

From-SVN: r26566
1999-04-20 21:48:52 +00:00
Mark Mitchell
e08a8f45f5 cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
* cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
	Document internals of pointer-to-member-functions.
	(DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc.
	(PFN_FROM_PTRMEMFUNC): Similarly.
	(build_type_conversion): Remove unused parameter.
	(build_ptrmemfunc1): Declare.
	(expand_ptrmemfunc_cst): New function.
	(delta2_from_ptrmemfunc): Likewise.
	(pfn_from_ptrmemfunc): Likewise.
	* cvt.c (cp_convert_to_pointer): Remove unused parameter to
	build_type_conversion.  Use TYPE_PTRMEM_P for readability.
	(convert_to_reference): Remove unused parameter to
	build_type_conversion.
	(ocp_convert): Likewise.
	(build_user_type_conversion): Likewise.
	* error.c (dump_expr): Handle NULL pointer-to-member functions.
	* expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions.
	* method.c (build_overload_value): Don't go splitting CONSTRUCTORs
	open when handling pointer-to-member functions.
	* pt.c (convert_nontype_argument): Clean up error messages.  Be
	more stringent with pointers-to-members.
	* typeck.c (build_ptrmemfunc1): Don't declare.  Make it global.
	(build_unary_op): Tidy ever-so-slightly.
	(build_conditional_expr): Remove extra parameter to
	build_type_conversion.
	(build_ptrmemfunc): Build PTRMEM_CSTs if we know what function
	we're using.
	(expand_ptrmemfunc_cst): Define.
	(delta2_from_ptrmemfunc): Likewise.
	(pfn_from_ptrmemfunc): Likewise.

From-SVN: r25913
1999-03-23 00:01:48 +00:00
Jason Merrill
0b5be8972f update copyrights
From-SVN: r23764
1998-11-22 22:12:41 -05:00
Mark Mitchell
61a127b3d1 cp-tree.def (PTRMEM_CST): New tree node.
* cp-tree.def (PTRMEM_CST): New tree node.
	* cp-tree.h (ptrmem_cst): New type.
	(lang_type): Remove local_typedecls.
	(dummy): Increase to 12 bits from 11.
	(CLASSTYPE_LOCAL_TYPEDECLS): Remove.
	(PTRMEM_CST_CLASS): New macro.
	(PTRMEM_CST_MEMBER): Likewise.
	(current_access_specifier): New variable.
	(current_class_type): Remove duplicate declaration.
	(finish_struct): Change prototype.
	(unreverse_member_declarations): New function.
	(pushdecl_class_level): Change prototype.
	(grok_enum_decls): Remove.
	(fixup_anonymous_union): New function.
	(grok_x_components): Change prototype.
	(tsubst_chain): Remove.
	(finish_member_template_decl): Likewise.
	(check_explicit_specialization): Fix indentation.
	(finish_class_definition): Change prototype.
	(finish_member_class_template): Likewise.
	(finish_member_declaration): New function.
	(check_multiple_declarators): Likewise.
	* class.c (class_stack_node_t): New type.
	(current_class_base): Remove.
	(current_class_stack): Change type.
	(current_access_specifier): New variable.
	(grow_method): Remove.
	(check_member_decl_is_same_in_complete_scope): Break out from
	finish_struct.
	(make_method_vec): New function.
	(free_method_vec): Likewise.
	(add_implicitly_declared_members): Break out from finish_struct_1.
	(free_method_vecs): New variable.
	(add_method): Rework for direct use from parser.
	(handle_using_decl): Watch for NULL_TREE while iterating through
	CLASSTYPE_METHOD_VEC.
	(finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here;
	just do some error-checking.
	(warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC.
	(finish_struct_1): Simplify.  Use add_implicitly_declared_members.
	(finish_struct): Change prototype.  Simplify; fields and methods
	are already set up at this point.
	(init_class_processing): Set up current_class_stack.
	(pushclass): Save current_access_specifier.
	(popclass): Restore it.
	(currently_open_class): Simplify.
	(build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS.
	* decl.c (saved_scope): Add access_specifier.
	(maybe_push_to_top_level): Save it.
	(pop_from_top_level): Restore it.
	(maybe_process_template_type_declaration): Use
	finish_member_declaration.
	(pushtag): Likewise.
	(pushdecl_class_level): Don't return a value.
	(fixup_anonymous_union): Break out from grok_x_components.
	(shadow_tag): Use it.
	(xref_tag): Complain about using an elaborated type specifier to
	reference a template type parameter or typedef name.
	(xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
	(current_local_enum): Remove.
	(build_enumerator): Call finish_member_declaration.
	(grok_enum_decls): Remove.
	* decl2.c (grok_x_components): Simplify.
	(check_classfn): Change iteration through CLASSTYPE_METHOD_VEC.
	(grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
	(merge_functions): Add to comment.
	(arg_assoc_type): Prototype.
	(arg_assoc): Pass as many arguments as there are parameters.
	* error.c (dump_expr): Handle PTRMEM_CST.  Improve handling of
	OFFSET_REF.
	* expr.c (cpls_expand_expr): Remove dead code.  Handle
	PTRMEM_CST.
	* friend.c (do_friend): Lookup friends when in nested classes.
	Change comments.
	* init.c (build_offset_ref): Do lookup even for classes that are
	only partially defined.
	(decl_constant_value): Remove dead code.
	* method.c (build_overload_value): Remove hack where by TYPE was
	not a TYPE.  Handle PTRMEM_CST.
	(build_template_parm_names): Don't pass a PARM_DECL where a TYPE
	should go.
	* parse.y (components, notype_components, component_decl,
	component_decl_1, component_declarator, component_declarator0):
	Now all are itype rather than ttype.  Rework to add members to
	classes on the fly.
	(typesqpecqual_reserved): Use check_multiple_declarators.
	(structsp): Update class to finish_class_definition.
	(do_xref_defn): Unsplit into named_class_head.
	(access_specifier): Set current_access_specifier.
	* pt.c (set_current_access_from_decl): New function.
	(finish_member_template_decl): Don't take the parameters.
	(comp_template_args): Make more robust.
	(lookup_template_class): Don't use current_local_enum.
	(for_each_template_parm): Handle PTRMEM_CST.
	(instantiate_class_template): Use set_current_access_from_decl,
	finish_member_declaration and unreverse_member_declarations.  Set
	lineno/input_filename before generating implicit member functions.
	(type_unification_real): Don't assume back-unification happens
	only for the last argument.
	(regenerate_decl_from_template): Call pushclass a bit earlier.
	(tsubst_chain): Remove.
	(tsubst_enum): Use set_current_access_from_decl.
	(set_mangled_name_for_template_decl): Fix indentation.
	* search.c (lookup_fnfields_1): Change iteration through
	CLASSTYPE_METHOD_VEC.
	(dfs_pushdecls): Likewise.
	(dfs_compress_decls): Likewise.
	(add_conversions): Likewise.
	* semantics.c (finish_class_definition): Don't take components.
	Change call to finish_struct.
	(finish_member_declaration): New function.
	(finish_member_class_template): Don't take template parameters.
	Change call to grok_x_components.  Call finish_member_template_decl.
	(check_multiple_declarators): New function.
	* sig.c (append_signature_fields): Work from the TYPE_METHODS, not
	a passed in fieldlist.
	* tree.c (search_tree): Handle PTRMEM_CST.
	(mapcar): Likewise.
	* typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not
	INTEGER_CSTs, for pointer-to-data members.

From-SVN: r22869
1998-10-06 14:20:30 +00:00
Kaveh R. Ghazi
b370501f72 Warning fixes:
* cp-tree.h (define_case_label): Remove unused parameter.
	(check_java_method): Likewise.
	(grokclassfn): Likewise.
	(expand_aggr_init): Likewise.
	(build_x_delete): Likewise.
	(maybe_end_member_template_processing): Likewise.
	(unshare_base_binfos): Add prototype.
	(string_conv_p): Likewise.
	(my_friendly_abort): Mark with ATTRIBUTE_NORETURN.
	* cvt.c (build_up_reference): Remove unused parameter
 	`checkconst', all callers changed.
	(build_type_conversion): Mark parameter `code' with
	ATTRIBUTE_UNUSED.
	(build_expr_type_conversion): Initialize variable `conv'.
	* decl.c (push_namespace): Initialize variable `d'.
  	(define_case_label): Remove unused parameter `decl', all callers
 	changed.
	* decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter
 	`argc' with ATTRIBUTE_UNUSED.
	(grokclassfn): Remove unused parameter `cname', all callers
 	changed.
	(check_java_method): Likewise for parameter `ctype'.
	(copy_assignment_arg_p): Mark parameter `virtualp' with
	ATTRIBUTE_UNUSED.
	(finish_prevtable_vardecl): Likewise for parameter `prev'.
	* expr.c (extract_init): Likewise for parameters `decl' and `init'.
	* init.c (expand_aggr_init_1): Remove unused parameter
 	`alias_this', all callers changed.
	(expand_aggr_init): Likewise.
	(expand_default_init): Likewise.
	(build_new_1): Initialize variable `susp'.
	(build_x_delete): Remove unused parameter `type', all callers
	changed.
	* lex.c (set_typedecl_interface_info): Mark parameter `prev' with
	ATTRIBUTE_UNUSED.
	(readescape): Use (unsigned) value in shift.
	(real_yylex): Likewise.  Likewise.  Also cast `sizeof' to int when
	comparing to a signed quantity.
	* pt.c (maybe_end_member_template_processing): Remove unused
 	parameter `decl', all callers changed.
	(check_explicit_specialization): Add braces around empty body in
	an else-statement.
	(current_template_args): Initialize variable `args'.
	(lookup_template_class): Likewise for variable `prev_local_enum'.
	(tsubst_decl): Likewise for variable `r'.
	(set_mangled_name_for_template_decl): Initialize variable
	`context'.
	* spew.c (scan_tokens): Change type of parameter `n' to unsigned.
	Likewise for variable `i'.
	(yylex): Initialize variable `trrr'.
	* typeck.c (compparms): Mark variable `strict' with
	ATTRIBUTE_UNUSED.
	* xref.c (simplify_type): Cast argument of ctype function to
	`unsigned char'.

From-SVN: r22587
1998-09-25 09:00:04 +00:00
Jason Merrill
8251199e44 revert error reporting patch
From-SVN: r22310
1998-09-07 10:25:35 -04:00
Mark Mitchell
d41fbd2cb8 cp-error.def: New file.
* cp-error.def: New file.
	* Make-lang.in (cc1plus): Add dependency on it.
	* Makefile.in (CXX_TREE_H): Likewise.
	* cp-tree.h (error_code): New type.
	Include cp-error.def to get error codes.  Make it possible to
	include cp-tree.h in errfn.c.
	(enable_warning): New function.
	(flag_diag_codes): New variable.
	* errfn.c: Include cp-tree.h.
	(cp_err_msg): New type.  Include cp-error.def to define it.
	(err_msgs): New variable.
	(is_warning_enabled): New function.
	(cp_thing): Take an error_code, not a format string.  Output the
	diagnostic code if flag_diag_codes.
	(cp_error, cp_compiler_error, cp_sprintf, cp_error_at): Take
	error_codes, not format strings.
	(cp_warning, cp_pedwarn, cp_warning_at, cp_pedwarn_at): Likewise.
	Call is_warning_enabled.
	* decl2.c (flag_diag_codes): New variable.
	(lang_decode_option): Handle -fdiag-codes and -Wnumber.
	* lang-options.h: Add -fdiag-codes, -fno-diag-codes, and
	-W-number-, and -Wno-number.
	* class.c: Update all calls to error-functions.
	* cvt.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* friend.c: Likewise.
	* lex.c: Likewise.
	* parse.y: Likewise.
	* pt.c: Likewise.
	* repo.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.
	* semantics.c: Likewise.
	* sig.c: Likewise.
	* tree.c: Likewise.
	* typeck.c: Likewise.
	* typeck2.c: Likewise.
	* xref.c: Likewise.

From-SVN: r22304
1998-09-06 19:45:16 +00:00
Robert Lipe
54f92bfbb1 call.c, [...]: Add include of toplev.h.
Wed May  6 06:36:41 1998  Robert Lipe  <robertl@dgii.com>
        * cp/call.c, cp/class.c, cp/decl.c, cp/decl2.c,
        cp/errfn.c, cp/error.c, cp/except.c, cp/expr.c,
        cp/friend.c, cp/init.c, cp/lex.c, cp/method.c,
        cp/pt.c, cp/repo.c, cp/rtti.c, cp/search.c,
        cp/semantics.c, cp/sig.c, cp/tree.c, cp/typeck.c,
        cp/typeck2.c, cp/xref.c: Add include of toplev.h.

From-SVN: r19565
1998-05-06 05:01:35 +00:00
Jeffrey A Law
8d052bc70c call.c: Include system.h.
* call.c: Include system.h.  Remove includes, declarations and
        defines provided by system.h.
        * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise.
        * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise.
        * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise.
        * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise.
        * typeck2.c, xref.c: Likewise.
        * Makefile.in: Dependencies updated as appropriate.
        * Make-lang.in: Likewise.
system.h cutover from the cp subdir

From-SVN: r18917
1998-03-31 06:25:46 -07:00
Jeffrey A Law
994ac65bd0 * expr.c (tree_extract_aggr_init): #if 0 out.
From-SVN: r18899
1998-03-29 05:36:07 -07:00
Jason Merrill
6b4e839128 expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing if (aggregate_value_p (type)).
* expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing
	if (aggregate_value_p (type)).

From-SVN: r18823
1998-03-25 05:54:42 -05:00
Manfred Hollstein
1bbe34be63 W
In gcc/:
	* bitmap.c (bitmap_element_allocate): Remove unused parameter;
	change callers accordingly.
	* cplus-dem.c (arm_special): Remove unused parameter work in prototype
	and definition; change all callers accordingly.
	* except.c (init_eh): Avoid assignment of unused return value of
	build_pointer_type; cast it to void, instead, and remove unused
	variable type.
	* gcc.c (lang_specific_driver): Define prototype only #ifdef
	LANG_SPECIFIC_DRIVER.
	(temp_names): Define only #ifdef MKTEMP_EACH_FILE.
	* genoutput.c (output_epilogue): Initialize next_name to 0.
	* real.c (efrexp): #if 0 prototype and function definition.
	(eremain): Likewise.
	(uditoe): Likewise.
	(ditoe): Likewise.
	(etoudi): Likewise.
	(etodi): Likewise.
	(esqrt): Likewise.
	* reload.c (push_secondary_reload): Define prototype only
	#ifdef HAVE_SECONDARY_RELOADS.
	* varasm.c (assemble_static_space): Define rounded only
	#ifndef ASM_OUTPUT_ALIGNED_LOCAL.
In gcc/cp/:
	* call.c (default_parm_conversions): Remove prototype definition.
	(build_method_call): Remove unused variable result.
	* cvt.c (ocp_convert): Remove unused variable conversion.
	* decl2.c (ambiguous_decl): Add explicit parameter definition for name.
	* except.c (do_unwind): #if 0 definition of unused variables fcall
	and next_pc.
	* expr.c (extract_scalar_init): #if 0 prototype and function definition.
	* init.c (expand_aggr_init_1): Remove unused variable init_type.
	(build_new_1): Remove unused variable t.
	* pt.c (instantiate_class_template): Remove unused variable newtag;
	cast called function return value to void.
	(do_decl_instantiation): Remove unused variables name and fn.
	* tree.c (get_type_decl): Add default return to shut up compiler from
	complaining control reaches end of non-void function.
	* typeck.c (build_x_conditional_expr): Remove unused variable rval.

From-SVN: r18496
1998-03-12 00:29:12 +00:00
Jason Merrill
2a66ec2b80 expr.c (cplus_expand_expr, [...]): Call convert_from_reference sooner.
* expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code):
	Call convert_from_reference sooner.

From-SVN: r17659
1998-02-03 20:29:33 -05:00
Jason Merrill
56841f01ec expr.c (cplus_expand_expr, [...]): Don't check that return_target and call_target are equivalent.
* expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that
	return_target and call_target are equivalent.

From-SVN: r17510
1998-01-27 07:07:36 -05:00
Jason Merrill
a0d5fba7d2 init.c (build_new_1): Split out from build_new.
* init.c (build_new_1): Split out from build_new.
	(build_new): Just return a NEW_EXPR.
	* expr.c (cplus_expand_expr): Handle NEW_EXPR.
	* decl2.c (get_temp_regvar): Tweak.
	* cp-tree.h (TREE_CALLS_NEW): Comment out.
	* class.c (resolves_to_fixed_type_p): Remove use.
	* method.c (build_opfncall): Likewise.
	* call.c (build_new_op): Likewise.
Fix problem with 'new' in default argument.

From-SVN: r17319
1998-01-12 04:44:59 -05:00
Jason Merrill
0253134551 except.c: Remove register_exception_table{,_p}.
* except.c: Remove register_exception_table{,_p}.
	* decl2.c (finish_file): Remove call to register_exception_table.
	* cp-tree.def: Add AGGR_INIT_EXPR.
	* error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with
	AGGR_INIT_EXPR where appropriate.
	* expr.c (cplus_expand_expr): Likewise.  Simplify.

From-SVN: r17132
1997-12-18 09:52:24 -05:00
Jason Merrill
e66d884e7b cp-tree.h (scratchalloc, [...]): Define as macros for now.
* cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec,
	scratch_tree_cons): Define as macros for now.
	* call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c,
	lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c,
	typeck2.c: Use them and the expression_obstack variants.

From-SVN: r15900
1997-10-14 14:59:03 -04:00
H.J. Lu
9f6177175d Makefile.in (parse.o, decl.o): Also depend on $(srcdir)/../except.h $(srcdir)/../output.h.
Mon Sep 29 19:57:51 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

	* Makefile.in (parse.o, decl.o): Also depend on
	$(srcdir)/../except.h $(srcdir)/../output.h.
	(decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h
	$(srcdir)/../except.h $(srcdir)/../output.h.
	(typeck.o, init.o): Also depend on $(srcdir)/../expr.h
	../insn-codes.h.

	* call.c, cp-tree.h, decl.c, tree.c: Finish prototyping.

	* expr.c (cplus_expand_expr): Make it static.

	* decl2.c, init.c, typeck.c: Include "expr.h".
	(expand_expr): Use proper values when calling the function.

From-SVN: r15801
1997-09-29 23:36:39 -04:00
Jason Merrill
49c249e1c8 [multiple changes]
Wed Aug 20 17:25:08 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* call.c (is_subseq): Don't try to be clever.

Wed Aug 20 03:13:36 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

	* parse.y, pt.c: Include "except.h".
	* call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c,
 	error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c,
 	lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c,
 	sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish
 	prototyping.

Wed Aug 20 01:34:40 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* decl2.c (mark_vtable_entries): Instead of replacing pure
	virtuals with a reference to __pure_virtual, copy the decl and
	change the RTL.

From-SVN: r14868
1997-08-20 20:50:39 -04:00
Jason Merrill
da20811c09 merge
From-SVN: r14852
1997-08-19 18:37:19 -04:00
Jason Merrill
beb53fb84a 91th Cygnus<->FSF quick merge
From-SVN: r14021
1997-05-06 20:14:14 +00:00
Mike Stump
eb4484594f 91th Cygnus<->FSF quick merge
From-SVN: r14007
1997-05-02 01:42:58 +00:00
Mike Stump
de22184bb2 90th Cygnus<->FSF quick merge
From-SVN: r13542
1997-01-21 21:32:30 +00:00
Mike Stump
faf5394a1b 90th Cygnus<->FSF quick merge
From-SVN: r13319
1996-12-18 01:44:21 +00:00
Mike Stump
f49422dada 89th Cygnus<->FSF quick merge
From-SVN: r12978
1996-10-18 18:33:44 +00:00
Mike Stump
5156628f9f 89th Cygnus<->FSF quick merge
From-SVN: r12883
1996-09-30 21:34:04 +00:00
Mike Stump
a0128b67f4 86th Cygnus<->FSF quick merge
From-SVN: r12177
1996-06-06 19:10:27 +00:00
Mike Stump
8a5d3064fb expr.c (expand_expr, [...]): Move from the C++ frontend to the backend where it belongs.
* expr.c (expand_expr, cond UNSAVE_EXPR): Move from the C++
	frontend to the backend where it belongs.
	* tree.c (unsave_expr): Ditto.
	(unsave_expr_now): Ditto.
	* tree.def (UNSAVE_EXPR): Ditto.
	* cp-tree.h (unsave_expr): Ditto.
	(unsave_expr_now): Ditto.

From-SVN: r12016
1996-05-17 20:28:08 +00:00
Mike Stump
ce122a8618 86th Cygnus<->FSF quick merge
From-SVN: r12008
1996-05-17 17:08:27 +00:00
Mike Stump
4dabb3791d 86th Cygnus<->FSF quick merge
From-SVN: r11956
1996-05-08 18:18:35 +00:00
Mike Stump
a80e41955a 86th Cygnus<->FSF quick merge
From-SVN: r11850
1996-04-19 00:48:03 +00:00
Mike Stump
fc37869868 85th Cygnus<->FSF quick merge
From-SVN: r11587
1996-03-21 19:46:11 +00:00
Mike Stump
5566b478bd 83rd Cygnus<->FSF merge
From-SVN: r11362
1996-02-28 22:01:56 +00:00
Mike Stump
cffa872980 82nd Cygnus<->FSF merge
From-SVN: r11328
1996-02-20 20:35:10 +00:00
Mike Stump
9e9ff70986 80th Cygnus<->FSF merge
From-SVN: r11150
1996-02-01 19:32:00 +00:00
Mike Stump
f30432d726 75th Cygnus<->FSF merge
From-SVN: r10438
1995-10-12 02:33:51 +00:00
Jason Merrill
f79c7a76be (cplus_expand_expr): Don't mess with temp slots.
From-SVN: r10075
1995-06-28 16:53:02 -04:00
Richard Kenner
8ecb1d9245 Rename called function.
From-SVN: r10050
1995-06-22 22:51:13 -04:00
Richard Kenner
e9fa0c7c6f Update FSF address.
From-SVN: r9966
1995-06-15 08:29:51 -04:00
Jason Merrill
c19a80671b 72nd Cygnus<->FSF merge
From-SVN: r9737
1995-05-17 23:34:39 +00:00
Mike Stump
a58942422c 68th Cygnus<->FSF merge
From-SVN: r9555
1995-05-01 21:36:30 +00:00
Mike Stump
e8abc66f60 67th Cygnus<->FSF merge
From-SVN: r9433
1995-04-24 17:27:46 +00:00
Mike Stump
28cbf42c14 59th Cygnus<->FSF merge
From-SVN: r9225
1995-03-23 00:44:31 +00:00
Mike Stump
6060a79633 50th Cygnus<->FSF merge
From-SVN: r8657
1994-12-16 02:07:31 +00:00
Jason Merrill
eae89e0400 *** empty log message ***
From-SVN: r8347
1994-10-27 01:22:58 +00:00
Mike Stump
8d2733caec 36th Cygnus<->FSF merge
From-SVN: r7221
1994-05-06 09:27:46 +00:00
Mike Stump
8926095fe7 31th Cygnus<->FSF merge.
From-SVN: r6996
1994-04-08 06:08:43 +00:00
Mike Stump
8d08fdba59 Initial revision
From-SVN: r6613
1994-02-24 01:02:37 +00:00