Commit Graph

47 Commits

Author SHA1 Message Date
Mark Mitchell 31f8e4f306 cp-tree.h (BV_USE_VCALL_INDEX_P): New macro.
* cp-tree.h (BV_USE_VCALL_INDEX_P): New macro.
	(BV_GENERATE_THUNK_WITH_VTABLE_P): Likewise.
	(lang_decl_flags): Add generate_with_vtable_p.  Make vcall_offset
	a tree, not an int.
	(THUNK_GENERATE_WITH_VTABLE_P): New macro.
	(make_thunk): Change prototype.
	(emit_thunk): Rename to use_thunk.
	(mangle_thunk): Change prototype.
	* class.c (get_derived_offset): Simplify.
	(copy_virtuals): Clear BV_USE_VCALL_INDEX_P and
	BV_GENERATE_THUNK_WITH_VTABLE_P.
	(build_primary_vtable): Simplify.
	(add_virtual_function): Use BV_FN, rather than TREE_VALUE.
	(dfs_find_base): Remove.
	(update_vtable_entry_for_fn): Correct bug in finding the base
	where a virtual function was first declared.  Figure out whether
	or not to emit a vcall-thunk with the vtables in which it appears.
	Correct logic for deciding whether to use an ordinary thunk, or a
	vcall thunk.
	(finish_struct_1): Remove unnecssary code.
	(build_vtbl_initializer): Use ssize_int for the running counter of
	negative indices.
	(build_vtbl_initializer): Only use vcall thunks where necessary.
	Mark thunks as needing to be emitted with their vtables, or not.
	(build_vbase_offset_vtbl_entries): Adjust for use of ssize_int in
	indices.  Use size_binop.
	(dfs_build_vcall_offset_vtbl_entries): Don't rely on
	BINFO_PRIMARY_MARKED_P here.  Use BV_FN consistently.  Use
	size_binop.
	(build_rtti_vtbl_entries): Adjust call to build_vtable_entry.
	(build_vtable_entry): Mark thunks as needing to be emitted with
	their vtables, or not.
	* decl.c (lang_mark_tree): Mark the vcall_offset in a thunk.
	* decl2.c (mark_vtable_entries): Use use_thunk instead of
	emit_thunk.
	* dump.c (dequeue_and_dump): Remove dead code.  Dump new thunk
	information.
	* error.c (dump_expr): Use BV_FN.
	* mangle.c (mangle_thunk): Adjust now that vcall_offset is a tree,
	not an int.
	* method.c (make_thunk): Likewise.
	(emit_thunk): Rename to use_thunk.  Allow callers to decide
	whether or not to actually emit the thunk.  Adjust for changes in
	representation of vcall offsets.
	* search.c (dfs_get_pure_virtuals): Use BV_FN.
	* semantics.c (emit_associated_thunks): New function.
	(expand_body): Use it.
	* ir.texi: Adjust decriptions of thunks.

From-SVN: r34656
2000-06-23 01:14:40 +00:00
Mark Mitchell fd74ca0bf2 cp-tree.h (struct language_function): Remove x_base_init_list and x_member_init_list.
* cp-tree.h (struct language_function): Remove x_base_init_list
	and x_member_init_list.
	(current_base_init_list): Remove.
	(current_member_init_list): Likewise.
	(setup_vtbl_ptr): Change prototype.
	(emit_base_init): Likewise.
	(expand_member_init): Likewise.
	(reinit_parse_for_function): Remove.
	* decl.c (save_function_data): Don't clear x_base_init_list and
	x_member_init_list.
	(mark_language_function): Don't mark them.
	* init.c (perform_member_init): Tweak comment.
	(sort_member_init): Take the list of initializers as an argument.
	(sort_base_init): Likewise.
	(emit_base_init): Likewise.
	(expand_member_init): Return the initializer.  Don't use global
	variables.
	* lex.c (reinit_parse_for_function): Remove.
	* method.c (build_template_parm_names): Correct substitution.
	(do_build_copy_constructor): Don't use current_member_init_list
	and current_base_init_list.
	(synthesize_method): Likewise.
	* parse.y (base_init): Split mem-initializers into
	base-initializers and field-initializers.
	(member_init_list): Build up the list here.
	(member_init): Return the initializer.
	(fn.depfn): Don't use reinit_parse_for_function.
	* parse.c: Regenerated.
	* pt.c (convert_nontype_argument): Don't make an ADDR_EXPR of the
	ERROR_MARK.
	(tsubst_expr): Don't use current_member_init_list
	and current_base_init_list.
	(tsubst_expr_values): Rename to ...
	(tsubst_initializer_list): ... this.  Use convert_from_reference.
	* semantics.c (setup_vtbl_ptr): Don't use current_member_init_list
	and current_base_init_list.
	(begin_function_definition): Don't call reinit_parse_for_function.

	* dump.c (dequeue_and_dump): Use TREE_VEC_LENGTH with vectors.

	* error.c (dump_expr): Handle ADDR_EXPRs with REFERENCE_TYPE
	correctly.

From-SVN: r34571
2000-06-16 07:34:51 +00:00
Mark Mitchell f9a7ae04e9 cp-tree.h (TMPL_ARGS_LEVEL): Clarify comment.
* cp-tree.h (TMPL_ARGS_LEVEL): Clarify comment.
	(INNERMOST_TEMPLATE_ARGS): New macro.
	(innermost_args): Remove.
	(get_innermost_template_args): New function.
	* decl2.c (arg_assoc_class): Use INNERMOST_TEMPLATE_ARGS.
	* error.c (dump_function_decl): Be caution when using
	most_general_template.
	* method.c (build_template_parm_names):  Use
	INNERMOST_TEMPLATE_ARGS.
	* pt.c (add_to_template_args): Tidy comment
	(get_innermost_template_args): New function.
	(check_explicit_specialization): Clear DECL_INITIAL for a new
	specialization.
	(process_partial_specialization): Use INNERMOST_TEMPLATE_ARGS.
	Tidy.
	(push_template_decl): Always register specializations of the most
	general template.
	(convert_template_argument): Use INNERMOST_TEMPLATE_ARGS.
	(coerce_template_parms): Likewise.
	(lookup_template_class): Likewise.
	(innermost_args): Remove.
	(tsubst_decl): Use INNERMOST_TEMPLATE_ARGS.
	(tsubst_decl): Handle tricky specializations.  Use
	get_innermost_template_args.
	(instantiate_template): Simplify handling of partial
	instantiations.
	(get_class_bindings): Use INNERMOST_TEMPLATE_ARGS.
	(most_general_template): Reimplement, in a more straightforward
	manner.
	(regenerate_decl_from_template): Tweak formatting.  Use
	TMPL_ARGS_DEPTH for clarity.
	(set_mangled_name_for_template_decl): Use INNERMOST_ARGS.

	* dump.c (dequeue_and_dump): Dump information about thunks.

