aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/expr.c
AgeCommit message (Collapse)AuthorFilesLines
2000-10-06cp-tree.h (struct cp_language_function): Remove x_result_rtx.Richard Henderson1-30/+0
* cp/cp-tree.h (struct cp_language_function): Remove x_result_rtx. (original_result_rtx): Remove. * cp/decl.c (save_function_data): Don't clear x_result_rtx. (mark_lang_function): Don't mark it either. * cp/expr.c (fixup_result_decl): Remove. * cp/semantics.c (genrtl_named_return_value): Frob the return decl before calling emit_local_var. (genrtl_finish_function): Don't call fixup_result_decl. Always emit the jump to return_label. From-SVN: r36770
2000-09-17splay-tree.c (splay_tree_predecessor): Fix typo in comment.Mark Mitchell1-21/+1
* splay-tree.c (splay_tree_predecessor): Fix typo in comment. Convert the C front-end to use function-at-a-time mode. * c-common.h: Include splay-tree.h. (C_DECLARED_LABEL_FLAG): New macro. (struct language_function): Add x_scope_stmt_stack and x_function_name_declared_p. (RECHAIN_STMTS): Move definition. (lang_statment_code_p): Likewise. (lang_expand_stmt): Likewise. (lang_expand_decl_stmt): New variable. (lang_expand_function_end): Likewise. (current_scope_stmt_stack): New function. (add_decl_stmt): Likewise. (add_scope_stmt): Likewise. (mark_stmt_tree): Likewise. (struct c_lang_decl): New structure. (DECL_SAVED_TREE): Define. (c_mark_lang_decl): New function. (c_expand_start_cond): Change prototype. (c_finish_then): New function. (c_finish_else): Likewise. (current_function_name_declared): Remove. (set_current_function_name_declared): Likewise. (mark_c_language_function): Declare. (case_compare): Likewise. (c_add_case_label): Likewise. (c_expand_expr): Likewise. (c_safe_from_p): Likewise. * c-common.c (lang_expand_function_end): New variable. (struct if_elt): Add if_stmt. (c_expand_start_cond): Add the if-statement to the statement-tree, rather than generating RTL. (c_finish_then): New function. (c_expand_start_else): Don't generate RTL. (c_finish_else): New function. (c_expand_expr_stmt): Don't generate RTL. (statement_code_p): Add SCOPE_STMT. (case_compare): New function. (c_add_case_label): Likewise. (mark_stmt_tree): Likewise. (c_mark_lang_decl): Likewise. (mark_c_language_function): Likewise. (c_expand_expr): Likewise. (c_safe_from_p): Likewise. * c-decl.c (c_stmt_tree): New variable (c_scope_stmt_stack): Likewise. (c_function_name_declared_p): Likewise. (lang_expand_expr_stmt): Remove. (poplevel): Don't call output_inline_function for nested functions. (pushdecl): Don't set DECL_CONTEXT for a local declaration of an `extern' function. (redeclaration_error_message): Change means of computing whether or not a function is nested. (lookup_label): Don't call label_rtx. (init_decl_processing): Add more GC roots. (start_decl): Add DECL_STMTs to the statement-tree, rather than calling rest_of_decl_compilation. (finish_decl): Don't call expand_decl. (store_parm_decls): Begin the statement-tree, but don't generate RTL. (finish_function): Tie off the statement-tree. Call c_expand_body if appropriate. (c_expand_body): New function. (push_c_function_context): Save more information. (pop_c_function_contxt): Likewise. (copy_lang_decl): Now that we use DECL_LANG_SPECIFIC, copy it. (lang_mark_tree): Mark it. (current_stmt_tree): Adjust. (current_scope_stmt_stack): New function. (do_case): Remove. (set_current_name_declared): Likewise. (c_begin_compound_stmt): Define. (c_expand_decl_stmt): Likewise. * c-lang.c: Include rtl.h and expr.h. (lang_init): Set more language-specific hooks. * c-lex.c: Include expr.h. * c-parse.in: Changes throughout to add statements to the statement-tree, rather than generating RTL after every statement. * c-semantics.c (lang_expand_decl_stmt): Define. (add_decl_stmt): New function. (add_scope_stmt): Likewise. (finish_stmt_tree): Tweak. (genrtl_expr_stmt): Likewise. (genrtl_decl_stmt): Handle local labels, and call lang_expand_decl_stmt if required. (genrtl_for_stmt): Fix line-number handling. (genrtl_case_label): Handle cleanups. (genrtl_asm_stmt): Don't call combine_strings. (genrtl_compound_stmt): Simplify. (expand_stmt): Handle SCOPE_STMTs. * c-tree.h (struct lang_decl): New structure. (C_DECLARED_LABEL_FLAG): Remove. (c_begin_compound_stmt): Declare. (c_expand_decl_stmt): Likewise. (c_expand_start_case): Rename to c_start_case. (c_finish_case): New function. * c-typeck.c (start_init): Tweak setting of constructor_incremental. (c_expand_asm_operands): Tweak error-handling. Add to the statement-tree. (c_expand_return): Add to the statement-tree. (c_expand_start_case): Rename to ... (c_start_case): ... this. (struct c_switch): New type. (switch_stack): New variable. (do_case): Simplify. (c_finish_case): New function. * dependence.c: Include expr.h. (enum dependence_type): Change spelling of enumerals. (check_node_dependence): Adjust. * expr.h (lang_safe_from_p): Declare. (safe_from_p): Likewise. * expr.c (lang_safe_from_p): New variable. (safe_from_p): Give it external linkage. Use lang_safe_from_p. * stmt.c (expand_expr_stmt): Avoid clobberring of last_expr_type. * toplev.c (rest_of_decl_compilation): Robustify. * tree.c (contains_placeholder_p): Likewise. * Makefile.in: Update dependencies. * objc/objc-act.h: Adjust calculation of value for dummy_tree_code. * objc/objc-act.c: Include rtl.h, expr.h, and c-common.h. (objc_expand_function_end): New function. (finish_method_def): Use it. (init_objc): Initialize more language-specific hooks. * objc/Make-lang.in: Update dependencies. * cp-tree.h (struct cp_language_function): Remove x_scope_stmt_stack and name_declared. (current_scope_stmt_stack): Remove. (function_name_declared_p): New macro. (struct lang_decl_flags): Use c_lang_decl as a base class. (context): Remove. (struct lang_decl): Replace saved_tree with context. (DECL_FRIEND_CONTEXT): Adjust accordingly. (SET_DECL_FRIEND_CONTEXT): Likewise. (DECL_VIRTUAL_CONTEXT): Likewise. (DECL_SAVED_TREE): Remove. (C_DECLARED_LABEL_FLAG): Likewise. (cplus_expand_expr_stmt): Don't declare. (add_decl_stmt): Likewise. (add_scope_stmt): Likewise. * decl.c (mark_stmt_tree): Remove. (case_compare): Likewise. (finish_case_label): Use c_add_case_label. (init_decl_processing): Set more language-specific hooks. (build_enumerator): Fix typo in comment. (cplus_expand_expr_stmt): Remove. (mark_lang_function): Use mark_c_language_function. (lang_mark_tree): Use c_mark_lang_decl. * decl2.c: Change order of inclusion. * except.c: Likewise. * expr.c (cplus_expand_expr): Remove handling of STMT_EXPR. Fall back on c_expand_expr. * friend.c: Include expr.h. * init.c: Change order of inclusion. * Makefile.in: Update dependencies. * lex.h (free_lang_decl_chain): Remove. * optimize.c (maybe_clone_body): Use function_name_declared_p. * pt.c (build_template_decl): Don't copy DECL_VIRTUAL_CONTEXT if it doesn't exist. (instantiate_decl): Use function_name_declared_p. * semantics.c (lang_expand_expr_stmt): Remove. (set_current_function_name_declared): Likewise. (current_function_name_declared): Likewise. (begin_compound_stmt): Use function_name_declared_p. (add_decl_stmt): Remove. (setup_vtbl_ptr): Use function_name_declared_p. (add_scope_stmt): Remove. (current_scope_stmt_stack): New function. (cp_expand_stmt): Don't handle SCOPE_STMTs. (expand_body): Use function_name_declared_p. * tree.c (cp_statement_code_p): Don't include SCOPE_STMT. * typeck.c: Change order of includes. (convert_sequence): Remove. From-SVN: r36464
2000-09-10c-common.h (add_stmt): Change prototype.Mark Mitchell1-79/+0
* c-common.h (add_stmt): Change prototype. (RECHAIN_STMTS): New macro. (CASE_LABEL_DECL): Likewise. (genrtl_case_label): Change prototype. (c_expand_start_case): Remove prototype. (build_case_label): Change prototype. (decl_constant_value): Declare. * c-common.c (check_case_value): Handle C++'s extensions to C semantics. * c-commnon.def (CASE_LABEL): Add room for the CASE_LABEL_DECL field. * c-parse.in (stmt): Adjust handling of return statements and case laels. * c-semantics.c (add_stmt): Return the new statement. (genrtl_return_stmt): Take the RETURN_STMT as input, not the returned expression. Directly generate RTL, rather than calling c_expand_return. (genrtl_switch_stmt): Don't call c_expand_start_case. (build_case_label): Take the LABEL_DECL as input, too. (genrtl_case_label): Just call add_case_node. (expand_stmt): Adjust calls to genrtl_return_stmt and genrtl_case_label. * c-tree.h (c_expand_start_case): Declare. * c-typeck.c (decl_constant_value): Give it external linkage. (c_expand_return): Don't call expand_return or expand_null_return; use genrtl_return_stmt instead. * stmt.c (struct nesting): Remove num_ranges field. (add_case_node): Give it external linkage. (expand_start_case): Don't set num_ranges. (expand_start_case_dummy): Don't clear it. (pushcase): Rely on add_case_node to handle `default' labels. (add_case_node): Handle `default' labels. * tree.c (tree_int_cst_compare): New function. * tree.h (tree_int_cst_compare): Declare. (add_case_node): Likewise. * cp-tree.h (push_switch): Change prototype. (check_cp_case_value): Remove declaration. (decl_constant_value): Likewise. * decl.c (struct cp_switch): Add switch_stmt and cases. (case_compare): New function. (push_switch): Set switch_stmt. Initialize cases. (pop_switch): Clean up cases. (define_case_label): Rename to ... (finish_case_label): ... this. Do semantic analysis for case labels here. (start_function): Correct comment. * decl2.c (check_cp_case_value): Remove. * expr.c (do_case): Remove. * pt.c (tsubst_expr): Adjust call to finish_case_label. * semantics.c (genrtl_do_poplevel): Remove declaration. (RECHAIN_STMTS): Remove. (finish_break_stmt): Use build_break_stmt. (finish_continue_stmt): Use build_continue_stmt. (finish_switch_cond): Adjust condition here, rater than in c_expand_start_case. (finish_case_label): Remove. * typeck.c (c_expand_return): Remove. (c_expand_start_case): Likewise. From-SVN: r36305
2000-06-04Make-lang.in (CXX_SRCS): Add mangle.c.Alex Samuel1-79/+0
* Make-lang.in (CXX_SRCS): Add mangle.c. * Makefile.in (CXX_OBJS): Add mangle.o. (mangle.o): New rule. Co-Authored-By: Mark Mitchell <mark@codesourcery.com> From-SVN: r34394
2000-05-03cp-tree.def (THUNK_DECL): Remove.Mark Mitchell1-4/+0
* 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-01expr.c (cplus_expand_expr): Preserve temporaries when expanding STMT_EXPRs.Mark Mitchell1-2/+13
* expr.c (cplus_expand_expr): Preserve temporaries when expanding STMT_EXPRs. * optimize.c (struct inline_data): Add target_exprs field. (declare_return_variable): When a function returns an aggregate, use the variable declared in the TARGET_EXPR as the remapped DECL_RESULT. (expand_call_inline): Update the pending target_exprs stack. (optimize_function): Initialize the stack. From-SVN: r33561
2000-03-25* Rework fields used to describe positions of bitfields andRichard Kenner1-12/+3
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-19cp-tree.h (CLEAR_DECL_C_BIT_FIELD): New macro.Mark Mitchell1-5/+12
* cp-tree.h (CLEAR_DECL_C_BIT_FIELD): New macro. * class.c (check_bitfield_decl): Turn illegal bitfields into non-bitfields. (dfs_propagate_binfo_offsets): Adjust for new size_binop semantics. (dfs_offset_for_unshared_vbases): Likewise. * cvt.c (cp_convert_to_pointer): Convert NULL to a pointer-to-member correctly under the new ABI. * expr.c (cplus_expand_constant): Don't use cp_convert when turning an offset into a pointer-to-member. * init.c (resolve_offset_ref): Don't adjust pointers-to-members when dereferencing them under the new ABI. * typeck.c (get_member_function_from_ptrfunc): Tweak calculation of pointers-to-members under the new ABI. From-SVN: r32631
2000-03-17* Clean up usages of TREE_INT_CST_LOW.Richard Kenner1-1/+1
* c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerated. * c-tree.h (min_precision): Move declaration to here. * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. (build_unary_op, add_pending_init): Use bit_position. (pending_init_member, process_init_element): Likewise. (really_start_incremental_init, push_init_level, pop_init_level): Don't make copies of nodes or modify them in place, use consistent types when tracking positions, and use tree routines computations. (set_init_index, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, tree_low_cst and int_bit_position; also minor cleanup. (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. (print_cst_octal): Precision is unsigned. (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. (simple_type_align_in_bits): Result is unsigned int. Use tree_int_low_cst and host_integerp. (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. (field_byte_offset): Result is HOST_WIDE_INT. Change types of internal variables so alignments are unsigned int, offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. Use host_integerp, tree_low_cst, and int_bit_position. (add_bit_offset_attribute): Likewise. (add_data_member_location_attribute): Use tree_cst_low. (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. (add_bit_size_attribute): Use tree_low_cst. (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. * dwarfout.c: Similar changes to dwarf2out.c. * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. * genoutput.c (n_occurences): Return -1 for null string. (strip_whitespace): Accept null string and make into function. (scan_operands): Reflect above changes. * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. * ssa.c (rename_registers): Add missing cast of arg to bzero. * tree.c (int_size_in_bytes): Check for too big to represent. (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): New declarations. (min_precision): Delete from here. * varasm.c (decode_addr_const): Use host_integerp, bit_position, and int_bit_position. * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. (encode_method_def): Likewise. (build_ivar_list_initializer): Use int_bit_position. (generate_shared_structures): Convert size. (encode_type, encode_complete_bitfield): Use integer_zerop. (encode_bitfield): Use tree_low_cst and int_bit_position. * ch/typeck.c (min_precision): New function. (build_chill_slice): Use host_integerp and tree_low_cst. (expand_constant_to_buffer): Likewise and also int_bit_position. LO is unsigned HOST_WIDE_INT (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst. (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT. Use host_integerp and tree_low_cst. (build_chill_bin_type): Use host_integerp and tree_low_cst. (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int, tree_low_cst, and min_precision. (apply_chill_array_layout): Cleanups for types of variables and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst. (apply_chill_field_layout): Likewise. * cp/class.c (build_vbase_path): Use integer_zerop. (build_vtable_entry): Use tree_low_cst. (get_vfield_offset): Use bit_position. (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. Use tree_low_cst. (check_bitfield_decl): Set DECL_SIZE using convert. (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. Use tree_low_cst. (finish_struct_1): Use bit_position. (dump_class_hierarchy): Use tree_low_cst. * cp/cp-tree.h (min_precision): Add declaration. * cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst. * cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst. (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. * cp/expr.c (cplus_expand_constant): Use bit_position. * cp/init.c (build_vec_init): Use host_integerp and tree_low_cst. * cp/rtti.c (get_base_offset): Use bit_position. * cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, host_integerp, and tree_low_cst. (pointer_int_sum): Use integer_zerop. (build_component_addr): Use bit_position. * java/class.c (make_field_value): Properly handle sizes. (get_dispatch_vector): Use tree_low_cst and host_integerp. (layout_class_method): Count using trees. * java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node. * java/expr.c (java_array_data_offset): Use int_bit_position. (build_newarray, build_anewarray): Use host_integerp and tree_low_cst. (build_invokevirtual): Use tree_low_cst and do computations with trees. From-SVN: r32607
2000-03-06function.c (free_temps_for_rtl_expr): Don't free slots that have been pushed ↵Mark Mitchell1-1/+0
into a higher level. * function.c (free_temps_for_rtl_expr): Don't free slots that have been pushed into a higher level. * expr.c (cplus_expand_expr, case STMT_EXPR): Don't set RTL_EXPR_HAS_NO_SCOPE after all. From-SVN: r32355
2000-03-05expr.c (cplus_expand_expr, [...]): Use expand_start_stmt_expr and ↵Mark Mitchell1-2/+3
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-02-27builtins.c (c_strlen): Use size_diffop and return ssizetype value.Richard Kenner1-3/+2
* builtins.c (c_strlen): Use size_diffop and return ssizetype value. (expand_builtin_strcpy): Pass correct type to size_binop. (expand_builtin_strcmp): Likewise. Clean up conditional structure. * c-decl.c (init_decl_processing): Don't call set_sizetype twice. (complete_array_type): Don't use size_binop for MAXINDEX. * c-typeck.c (c_sizeof): Use size_one_node and TYPE_SIZE_UNIT. (c_sizeof_nowarn, c_size_in_bytes): Likewise. (c_alignof): Use size_one_node. (build_unary_op): Pass arg of proper type to size_binop. (really_start_incremental_init, push_init_level): Use sizetype for constructor{,_bit,_unfilled}_index. (pop_init_label, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * calls.c (compute_argument_block_size): Field VAR is ssizetype. * expr.c (store_expr): Use size_int. (store_constructor): Use proper types for size_binop args. (get_inner_reference, expand_expr, case ARRAY_REF): Likewise. (expand_expr_unaligned): Likewise. (string_contant): Return object of sizetype. * expr.h (SUB_PARM_SIZE): Call size_diffop and pass proper types. (ARGS_SIZE_RTX): Call ARGS_SIZE_TREE. (ARGS_SIZE_TREE): Pass proper types to size_binop. * fold-const.c (int_const_binop): Refine when size_int is called. (fold_convert): Likewise. (size_int_wide): Rework to take KIND as arg, only take low order bits, handle new sizetype_tab datatype, and chain entries in size_table. (size_int_type_wide): New function. (size_binop): Validate types of arguments. (ssize_binop): Deleted. (size_diffop): New function. (extract_muldiv): Only fold division into multiplication for sizetypes. * function.c (assign_parms): Use size_diffop and make sure VAR field is of ssizetype; also pass proper type to size_binop. (locate_and_pad_parm, pad_to_arg_alignment): Likewise. (round_down): Deleted from here. * store-layout.c (sizetype_tab): Now an array. (sizetype_set, early_root_list): New variables. (variable_size): Use size_one_node. (round_up): Pass proper type to size_binop. (round_down): Moved to here and corrected as above. (layout_record): Pass proper arg types to size_binop. (layout_type): Likewise. If sizetype_set is zero, record the type just laid out. (make_unsigned_type): Don't call set_sizetype; (make_signed_type): Likewise; also, call fixup_signed_type. (initialize_sizetypes): New function. (set_sizetype): Make copy of types, set TYPE_IS_SIZETYPE, and set name of bitsizetype to "bit_size_type". Fix up type of sizes of all types made before call. * tm.texi (ROUND_TYPE_SIZE_UNIT): New macro. * tree.c (fix_sizetype): Deleted. (build_common_tree_nodes): Call initialize_sizetypes. (build_common_tree_nodes_2): Don't call fix_sizetype. * tree.h (TYPE_IS_SIZETYPE): New macro. (initialize_sizetype): New declaration. (enum size_type_kind): New type. (struct sizetype_tab): Deleted. (sizetype_tab): Now array; adjust sizetype macros. (size_diffop, size_int_type_wide): New functions. (size_int_wide): Change number of args and type; access macros changed. (ssize_int, sbitsize_int): New macros. * config/i960/i960.h (ROUND_TYPE_SIZE): Use size_int. (ROUND_TYPE_SIZE_UNIT): New macro. * ch/actions.c (chill_convert_for_assignment): Don't use size_binop for things that aren't sizes. (expand_varying_length_assignment): Likewise. * ch/convert.c (digest_array_tuple, convert): Likewise. * ch/typeck.c (build_chill_slice, smash_dummy_type): Likewise. (build_chill_slice_with_range): Likewise. (build_chill_slice_with_length): Likewise. (build_array_from_set): Adjust types for size_binop. * ch/expr.c (build_concat_expr, build_chill_repetition_op): Likewise. (build_chill_sizeof): Use TYPE_SIZE_UNIT. * ch/tree.c (build_string_type): Pass proper type to size_binop. * cp/class.c (dfs_build_vtable_offset_vtbl_entries): Don't use size_binop on things that are not sizes; ssize_binop deleted. Call size_diffop when appropriate. (dfs_build_vcall_offset_vtbl_entries): Likewise. (build_primary_vtable, build_secondary_vtable): Likewise. (dfs_set_offset_for_unshared_vbases, dfs_modify_vtables): Likewise. Variable I is HOST_WIDE_INT. (get_vfield_offset): Pass proper types to size_binop. (size_extra_vtbl_entries, layout_virtual_bases): Likewise. (finish_struct_1): Likewise. (skip_rtti_stuff): Arg N is now pointer to signed. (layout_class_type): Use size_zero_node. * cp/cp-tree.h (skip_rtti_stuff): Arg N is pointer to signed. * cp/cvt.c (cp_convert_to_pointer): Pass proper types to size_binop. * cp/decl.c (complete_arry_type): Pass proper types to size_binop. (xref_basetypes): BINFO_OFFSET is sizetype. * cp/error.c (dump_expr): Don't use size_binop non-sizes. * cp/expr.c (cplus_expand_constant): Pass proper types to size_binop. * cp/init.c (construct_virtual_bases): Fix type error. (build_vec_delete_1): Pass proper type to size_binop and don't fold result. * cp/lex.c (cp_make_lang_type): BINFO_OFFSET is sizetype. * cp/rtti.c (get_base_offset): Pass proper type to size_binop. * cp/search.c (dfs_find_vbases): Fix type error. (expand_upcast_fixups): Arg to skip_rtti_stuff is pointer to signed. (dfs_get_vbase_types): BINFO_OFFSET is sizetype. * cp/tree.c (debug_binfo): Variable N is signed. Use HOST_WIDE_INT_PRINT_DEC. * cp/typeck.c (comptypes): sizetype is same as equivalent integer type. (c_sizeof, c_sizeof_nowarn, expr_sizeof): Use TYPE_SIZE_UNIT, size_one_node and size_zero_node. (c_alignof): Use size_one_node. (build_component_addr): Pass proper types to size_binop. (expand_ptrmemfunc_cst): Don't use size_binop on non-sizes. * f/com.c (ffecom_arrayref_): Convert args to size_binop to proper type. (ffecom_tree_canonize_ptr_): Don't use size_binop for non-sizes. (ffecom_tree_canonize_ref_): Likewise. (type_for_mode): Handle TImode. * f/ste.c (ffeste_io_dofio_, ffeste_io_douio_): Use TYPE_SIZE_UNIT. (ffeste_io_ciclist_): Likewise. * java/expr.c (build_java_ret): Pass proper type to size_binop. From-SVN: r32225
2000-02-26Fix copyrightsJeff Law1-1/+2
From-SVN: r32185
2000-02-21call.c (build_object_call): Compress consecutive calls to cp_error.Gabriel Dos Reis1-1/+1
2000-02-21 Gabriel Dos Reis <gdr@codesourcery.com> * call.c (build_object_call): Compress consecutive calls to cp_error. (build_conditional_expr): Say 'ISO C++' not 'ANSI C++'. (build_op_delete_call): Adjust message formatting. * class.c (check_bases): Compress consecutive calls to cp_pedwarn. (finish_struct_anon): Say 'ISO C++'. * decl.c (start_decl): Same here. (grok_reference_init): Likewise. (grokfndecl): Correct message formatting. (grokfndecl): Improve diagnostic. (check_static_variable_definition): Likewise. Say 'ISO C++' (compute_array_index_type): Say 'ISO C++' (create_array_type_for_decl): Compress consecutive calls to cp_error. (grokdeclarator): Say 'ISO C++' (grok_op_properties): Likewise. * decl2.c (delete_sanity): Clairify diagnostic. (check_member_template): Same here. (grok_function_init): Use consistent terminology. * expr.c (do_case): Say 'ISO C++' * friend.c (do_friend): Compress consecutive calls to warning. From-SVN: r32090
2000-01-26call.c: PROTO -> PARAMS.Kaveh R. Ghazi1-3/+3
* 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-16cp-tree.h (num_extra_vtbl_entries): New function.Mark Mitchell1-1/+2
* cp-tree.h (num_extra_vtbl_entries): New function. (size_extra_vtbl_entries): Likewise. (dfs_vtable_path_unmark): Likewise. (dfs_vtable_path_unmarked_real_bases_queue_p): Likewise. (dfs_vtable_path_marked_real_bases_queue_p): Likewise. * class.c (num_extra_vtbl_entries): New function. (size_extra_vtbl_entries): Likewise. (dfs_build_vbase_offset_vtbl_entries): New function. (build_vbase_offset_vtbl_entries): Likewise. (build_vtbl_initializer): Use it. (finish_struct_1): Adjust vtable sizes (using num_extra_vtbl_entries). * expr.c (cplus_expand_expr): Assert that the DECL_RTL for a THUNK_DECL is non-NULL before expanding it. * init.c (expand_virtual_init): Adjust the vtable pointer by size_extra_vtbl_entries before storing it. * search.c (get_shared_vase_if_not_primary): Adjust prototype. Handle TREE_LIST parameters here, not in the dfs_* functions. (dfs_unmarked_real_bases_queue_p): Adjust. (dfs_marked_real_bases_queue_p): Likewise. (dfs_vtable_path_unmarked_real_bases_queue_p): New function. (dfs_vtable_path_marked_real_bases_queue_p): New function. (dfs_vtable_path_unmark): Likewise. From-SVN: r31439
1999-12-09decl.c (init_decl_processing): Reenable inlining on trees.Mark Mitchell1-96/+0
* decl.c (init_decl_processing): Reenable inlining on trees. (finish_function): Likewise. * expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here. * semantics.c (simplify_aggr_init_exprs): New function. (expand_body): Use it. * tree.c (walk_tree): Special-case TARGET_EXPRs since they sometimes present the same sub-tree twice. From-SVN: r30849
1999-11-14cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.Mark Mitchell1-2/+0
* cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro. * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not TREE_PERMANENT. * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P. * decl2.c (lookup_arg_dependent): Use it. * cp-tree.h (cp_finish_decl): Change prototype. (finish_static_data_member_decl): Likewise. (push_permanent_obstack): Remove declaration. (push_expression_obstack): Likewise. (push_scratch_obstack): Likewise. (DECL_TEMPLATE_PARM_P): Robustify. (SET_DECL_TEMPLATE_PARM_P): New macro. * class.c (add_method): Don't manipulate obstacks. (finish_vtbls): Likewise. * cvt.c (build_up_reference): Adjust calls to cp_finish_decl. * decl.c (binding_for_name): Don't manipulate obstacks. (maybe_push_to_top_level): Likewise. (pop_from_top_level): Likewise. (duplicate_decls): Likewise. (pushdecl): Likewise. (implicitly_declare): Likewise. (build_typename_type): Likewise. (start_decl): Likewise. (cp_finish_decl): Likewise. (finish_decl): Likewise. (destroy_local_static): Likewise. (expand_static_init): Likewise. (complete_array_type): Likewise. (grokvardecl): Likewise. (build_ptrmemfnc_type): Likewise. (grokdeclarator): Likewise. (xref_tag): Likewise. (xref_basetypes): Likewise. (start_enum): Likewise. (finish_enum): Likewise. (start_function): Likewise. (finish_function): Likewise. (start_method): Adjust call to cp_finish_decl. * decl2.c (finish_static_data_member_decl): Don't manipulate obstacks. (grokfield): Likewise. (grokbitfield): Likewise. (get_temp_name): Likewise. (get_sentry): Likewise. (fnish_file): Likewise. (lookup_arg_dependent): Likewise. * except.c (call_eh_info): Likewise. (push_eh_info): Likewise. (do_pop_exception): Likewise. (initialize_handler_parm): Likewise. (expand_end_eh_spec): Likewise. (alloc_eh_object): Likewise. (expand_throw): Likewise. * expr.c (extract_scalar_init): Likewise. * init.c (build_java_class_ref): Likewise. * lex.c (get_time_identifier): Likewise. (snarf_defarg): Likewise. (add_defarg_fn): Likewise. (is_global): Simplify. (do_identifier): Don't check TREE_PERMANENT. * method.c (emit_thunk): Don't manipulate obstacks. * parse.y (condition): Adjust call to cp_finish_decl. (primary): Likewise. (initdcl): Likewise. (initdcl0_innards): Likewise. (nomods_initdcl0): Likewise. * pt.c (push_inline_template_parms_recursive): Use SET_DECL_TEMPLATE_PARM_P. (process_template_parm): Likewise. (lookup_template_class): Don't manipulate obstacks. (instantiate_class_template): Adjust call to finish_static_data_member_decl. (tsubst_decl): Don't manipulate obstacks. (tsubst_expr): Likewise. (instantiate_template): Likewise. (instantiate_decl): Adjust calls to cp_finish_decl. * rtti.c (call_void_fn): Don't manipulate obstacks. (get_tinfo_var): Likewise. (get_tinfo_fn_unused): Likewise. (build_dynamic_cast_1): Likewise. (expand_si_desc): Likewise. (expand_class_desc): Likewise. (expand_ptr_desc): Likewise. (expand_attr_desc): Likewise. (expand_generic_desc): Likewise. (synthesize_tinfo_fn): Likewise. * search.c (expand_upcast_fixups): Likewise. * semantics.c (finish_asm_stmt): Likewise. (finish_named_return_value): Likewise. (begin_class_definition): Likewise. (finish_class_definition): Likewise. (finish_typeof): Likewise. * tree.c (build_cplus_method_type): Likewise. (reverse_path): Likewise. (copy_template_template_parm): Likewise. (build_expr_ptr_wrapper): Likewise. (push_expression_obstack): Remove. (push_permanent_obstack): Likewise. * typeck.c (mark_addressable): Likewise. From-SVN: r30527
1999-10-22cp-tree.def (EMPTY_CLASS_EXPR): New tree node.Mark Mitchell1-0/+4
* cp-tree.def (EMPTY_CLASS_EXPR): New tree node. * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR. * expr.c (cplus_expand_expr): Expand it. * ir.texi: Document EMPTY_CLASS_EXPR. From-SVN: r30128
1999-10-21calls.c: Include tm_p.h later, so everything we need is defined.Kaveh R. Ghazi1-0/+1
* calls.c: Include tm_p.h later, so everything we need is defined. * expr.c: Likewise. * function.c: Likewise. * except.c: Include tm_p.h. * sparc.c: Likewise. (dwarf2out_cfi_label): Don't prototype. (check_return_regs, epilogue_renumber, ultra_cmove_results_ready_p, ultra_fpmode_conflict_exists, ultra_find_type, ultra_build_types_avail, ultra_flush_pipeline, ultra_rescan_pipeline_state, set_extends, ultra_code_from_mask, ultra_schedule_insn): Add static prototype. (data_segment_operand, text_segment_operand): Call itself with the proper number of arguments. (sparc_flat_save_restore, sparc_v8plus_shift): Constify a char*. * sparc.h: Move all declarations to sparc-protos.h. (SELECT_RTX_SECTION): Pass a missing MODE argument to symbolic_operand. * sparc/sysv4.h (SELECT_RTX_SECTION): Likewise. * config/svr4.h (text_section, ctors_section, dtors_section): Add Prototypes. (ASM_OUTPUT_SECTION_NAME, UNIQUE_SECTION, ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII): Constify a char*. * sparc-protos.h: New file for sparc prototypes. cp: * expr.c: Include tm_p.h. From-SVN: r30122
1999-10-03cp-tree.def (VEC_INIT_EXPR): Remove.Mark Mitchell1-8/+0
* 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-09-27cp-tree.h (expand_throw): Remove prototype.Mark Mitchell1-1/+3
* cp-tree.h (expand_throw): Remove prototype. * except.c (expand_throw): Make it static. Use tree-generation functions, rather than RTL-generation functions. (build_throw): Use it. * expr.c: Include except.h. (cplus_expand_expr): Don't call expand_throw here. * Makefile.in (expr.o): Depend on except.h. * ir.texi: Update documentation for THROW_EXPR. * decl.c (start_function): Set x_dont_save_pending_sizes rather than calling get_pending_sizes. * init.c (build_new): Don't save and restore immediate_size_expand; instead, assert that it has the expected value already. From-SVN: r29671
1999-09-24cp-tree.h (CPTI_CLEANUP_TYPE): New macro.Mark Mitchell1-3/+0
* cp-tree.h (CPTI_CLEANUP_TYPE): New macro. (cleanup_type): Likewise. (search_tree): Change prototype. * decl.c (local_variable_p): Adjust for new interface to search_tree. (check_default_argument): Likewise. * error.c (dump_expr): Handle INIT_EXPR. * except.c (expand_throw): Don't make cleanup_type a local static. * expr.c (cplus_expand_expr): Don't handle NEW_EXPR. * init.c (build_new): Call build_new_1 directly, rather than building a NEW_EXPR. (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when processing file-scope initializers. * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR. * tree.c: Include splay-tree.h (no_linkage_helper): Adjust for new interface to search_tree. (search_tree): Pass around pointers to tree nodes, rather than the nodes themselves. Handle VEC_INIT_EXPR. (no_linkage_check): Adjust for new interface to search_tree. (mapcar): Handle VEC_INIT_EXPR. (target_remap): New variable. (bot_manip): Use it. (bot_replace): New function. (break_out_target_exprs): Use it to remap all variables used in a default argument expression. * typeck.c (build_modify_expr): Don't crash when outside a function and presented with an INIT_EXPR assignment * Makefile.in (tree.o): Depend on splay-tree.h. From-SVN: r29659
1999-09-20cp-tree.h (finish_stmt_expr): Change prototype.Mark Mitchell1-2/+2
* 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-18Turn on function-at-a-time processing.Mark Mitchell1-1/+2
* 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-12decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.Mark Mitchell1-7/+3
* 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-09cp-tree.h (scratch_tree_cons): Remove.Mark Mitchell1-1/+1
* 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-08-27cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.Mark Mitchell1-3/+1
* 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-25cp-tree.def (SUBOBJECT): New tree node.Mark Mitchell1-2/+4
* 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-16cp-tree.def (STMT_EXPR): New tree node.Mark Mitchell1-6/+9
* 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-05-22cp-tree.h (cplus_expand_constant): Declare.Mark Mitchell1-1/+1
* 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-20cp-tree.h (make_ptrmem_cst): New function.Mark Mitchell1-37/+59
* 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-04-20cp-tree.h (build_binary_op): Remove unneeded parameter.Mark Mitchell1-1/+1
* 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-03-23cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.Mark Mitchell1-4/+10
* 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
1998-11-22update copyrightsJason Merrill1-1/+1
From-SVN: r23764
1998-10-06cp-tree.def (PTRMEM_CST): New tree node.Mark Mitchell1-9/+33
* 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-09-25Warning fixes:Kaveh R. Ghazi1-6/+3
* 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-07revert error reporting patchJason Merrill1-16/+16
From-SVN: r22310
1998-09-06cp-error.def: New file.Mark Mitchell1-16/+16
* 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-05-06call.c, [...]: Add include of toplev.h.Robert Lipe1-0/+1
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-03-31call.c: Include system.h.Jeffrey A Law1-1/+1
* 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-29* expr.c (tree_extract_aggr_init): #if 0 out.Jeffrey A Law1-2/+2
From-SVN: r18899
1998-03-25expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing if ↵Jason Merrill1-4/+6
(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-12WManfred Hollstein1-0/+4
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-02-03expr.c (cplus_expand_expr, [...]): Call convert_from_reference sooner.Jason Merrill1-1/+2
* expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code): Call convert_from_reference sooner. From-SVN: r17659
1998-01-27expr.c (cplus_expand_expr, [...]): Don't check that return_target and ↵Jason Merrill1-5/+3
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-12init.c (build_new_1): Split out from build_new.Jason Merrill1-0/+3
* 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
1997-12-18except.c: Remove register_exception_table{,_p}.Jason Merrill1-85/+25
* 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-10-14cp-tree.h (scratchalloc, [...]): Define as macros for now.Jason Merrill1-1/+1
* 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-09-29Makefile.in (parse.o, decl.o): Also depend on $(srcdir)/../except.h ↵H.J. Lu1-1/+3
$(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