From-SVN: r34384
2000-06-03 21:42:49 +00:00
Mark Mitchell 421844e720 cp-tree.h (IDENTIFIER_TYPENAME_P): Use a flag, not strncmp.
* cp-tree.h (IDENTIFIER_TYPENAME_P): Use a flag, not strncmp.
	(DECL_CONV_FN_P): Simplify.
	(DECL_OPERATOR): Remove.
	(language_to_string): Declare.
	* decl.c (duplicate_decls): Fix typo in comment.
	(grokdeclarator): Adjust use of IDENTIFIER_TYPENAME_P.
	(grok_op_properties): Use DECL_CONV_FN_P instead of
	IDENTIFIER_TYPENAME_P.
	* dump.c (dequeue_and_dump): Dump the language linkage of
	declarations.
	* error.c (language_to_string): Give it external linkage.
	* method.c (build_typename_overload): Set IDENTIFIER_TYPENAME_P.
	(implicitly_declare_fn): Set DECL_LANGUAGE.
	* pt.c (check_explicit_specialization): Use DECL_CONV_FN_P, not
	IDENTIFIER_TYPENAME_P.
	(tsubst_decl): Likewise.
	(tsubst_copy): Adjust use of IDENTIFIER_TYPENAME_P.
	* semantics.c (finish_member_declaration): Don't mark members of
	classes declared in an extern "C" region as extern "C".

From-SVN: r34095
2000-05-22 22:52:32 +00:00
Mark Mitchell eb68cb5821 cp-tree.def (THUNK_DECL): Remove.
* cp-tree.def (THUNK_DECL): Remove.
	* cp-tree.h (DECL_THUNK_P): New macro.
	(DECL_NON_THUNK_FUNCTION_P): Likewise.
	(DECL_EXTERN_C_FUNCTION_P): Likewise.
	(SET_DECL_THUNK_P): Likewise.
	(DELTA_FROM_VTABLE_ENTRY): Use DECL_THUNK_P.
	(FNADDR_FROM_VTABLE_ENTRY): Likewise.
	(DECL_MAIN_P): Use DECL_EXTERN_C_FUNCTION_P.
	* decl.c (decls_match): Use DECL_EXTERN_C_P.
	(duplicate_decls): Likewise.
	(pushdecl): Likewise.  Adjust thunk handling.
	(grokfndecl): Use DECL_EXTERN_C_P.
	* decl2.c (mark_vtable_entries): Use DECL_THUNK_P.
	* dump.c (dequeue_and_dump): Remove THUNK_DECL handling.
	* except.c (nothrow_libfn_p): Use DECL_EXTERN_C_P.
	* expr.c (cplus_expand_expr): Remove THUNK_DECL handling.
	* method.c (make_thunk): Use SET_DECL_THUNK_P.  Set
	DECL_NO_STATIC_CHAIN.
	(emit_thunk): Don't play games with TREE_CODE on thunks.  Don't
	set DECL_DESTRUCTOR_P or DECL_CONSTRUCTOR_P on a thunk.
	* search.c (covariant_return_p): Remove THUNK_DECL handling.
	* ir.texi: Update.

From-SVN: r33647
2000-05-03 22:25:21 +00:00
Mark Mitchell db9b217498 cp-tree.h (cp_tree_index): Add CPTI_DTOR_IDENTIFIER.
* cp-tree.h (cp_tree_index): Add CPTI_DTOR_IDENTIFIER.
	(complete_dtor_identifier): New macro.
	(CLASSTYPE_FIRST_CONVERSION): Remove.
	(CLASSTYPE_CONSTRUCTOR_SLOT): New macro.
	(CLASSTYPE_DESTRUCTOR_SLOT): Likewise.
	(CLASSTYPE_FIRST_CONVERSION_SLOT): Likewise.
	(CLASSTYPE_CONSTRUCTORS): Likewise.
	(CLASSTYPE_DESTRUCTORS): Likewise.
	(lang_decl): Add cloned_function.
	(DECL_COMPLETE_CONSTRUCTOR_P): New macro.
	(DECL_BASE_CONSTRUCTOR_P): Likewise.
	(DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise.
	(DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise.
	(DECL_CLONED_FUNCTION_P): Likewise.
	(DECL_CLONED_FUNCTION): Likewise.
	(clone_function_decl): Declare.
	(maybe_clone_body): Likewise.
	* call.c (build_user_type_conversion_1): Call complete object
	constructors in the new ABI.
	(build_new_method_call): Don't add in-charge parameters under the
	new ABI.
	* class.c (add_method): Use DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P,
	DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P, CLASSTYPE_CONSTRUCTOR_SLOT, and
	CLASSTYPE_DESTRUCTOR_SLOT.
	(build_clone): New function.
	(clone_function_decl): Likewise.
	(clone_constructors_and_destructors): Likewise.
	(check_bases_and_members): Use it.
	* decl.c (iniitialize_predefined_identifiers): Initialize
	complete_dtor_identifier.
	(finish_function): Don't add extra code to a clone.
	(lang_mark_tree): Mark cloned_function.
	* decl2.c (mark_used): Don't bother trying to instantiate things
	we synthesized.
	* dump.c (dequeue_and_dump): Don't dump CP_DECL_CONTEXT twice.
	* method.c (set_mangled_name_for_decl): Don't treat clones as
	constructors.
	(synthesize_method): Sythesize cloned functions, not the clones.
	* optimize.c (inline_data): Update comment on ret_label.
	(remap_block): Don't assume DECL_INITIAL exists.
	(copy_body_r): Allow ret_label to be NULL.
	(maybe_clone_body): Define.
	* pt.c (tsubst_decl): Handle clones.
	(instantiate_clone): New function.
	(instantiate_template): Use it.
	(set_mangled_name_for_template_decl): Don't treat clones as
	constructors.
	* search.c (lookup_fnfields_1): Use CLASSTYPE_CONSTRUCTOR_SLOT,
	CLASSTYPE_DESTRUCTOR_SLOT, and CLASSTYPE_FIRST_CONVERSION_SLOT.
	* semantics.c (expand_body): Clone function bodies as necessary.

From-SVN: r33084
2000-04-11 20:16:36 +00:00
Mark Mitchell bedda2da7f final.c (final): Use xcalloc to allocate line_note_exists.
* final.c (final): Use xcalloc to allocate line_note_exists.
	* function.c (free_after_compilation): Free the temp_slots.
	(assign_stack_temp_for_type): Use xmalloc to allocate temp_slots.
	(combine_temp_slot): Free temp_slots when they get combined.
	(purge_addressof): Fix typo in comment.
	* stmt.c (mark_goto_fixup): Mark the fixup itself.
	(expand_fixup): Allocate the fixup with ggc_alloc_obj.

	* ggc.h: Include varray.h.
	(ggc_pending_trees): Declare.
	(ggc_mark_tree_children): Remove declaration.
	(ggc_mark_tree): Just push unmarked trees on ggc_pending_trees.
	* ggc-common.c (ggc_pending_trees): New variable.
	(ggc_mark_roots): Call ggc_mark_trees.
	(ggc_mark_tree_children): Rename to ggc_mark_trees.  Process all
	the ggc_pending_trees.
	* Makefile.in (GGC_H): New variable.  Use it throughout in place
	of ggc.h.

	* Makefile.in (GGC_H): New variable.  Use it throughout in place
	of ggc.h.

	* call.c: Don't include obstack.h.  Include ggc.h.
	(obstack_chunk_alloc): Don't define.
	(obstack_chunk_free): Likewise.
	(add_candidate): Allocate the z_candidate with ggc_alloc_obj.
	* decl.c (push_switch): Use xmalloc to allocate the cp_switch.
	(pop_switch): Free it.

	* decl2.c (grokclassfn): Set TREE_READONLY for PARM_DECLs.

	* dump.c (dequeue_and_dump): Don't try to print the bit_position
	if we don't have a DECL_FIELD_OFFSET.

	* Makefile.in (GGC_H): Add varray.h.

From-SVN: r32956
2000-04-06 00:51:25 +00:00
Mark Mitchell da8a745625 decl.c (grokdeclarator): Count partial specializations when keeping track of how many template classes...
* decl.c (grokdeclarator): Count partial specializations when
	keeping track of how many template classes have been seen.

	* dump.c (dequeue_and_dump): Dump DECL_TEMPLATE_RESULT.

From-SVN: r32743
2000-03-26 03:05:49 +00:00
Richard Kenner 770ae6cc71 * Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
	* alias.c (reg_known_value_size): Now unsigned.
	* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
	(really_start_incremental_init): Use bitsize_zero_node.
	(push_init_level, pop_init_level, output_init_element): Likewise.
	Use bitsize_unit_node and bitsize_one_node.
	(output_pending_init_elements, process_init_element): Likewise.
	* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
	(make_extraction): Position and length HOST_WIDE_INT and unsigned
	HOST_WIDE_INT, respectively.
	(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
	(num_sign_bit_copies): Returns unsigned.
	BITWIDTH now unsigned; rework arithmetic.
	Remove recursive call from arg to MAX.
	(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
	(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
	REGNO now unsigned.
	(set_nonzero_bit_and_sign_copies): NUM now unsigned.
	(find_split_point, expand_compound_operation, make_extraction): LEN
	now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
	(make_field_assignment): Likewise.
	(combine_simplify_rtx): Add cast.
	(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
	(force_to_mode): WIDTH now unsigned; add cast.
	(if_then_else_cond): SIZE now unsigned.
	(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
	(extended_count): Now returns unsigned.
	(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
	Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
	(simplify_comparison): MODE_WIDTH now unsigned.
	(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
	(mark_used_regs_combine): Likewise; rework arithmetic.
	(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
	(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
	(record_promoted_value): REGNO now unsigned.
	(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
	(get_last_value): REGNO now unsigned.
	(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
	(reg_dead_regno, reg_dead_endregno): Now unsigned.
	(remove_death): Arg REGNO now unsigned.
	(move_deaths):  REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
	(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
	now unsigned.
	* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
	* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
	(struct cse_reg_info): REGNO now unsigned.
	(cached_regno): Now unsigned.
	(REGNO_QTY_VALID_P): Add cast.
	(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
	(remove_invalid_regs): Likewise.
	(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
	as are variables END and I.
	(get_cse_reg_info, insert): Likewise.
	(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
	(canon_hash): Likewise.
	(insert_regs, lookup_for_remove): REGNO now unsigned.
	(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
	New variable RN.
	* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
	* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
	* emit-rtl.c (subreg_realpart_p): Add cast.
	(operand_subword): Arg I is now unsigned as is var PARTWORDS.
	(operand_subword_force): Arg I is now unsigned.
	* except.c (eh_regs): Variable I is now unsigned.
	* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
	* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
	length is unsigned HOST_WIDE_INT; likewise for internal variables.
	(store_split_bit_field, extract_fixed_bit_field): Likewise.
	(extract_split_bit_field, store_bit_field, extract_bit_field):
	Likewise.
	* expr.c (store_constructor_fields, store_constructor, store_field):
	Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
	(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
	(do_jump): Likewise.
	(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
	MAX_SIZE is now unsigned.
	(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
	(emit_group_store): Likewise.
	(emit_move_insn): I now unsigned.
	(store_constructor): Use host_integerp, tree_low_cst, and
	bitsize_unit_node.
	(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
	Rework all calculations to use trees and new fields.
	* expr.h (promoted_input_arg): Regno now unsigned.
	(store_bit_field, extract_bit_field): Adjust types of pos and size.
	(mark_seen_cases): Arg is HOST_WIDE_INT.
	* flow.c (verify_wide_reg_1): REGNO now unsigned.
	* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
	precisions and alignments are unsigned.
	(optimize_bit_field_compare, fold_truthop): Likewise.
	(int_const_binop): Adjust threshold for size_int_type_wide call.
	(fold_convert): Likewise.
	(size_int_type_wide): Make table larger and fix thinko that only
	had half of table used.
	(all_ones_mask_p, fold): Precisions are unsigned.
	* function.c (put_reg_info_stack): REGNO is unsigned.
	(instantiate_decl): Size is HOST_WIDE_INT.
	(instantiate_virtual_regs): I is unsigned.
	(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
	(promoted_input_arg): REGNO is unsigned.
	* function.h (struct function): x_max_parm_reg is now unsigned.
	* gcse.c (max_gcse_regno): Now unsigned.
	(struct null_pointer_info): min_reg and max_reg now unsigned.
	(lookup_set, next_set): REGNO arg now unsigned.
	(compute_hash_table): REGNO and I now unsigned.
	(handle_avail_expr): regnum_for_replacing now unsigned.
	(cprop_insn): REGNO now unsigned.
	(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
	* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
	* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
	* hard-reg-set.h (reg_class_size): Now unsigned.
	* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
	* jump.c (mark_modified_reg): I now unsigned; add cast.
	(rtx_equal_for_thread_p): Add cast.
	* loop.c (max_reg_before_loop): Now unsigned.
	(struct_movable): REGNO now unsigned.
	(try_copy_prop): REGNO arg unsigned.
	(regs_match_p): XN and YN now unsigned.
	(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
	(strength_reduce): Likewise; NREGS also unsigned.
	(first_increment_giv, last_increment_giv unsigned): Now unsigned.
	* loop.h (struct iv_class): REGNO now unsigned.
	(max_reg_before_loop, first_increment_giv, last_increment_giv):
	Now unsigned.
	* machmode.h (mode_size, mode_unit_size): Now unsigned.
	(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
	* optabs.c (expand_binop): I and NWORDS now unsigned.
	(expand_unop): I now unsigned.
	* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
	print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
	* real.c (significand_size): Now returns unsigned.
	* real.h (significand_size): Likewise.
	* regclass.c (reg_class_size): Now unsigned.
	(choose_hard_reg_mode): Both operands now unsigned.
	(record_reg_classes): REGNO and NR now unsigned.
	(reg_scan): NREGS now unsigned.
	(reg_scan_update): old_max_regno now unsigned.
	(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
	* reload.c (find_valid_class): BEST_SIZE now unsigned.
	(find_dummy_reload): REGNO, NWORDS, and	I now unsigned.
	(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
	Likewise for variable R.
	(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
	as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
	(find_equiv_reg): Add casts.
	(regno_clobbered_p): Arg REGNO now unsigned.
	* reload.h (struct reload): NREGS now unsigned.
	(refers_to_regno_for_reload_p): Regno args are unsigned.
	(regno_clobbered_p): Likewise.
	* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
	(compute_use_by_pseudos): REGNO now unsigned.
	(find_reg): I and J now unsigned, new variable K, and change loop
	variables accordingly; THIS_NREGS now unsigned.
	(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
	(spill_hard_reg): REGNO arg now unsigned; add casts.
	(forget_old_reloads_1): REGNO, NR, and I now unsigned.
	(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
	(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
	END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
	(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
	(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
	(emit_reload_insns): REGNO now unsigned.
	(reload_cse_move2add): Add cast.
	(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
	and rework loop.
	* resource.c (mark_referenced_resources, mark_set_resources): New
	variable R; REGNO and LAST_REGNO now unsigned.
	(mark_target_live_regs): J and REGNO now unsigned.
	* rtl.c (mode_size, mode_unit_size): Now unsigned.
	* rtl.h (union rtunion_def): New field rtuint.
	(XCUINT): New macro.
	(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
	(operand_subword, operand_subword_force): Word number is unsigned.
	(choose_hard_reg_mode): Operands are unsigned.
	(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
	(find_regno_note, find_regno_fusage, replace_regs): Likewise.
	(regno_use_in, combine_instructions, remove_death): Likewise.
	(reg_scan, reg_scan_update): Likewise.
	(extended_count): Return is unsigned.
	* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
	INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
	(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
	(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
	(reg_reg_last_1): FIRS and LAST now unsigned.
	(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
	(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
	now unsigned.
	(find_regno_note, regno_use_in): Arg REGNO now unsigned.
	(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
	(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
	(replace_regs): Arg NREGS now unsigned.
	* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
	* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
	(simplify_binary_operation): Likewise.
	(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
	THIS_LAST now unsigned.
	(cselib_record_set): Add cast.
	* ssa.c (ssa_max_reg_num): Now unsigned.
	(rename_block): REGNO now unsigned.
	* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
	sizes now unsigned.
	(all_cases_count): Just return -1 not -2.
	COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
	Rework tests to use trees whenever possible.
	Use host_integerp and tree_low_cst.
	(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
	Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
	(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
	* stor-layout.c (mode_for_size): SIZE arg now unsigned.
	(smallest_mode_for_size): Likewise.
	(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
	KNOWN_ALIGN is now an alignment, so simplify code.
	Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
	(start_record_layout): Renamed from new_record_layout_info.
	Update to new fields.
	(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
	New functions.
	(place_union_field): Renamed from layout_union_field.
	Update to use new fields in rli.
	(place_field): Renamed from layout_field.
	Major rewrite to use new fields in rli; pass alignment to layout_decl.
	(finalize_record_size): Rework to use new fields in rli and handle
	union.
	(compute_record_mode): Rework to simplify and to use new DECL fields.
	(finalize_type_size): Make rounding more consistent.
	(finish_union_layout): Deleted.
	(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
	(layout_type, case RECORD_TYPE): Call new function names.
	(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
	(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
	(get_best_mode): UNIT is now unsigned; remove casts.
	* tree.c (bit_position): Compute from new fields.
	(byte_position, int_byte_position): New functions.
	(print_type_hash_statistics): Cast to remove warning.
	(build_range_type): Use host_integerp and tree_low_cst to try to hash.
	(build_index_type): Likewise; make subtype of sizetype.
	(build_index_2_type): Pass sizetype to build_range_type.
	(build_common_tree_nodes): Use size_int and bitsize_int to
	initialize nodes; add bitsize_{zero,one,unit}_node.
	* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
	(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
	(DECL_PACKED, DECL_BIT_FIELD): Likewise.
	(DECL_FIELD_BITPOS): Deleted.
	(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
	(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
	(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
	(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
	(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
	(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
	(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
	(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
	(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
	(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
	(DECL_ALIGN): Adjust to new field in union.
	(DECL_OFFSET_ALIGN): New field.
	(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
	(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
	(union tree_decl): Add struct for both aligns.
	(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
	(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
	(struct record_layout_info): Rework fields to have offset
	alignment and byte and bit position.
	(start_record_layout, place_field): Renamed from old names.
	(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
	(byte_position, int_byte_position): Likewise.
	(get_inner_reference): Change types of position and length.
	* unroll.c (unroll_loop): New variable R; use for some loops.
	MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
	(calculate_giv_inc): Arg REGNO now unsigned.
	(copy_loop_body): REGNO and SRC_REGNO now unsigned.
	* varasm.c (assemble_variable): Clean up handling of size using
	host_integerp and tree_low_cst.
	(decode_addr_const): Use byte, not bit, position.
	(output_constructor): bitpos and offsets are HOST_WIDE_INT;
	use tree_low_cst and int_bit_position.
	* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
	* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
	* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
	(extract_constant_from_buffer): Likewise.
	* cp/class.c (build_vbase_pointer_fields): layout_field now
	place_field.
	(get_vfield_offset): Use byte_position.
	(set_rtti_entry): Set OFFSET to ssizetype zero.
	(get_binfo_offset_as_int): Deleted.
	(dfs_record_base_offsets): Use tree_low_cst.
	(dfs_search_base_offsets): Likewise.
	(layout_nonempty_base_or_field): Reflect changes in RLI format
	and call byte_position.
	(layout_empty_base): Convert offset to ssizetype.
	(build_base_field): use rli_size_unit_so_far.
	(dfs_propagate_binfo_offsets): Do computation in proper type.
	(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
	(layout_class_type): Reflect changes in RLI names and fields.
	(finish_struct_1): Set DECL_FIELD_OFFSET.
	* cp/dump.c (dequeue_and_dump): Call bit_position.
	* cp/expr.c (cplus_expand_constant): Use byte_position.
	* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
	* cp/typeck.c (build_component_addr): Use byte_position and don't
	special case for zero offset.
	* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
	(ffecom_tree_canonize_ref_): Likewise.
	* java/class.c (make_field_value): Use byte_position.
	* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
	(java_array_data_offset): Likewise.
	* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
	bzero call.

From-SVN: r32742
2000-03-25 13:34:13 -05:00
Mark Mitchell 370af2d55a Remove accidental commit
From-SVN: r32740
2000-03-25 16:38:49 +00:00
Mark Mitchell e5361bbe07 Fix typo in ChangeLog
From-SVN: r32739
2000-03-25 16:30:33 +00:00
Mark Mitchell 971cbc146e expr.c (cplus_expand_expr, [...]): Use expand_start_stmt_expr and expand_end_stmt_expr directly.
* expr.c (cplus_expand_expr, case STMT_EXPR): Use
	expand_start_stmt_expr and expand_end_stmt_expr directly.  Set
	RTL_EXPR_HAS_NO_SCOPE.

	* pt.c (instantiate_decl): Clear TI_PENDING_TEMPLATE_FLAG a little
	later.

	* dump.c (dequeue_and_dump): Dump SCOPE_NO_CLEANUPS_P.

From-SVN: r32345
2000-03-05 20:46:18 +00:00
Mark Mitchell 27d26ee7a7 cp-tree.h (DECL_NEEDED_P): Tweak to correct usage before EOF.
* cp-tree.h (DECL_NEEDED_P): Tweak to correct usage before EOF.
	(import_export_class): Remove declaration.
	* decl2.c (import_export_class): Make it static.
	* dump.c (dequeue_and_dump): Handle PREDECREMENT_EXPR,
	PREINCREMENT_EXPR, POSTDECREMENT_EXPR, POSTINCREMENT_EXPR,
	EXPR_WITH_FILE_LOCATION.
	* lex.c (check_newline): Tweak filename/lineno setting.
	* semantics.c (begin_while_stmt): Fix typo in comment.

From-SVN: r32208
2000-02-27 02:46:57 +00:00
Mark Mitchell 2269eec3b9 ir.texi: Document DECL_TEMPLATE_INSTANTIATIONS.
2000-02-17  Mark Mitchell  <mark@codesourcery.com>

	* ir.texi: Document DECL_TEMPLATE_INSTANTIATIONS.

From-SVN: r32042
2000-02-17 20:45:49 +00:00
Mark Mitchell 4f1c5b7dbf Make DECL_CONTEXT mean the class in which a member function was declared, even for a virtual function.
Make DECL_CONTEXT mean the class in which a member function was
	declared, even for a virtual function.
	* cp-tree.h (DECL_CLASS_CONTEXT): Adjust.
	(DECL_FRIEND_CONTEXT): New macro.
	(DECL_REAL_CONTEXT): Remove.
	(SET_DECL_FRIEND_CONTEXT): Likewise.
	(DECL_VIRTUAL_CONTEXT): Adjust.
	(DECL_CLASS_SCOPE_P): Use TYPE_P.
	(add_friends): Remove.
	(hack_decl_function_context): Likewise.
	* call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with
	CP_DECL_CONTEXT.
	(build_over_call): Fix indentation.  Use DECL_CONTEXT
	instead of DECL_CLASS_CONTEXT.
	* class.c (dfs_build_vcall_offset_vtbl_entries): Likewise.
	(add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
	(strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	(build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT.
	(build_base_field): Likewise.
	(finish_struct_1): Likewise.
	(build_self_reference): Likewise.
	* decl.c (push_class_binding): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(pushtag): Use decl_function_context, not
	hack_decl_function_context.
	(decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
	(duplicate_decls): Use DECL_VIRTUAL_CONTEXT.
	(pushdecl): Remove bogus code.
	(start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT.
	(cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
	(grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	Use decl_function_context, nothack_decl_function_context.
	(grokvardecl): Don't set DECL_CLASS_CONTEXT.
	(grokdeclarator): Likewise.  Use decl_function_context, not
	hack_decl_function_context.
	(copy_args_p): Document.  Don't use DECL_CLASS_CONTEXT.
	(start_function): Use DECL_FRIEND_CONTEXT, not
	DECL_CLASS_CONTEXT.  Use decl_function_context, not
	hack_decl_function_context.
	(finish_function): Use decl_function_context, not
	hack_decl_function_context.
	(maybe_retrofit_in_chrg): Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	(grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT.
	(finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT.
	(grokfield): Likewise.
	(finish_builtin_type): Likewise.
	(finish_vtable_vardec): Use decl_function_context, not
	hack_decl_function_context.
	(import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	(start_static_initialization_or_destruction): Likewise.
	(finish_static_initialization_or_destruction): Likewise.
	(mark_used): Adjust logic for deciding when to synthesize methods.
	* dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	* error.c (dump_function_decl): Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	* friend.c (is_friend): Likewise.
	(add_friends): Remove.
	(do_friend): Use SET_DECL_FRIEND_CONTEXT.
	* lex.c (begin_definition_of_inclass_inline): Use
	decl_function_context, not hack_decl_function_context.
	(process_next_inline): Likewise.
	(do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
	* method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not
	DECL_CLASSS_CONTEXT.
	(hack_identifier): Likewise.
	(synthesize_method):  Use decl_function_context, not
	hack_decl_function_context.
	* pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(is_member_template): Use decl_function_context, not
	hack_decl_function_context.  Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	(build_template_decl): Set DECL_VIRTUAL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	(check_default_tmpl_args): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(push_template_decl_real): Likewise.
	(instantiate_class_template): Don't call add_friends.
	(tsubst_default_argument): Use DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
	Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	(set_meangled_name_for_template_decl): Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	* repo.c (repo_inline_used): Likewise.
	* search.c (current_scope): Adjust for new _CONTEXT macros.
	(context_for_name_lookup): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	(lookup_fnfields_here):Likewise.
	(check_final_overrider): Likewise.
	(init_vbase_pointers): Likewise.
	(virtual_context): Likewise.
	* semantics.c (finish_member_declaration): Just set DECL_CONTEXT.
	(expand_body): Use decl_function_context, not
	hack_decl_function_context.
	* tree.c (hack_decl_function_context): Remove.
	* typeck.c (build_x_function_call): Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	* typeck2.c (error_not_base_type): Likewise.

From-SVN: r32018
2000-02-16 23:54:23 +00:00
Kaveh R. Ghazi 158991b7e5 call.c: PROTO -> PARAMS.
* call.c: PROTO -> PARAMS.
        * class.c: Likewise.
        * cp-tree.h: Likewise.
        * cvt.c: Likewise.
        * decl.c: Likewise.
        * decl.h: Likewise.
        * decl2.c: Likewise.
        * dump.c: Likewise.
        * errfn.c: Likewise.
        * error.c: Likewise.
        * except.c: Likewise.
        * expr.c: Likewise.
        * init.c: Likewise.
        * input.c: Likewise.
        * lex.c: Likewise.
        * lex.h: Likewise.
        * method.c: Likewise.
        * optimize.c: Likewise.
        * parse.y: Likewise.
        * pt.c: Likewise.
        * repo.c: Likewise.
        * rtti.c: Likewise.
        * search.c: Likewise.
        * semantics.c: Likewise.
        * spew.c: Likewise.
        * tree.c: Likewise.
        * typeck.c: Likewise.
        * typeck2.c: Likewise.
        * xref.c: Likewise.

From-SVN: r31632
2000-01-26 20:51:37 +00:00
Mark Mitchell 1c2278974c pt.c (tsubst_friend_function): Improve comment.
* pt.c (tsubst_friend_function): Improve comment.
	(instantiate_decl): Avoid crashing when a "nested" function is
	instantiated from the top level.

From-SVN: r31403
2000-01-14 05:45:52 +00:00
Mark Mitchell e55e18d639 * dump.c (dequeue_and_dump): Handle CTOR_STMTs.
From-SVN: r31073
1999-12-22 18:00:58 +00:00
Mark Mitchell 89c6e7ac34 dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS.
* dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS.
	* ir.texi (DECL_NAMESPACE_ALIAS): Document it.

	* error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION.

From-SVN: r30925
1999-12-14 18:11:32 +00:00
Mark Mitchell 373eb3b3b1 dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not `csl'.
* dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not
	`csl'.

	* semantics.c (finish_switch_cond): Do conversions here, not ...
	* typeck.c (c_expand_start_case): Here.

	* semantics.c (do_poplevel): Remove unused variable.

From-SVN: r30840
1999-12-09 09:07:29 +00:00
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 9581dc651f * dump.c (dequeue_and_dump): Fix thinko for catch-clauses.
From-SVN: r30367
1999-11-03 06:54:37 +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 8badec73eb dump.c (dequeue_and_dump): Replace several uses of queue_and_dump_index with dump_child.
1999-10-21  Mark Mitchell  <mark@codesourcery.com>

	* dump.c (dequeue_and_dump): Replace several uses of
	queue_and_dump_index with dump_child.

From-SVN: r30123
1999-10-22 01:40:30 +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 56934d5c71 * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR.
From-SVN: r29849
1999-10-07 03:34:58 +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 3454335f03 dump.c (DUMP_CHILDREN): Remove.
* dump.c (DUMP_CHILDREN): Remove.
	(DUMP_BINFO): Adjust.
	(struct dump_node_info): Remove dump_children_p.
	(queue_and_dump_type): Remove dump_children_p parameter.
	(queue): Don't set dump_children_p.
	(dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to
	queue_and_dump_index.
	(dequeue_and_dump): Unconditionally print children.  Adjust calls
	to functions mentioned above.
	(dump_node):  Pass DUMP_NONE, instead of DUMP_CHILDREN to queue.

From-SVN: r29837
1999-10-06 05:35:38 +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 6f80451c66 cp-tree.def (VEC_INIT_EXPR): Remove.
* cp-tree.def (VEC_INIT_EXPR): Remove.
	* cp-tree.h (struct stmt_tree): New type.
	(struct saved_scope): Remove firstobj.  Add x_saved_tree,
	x_stmt_tree.
	(class_cache_firstobj): Remove.
	(struct language_function): Remove stmts_are_full_exprs_p,
	x_last_tree, and x_last_expr_type.  Add x_stmt_tree.
	(current_stmt_tree): New macro.
	(last_tree): Adjust.
	(last_expr_type): Likewise.
	(doing_semantic_analysis_p): Simplify.
	(stmts_are_full_exprs_p): Adjust.
	(begin_tree): Remove prototype.
	(end_tree): Likewise.
	(begin_stmt_tree): Change prototype.
	(finish_stmt_tree): Likewise.
	(building_stmt_tree): Simplify.
	* decl.c (mark_stmt_tree): New function.
	(mark_saved_scope): Use it.
	(start_function): Rearrange slightly to call begin_stmt_tree
	earlier.
	(save_function_data): Tweak.
	(finish_function): Adjust call to finish_stmt_tree.
	(mark_lang_function): Use mark_stmt_tree.
	* expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR.
	* init.c (build_new_1): Remove creation of VEC_INIT_EXPR.
	(build_vec_init): Remove creation of stand-in intializer.
	* pt.c (begin_tree): Remove.
	(end_tree): Likewise.
	* semantics.c (SET_LAST_STMT): New macro.  Use it throughout.
	(begin_compound_stmt): Handle a compound-statement outside of a
	function.
	(begin_stmt_expr): Handle a statement-expression outsidef of a
	function.
	(finish_stmt_expr): Likewise.
	(begin_class_definition): Don't call begin_tree.
	(finish_inline_definitions): Don't call end_tree.
	(begin_stmt_tree): Take a pointer to tree, not a function as input.
	(finish_stmt_tree): Likewise.
	* tree.c (search_tree): Don't handle VEC_INIT_EXPR.
	(mapcar): Likewise.

	* parse.y (simple_stmt): Don't call finish_stmt unnecessarily.
	* parse.c: Regenerated.

	* dump.c (dqueue_and_dump): Dump bitfieldness.

From-SVN: r29786
1999-10-03 18:57:37 +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 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 9f14fb6404 dump.c (dequeue_and_dump): Handle START_CATCH_STMT, CLEANUP_STMT, and SCOPE_STMT.
* dump.c (dequeue_and_dump): Handle START_CATCH_STMT,
	CLEANUP_STMT, and SCOPE_STMT.

From-SVN: r29564
1999-09-21 20:32:44 +00:00
Mark Mitchell 8a79e5cb72 dump.c (dequeue_and_dump): Dump types for constants.
* dump.c (dequeue_and_dump): Dump types for constants.
	Describe DECL_ARG_TYPE more intuitively.
	Handle ARRAY_REF.

From-SVN: r29245
1999-09-09 21:49:02 +00:00
Mark Mitchell acef433b61 cp-tree.def (LABEL_STMT): New tree node.
* cp-tree.def (LABEL_STMT): New tree node.
	(LABEL_STMT_LABEL): New macro.
	(shadow_label): Remove.
	(declare_local_label): New function.
	(finish_label_decl): Likewise.
	* decl.c (make_label_decl): New function, split out from
	lookup_label.
	(shadowed_labels): Remove.
	(binding_level): Add shadowed_labels.
	(clear_binding_level): Remove.
	(push_binding_level): Just bzero the new binding level.
	(pushlevel): Fix indentation.
	(pop_label): New function.
	(pop_labels): Likewise, split out from poplevel.
	(poplevel): Pop local labels.  Use pop_labels.
	(maybe_push_to_top_level): Don't clear shadowed_labels.
	(lookup_label): Use make_label_decl.
	(shadow_label): Remove.
	(declare_local_label): New function.
	(define_label): Simplify.
	(start_function): Don't clear shadowed_labels.
	(cp_function): Remove shadowed_labels.
	(push_cp_function_context): Don't save shadowed_labels.
	(pop_cp_function_context): Don't restore it.
	* dump.c (dequeue_and_dump): Handle LABEL_STMT.
	* parse.y (label_decl): Use finish_label_decl.
	* pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
	declarations.
	* semantics.c (finish_label_stmt): Add a LABEL_STMT when
	building_stmt_tree.
	(finish_label_decl): New function.
	(expand_stmt): Handle LABEL_STMTs and local label declarations.

From-SVN: r28943
1999-08-28 21:46:30 +00:00
Mark Mitchell ed6d16ade2 Fix typo in last change
From-SVN: r28917
1999-08-27 05:33:09 +00:00
Mark Mitchell 49124a6e01 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.
	* dump.c (deque_and_dump): Handle AGGR_INIT_EXPR.

From-SVN: r28916
1999-08-27 05:01:08 +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 37f26d6499 * dump.c (dequeue_and_dump): Dump TARGET_EXPRs.
From-SVN: r28867
1999-08-25 18:06:25 +00:00
Mark Mitchell 9d9169deaa cp-tree.def (STMT_EXPR): Fix typo in node name.
* cp-tree.def (STMT_EXPR): Fix typo in node name.

	* dump.c (dump_next_stmt): New function.
	(dequeue_and_dump): Use it.

	* pt.c (tsubst_copy): Make sure to initialize return value for a
	STMT_EXPR, even when processing_template_decl.
	* semantics.c (finish_stmt_expr): A statement-expression whose
	last statement is not an expression-statement has type `void'.

From-SVN: r28804
1999-08-22 18:11:40 +00:00
Mark Mitchell cfe507bee8 decl.c (add_decl_to_level): New function.
* decl.c (add_decl_to_level): New function.
	(push_local_binding): Use it.
	(find_binding): Fix typo in comment.
	(pushdecl): Use add_decl_to_level.  Put templates on the
	corresponding namespace-scope binding levels.
	* dump.c (dequeue_and_dump): Print the specializations of a
	template.
	* pt.c (push_template_decl_real): Don't push a template multiple
	times.

From-SVN: r28738
1999-08-17 22:35:19 +00:00
Mark Mitchell 9188c36364 cp-tree.def (DECL_STMT): Make it smaller.
* cp-tree.def (DECL_STMT): Make it smaller.
	* cp-tree.h (lang_decl_flags): Move saved_tree to ...
	(lang_decl): ... here.  Add next.
	(DECL_SAVED_TREE): Adjust accordingly.
	(DECL_IMPLICIT_TYPEDEF_P): New macro.
	(SET_DECL_IMPLICIT_TYPEDEF_P): Likewise.
	(DECL_STMT_DECL): Likewise.
	(create_implicit_typedef): New function.
	(maybe_push_decl): Likewise.
	(tsubst_default_argument): New function.
	(at_function_scope_p): Likewise.
	(add_decl_stmt): Likewise.
	(push_permanent_obstack): Likewise.
	* call.c (convert_default_arg): Use tsubst_default_argument.
	* class.c (add_method): Use push_permanent_obstack.
	(build_self_reference): Create a TEMPLATE_DECL for the
	self-reference, if necessary.
	* decl.c (pseudo_global_level_p): Only look at the current binding
	level.
	(push_binding): Use push_permanent_obstack.
	(create_implicit_typedef): New function.
	(pushtag): Use it.
	(duplicate_decls): Use push_permanent_obstack.
	(maybe_push_decl): New function.
	(start_decl): Use it.  Remove dead code.  Use add_decl_stmt.
	(start_decl_1): Remove dead code.
	(cp_finish_decl): Remove DECL_STMT handling here.  Don't use
	pseudo_global_level_p.
	(grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a
	template.
	(grokdeclarator): Likewise, for TYPE_DECLs.  Don't use
	pseudo_global_level_p.
	* decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in
	a template.
	(get_sentry): Use push_permanent_obstack.
	* dump.c (dequeue_and_dump): Enable DECL_STMT.
	* except.c (call_eh_info): Use push_permanent_obstack.
	(build_eh_type_ref): Likewise.
	(do_pop_exception): Likewise.
	(expand_eh_spec): Likewise.
	(alloc_eh_object): Likewise.
	(expand_throw): Likewise.
	* init.c (build_java_class_ref): Likewise.
	* lex.c (get_time_identifier): Likewise.
	(free_lang_decl_chain): Correct type.
	(retrofit_lang_decl): Adjust accordingly.
	(build_lang_field_decl): Likewise.
	* lex.h (free_lang_decl_chain): Likewise.
	* parse.y (lang_extdef): Don't use pseudo_global_level_p.
	* parse.c: Regenerated.
	* pt.c (tsubst_default_arguments): New function.
	(retrieve_local_specialization): Likewise.
	(register_local_specialization): Likewise.
	(push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P.  Just use
	pseudo_global_level_p to determine whether or not a template is
	primary.
	(lookup_template_class): Likewise.  Use create_implicit_typedef.
	(instantiate_class_template): Call tsubst_default_arguments for
	member functions, if appropriate.
	(tsubst_default_argument): New function.
	(tsubst_decl): Use it.  Change TYPE_DECL handling to match VAR_DECLs.
	* search.c (at_function_scope_p): New function.
	* semantics.c (finish_asm_stmt): Use push_permanent_obstack.
	(finish_label_stmt): Likewise.
	(add_decl_stmt): New function.
	(begin_class_definition): Likewise.
	(finish_typeof): Likewise.
	* tree.c (copy_template_template_parm): Likewise.
	(copy_to_permanent): Likewise.
	(push_permanent_obstack): Define.
	(mark_addressable): Use it.
	* typeck.c (mark_addressable): Likewise.

From-SVN: r28709
1999-08-14 09:23:49 +00:00
Mark Mitchell c6a9738c04 dump.c (queue): Be careful when computing bitmasks.
* dump.c (queue): Be careful when computing bitmasks.
	(dequeue_and_dump): Describe binfos as binfos, not as
	vectors.

From-SVN: r28679
1999-08-11 20:40:11 +00:00
Kaveh R. Ghazi 9c0758dde6 class.c (count_fields, [...]): Add static prototype.
* class.c (count_fields, add_fields_to_vec): Add static prototype.

	* cp-tree.h (opname_tab, assignop_tab, operator_name_string,
	get_id_2, composite_pointer_type, dump_node_to_file): Constify a
	char*.

	* decl.c (named_label_list, cp_finish_decl, grokdeclarator):
	Constify a char*.

	* decl2.c (finish_static_data_member_decl, grokfield): Constify a
	char*.

	* dump.c (queue_and_dump_index, dump_int, dump_string,
	dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
	a char*.
	(dump_stmt): Add static prototype.

	* errfn.c (cp_thing): Constify a char*.

	* error.c (dump_unary_op, dump_binary_op, aggr_variety,
	dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
	dump_expr): Constify a char*.

	* lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
	read_line_number): Add static prototype.
	(opname_tab, assignop_tab, operator_name_string): Constify a char*.
	(real_yylex): Move label `letter' into the scope where it is used.

	* method.c (build_mangled_template_parm_index, build_overload_int,
	build_decl_overload_real, get_id_2): Constify a char*.

	* search.c (check_final_overrider): Make static.

	* typeck.c (composite_pointer_type): Constify a char*.

From-SVN: r28588
1999-08-07 22:28:52 +00:00
Mark Mitchell f71f87f9eb invoke.texi (-fdump-translation-unit): New option.
* invoke.texi (-fdump-translation-unit): New option.
	* Make-lang.in (CXX_SRCS): Add dump.c.
	* Makefile.in (CXX_OBJS): Add dump.o.
	(dump.o): New target.
	* cp-tree.h (DECL_CONV_FN_P): Document.
	(DECL_OVERLOADED_OPERATOR_P): New function.
	(TYPE_PTRMEM_CLASS_TYPE): New macro.
	(TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
	(PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
	(ASM_VOLATILE_P): New macro.
	(STMT_LINENO): Likewise.
	(cp_namespace_decls): New function.
	(dump_node_to_file): New function.
	* decl.c (cp_namespace_decls): New function.
	(walk_namespaces_r): Use it.
	(wrapup_globals_for_namespace): Likewise.
	* decl2.c (flag_dump_translation_unit): New variable.
	(lang_decode_option): Handle -fdump-translation-unit.
	(finish_file): If flag_dump_translation_unit is set, dump the
	translation unit.
	* dump.c: New file.
	* lang-options.h: Add -fdump-translation-unit.
	* pt.c (tsubst_template_parms): Robustify.
	(tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
	(tsubst_expr): Use STMT_LINENO.
	* semantics.c (finish_asm_stmt): Eliminate duplicate code.  Check
	for invalid cv-qualifiers even while building templates.

From-SVN: r28434
1999-08-03 01:37:47 +00:00