aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2001-10-08c-common.h (struct c_lang_decl): Add declared_inline.Richard Henderson2-4/+8
* c-common.h (struct c_lang_decl): Add declared_inline. * c-tree.h (DECL_DECLARED_INLINE_P): New. * c-lang.c (c_disregard_inline_limits): Use it. * c-decl.c (duplicate_decls): Likewise. (pushdecl, redeclaration_error_message): Likewise. (pushdecl): Allocate DECL_LANG_SPECIFIC if needed. (grokdeclarator): Likewise. Set DECL_DECLARED_INLINE_P. Set DECL_INLINE if -finline-functions. (store_parm_decls): Don't allocate DECL_LANG_SPECIFIC here. * cp-tree.h (struct lang_decl_flags): Remove declared_inline. (DECL_DECLARED_INLINE_P): Use the bit in struct c_lang_decl. From-SVN: r46079
2001-10-07builtins.c (expand_builtin_setjmp_receiver): Const-ify.Kaveh R. Ghazi5-12/+21
* builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-05optimize.c (struct inline_data): Moved to ../tree-inline.c.Alexandre Oliva3-1291/+13
* optimize.c (struct inline_data): Moved to ../tree-inline.c. (INSNS_PER_STMT): Likewise. (remap_decl, remap_block, copy_scopy_stmt, copy_body_r): Likewise. (copy_body, initialize_inlined_parameters): Likewise. (declare_return_variable, inlinable_function_p): Likewise. (expand_call_inline, expand_calls_inline): Likewise. (optimize_inline_calls, clone_body): Likewise. * tree.c (walk_tree): Moved to ../tree-inline.c. (walk_tree_without_duplicates): Likewise. (copy_tree_r, remap_save_expr): Likewise. From-SVN: r46022
2001-10-05Make-lang.in (cp/decl.o, cp/tree.o): Depend on tree-inline.h.Alexandre Oliva9-190/+385
* Make-lang.in (cp/decl.o, cp/tree.o): Depend on tree-inline.h. (cp/pt.o, cp/semantics.o, cp/optimize.o): Likewise. * cp-tree.h (lang_decl): Moved inlined_fns to tree_decl. (TREE_READONLY_DECL_P, DECL_INLINED_FNS): Moved to ../tree.h. (flag_inline_trees): Moved declaration to ../tree-inline.h. (walk_tree): Moved declaration to ../tree-inline.h. (walk_tree_without_duplicates, copy_tree_r): Likewise. (remap_save_expr): Likewise. * decl.c: Include tree-inline.h. (lang_mark_tree): Don't mark inlined_fns. * decl2.c (flag_inline_trees): Moved defn to ../tree-inline.c. * optimize.c: Include tree-inline.h. (optimize_inline_calls): Move declaration to ../tree.h, as non-static. (remap_decl): Use language-independent constructs and hooks. (remap_block, copy_body_r, declare_return_variable): Likewise. (inlinable_function_p): Likewise. Don't test for DECL_LANG_SPECIFIC before DECL_INLINED_FNS as inlined_fns is no longer language-specific. (optimize_inline_calls): Likewise. Make it non-static. Moved call of dump_function to... (optimize_function): Here... (clone_body): New function, extracted from... (maybe_clone_body): ... here. Build decl_map locally and pass it on to clone_body. * pt.c, semantics.c: Include tree-inline.h. * tree.c: Likewise. (cp_walk_subtrees): New language-specific hook for tree inlining. (cp_cannot_inline_tree_fn, cp_add_pending_fn_decls, cp_is_overload_p, cp_auto_var_in_fn_p, cp_copy_res_decl_for_inlining): Likewise. (walk_tree): Move language-specific constructs into... (cp_walk_subtrees): this new function. (copy_tree_r): Use language-independent constructs and hooks. (init_tree): Initialize tree inlining hooks. (remap_save_expr): Adjust prototype so that the declaration does not require the definition of splay_tree. From-SVN: r46020
2001-10-03rtti.c (get_tinfo_decl): Call typeinfo_in_lib_p with the type used to build ↵John David Anglin2-1/+6
the declaration instead of... * rtti.c (get_tinfo_decl): Call typeinfo_in_lib_p with the type used to build the declaration instead of the declaration itself. From-SVN: r45994
2001-10-02* decl2.c (cxx_decode_option): Add 'else'.Jason Merrill1-3/+3
From-SVN: r45963
2001-10-02spew.c (end_input): No longer static.Jason Merrill4-3/+11
* spew.c (end_input): No longer static. * cp-tree.h: Declare it. * parse.y (datadef): Add "error END_OF_SAVED_INPUT" expansion. From-SVN: r45962
2001-10-02c-common.c (c_format_attribute_table): Make format and format_arg attributes ↵Joseph Myers3-5/+12
apply to function types rather than to decls. * c-common.c (c_format_attribute_table): Make format and format_arg attributes apply to function types rather than to decls. (is_valid_printf_arglist): Construct an attribute list and pass that to check_function_format rather than a name. * c-common.h (check_function_format): Adjust prototype. * c-decl.c (duplicate_decls): Preserve attributes from type of built-in decl when allowing for harmless conflict in types. * c-format.c (record_function_format, record_international_format, function_format_list, international_format_info, international_format_list): Remove. (function_format_info): Remove next, name and assembler_name. Make format_num and first_arg_num be unsigned HOST_WIDE_INT. (decode_format_attr): New. (handle_format_attribute): Handle receiving a type rather than a decl. Call decode_format_attr. Store format information in a function_format_info. (handle_format_arg_attribute): Correct comment. Handle receiving a type rather than a decl. Use unsigned HOST_WIDE_INT for arg_num. (check_format_info_recurse, check_format_info_main): Take argument numbers as unsigned HOST_WIDE_INT. (check_function_format): Take a list of attributes from the function type rather than a name or assembler name. Check for format attributes in that list and the attributes on the type of the current function rather than looking through function_format_list. (check_format_info): Use unsigned HOST_WIDE_INT for argument numbers. (check_format_info_recurse): Take format_arg attributes from the type of the function calls rather than using international_format_list. Allow for multiple format_arg attributes. * c-typeck.c (build_function_call): Pass type attributes to check_function_format rather than name or assembler name. Don't require there to be a name or assembler name to check formats. cp: * call.c (build_over_call), typeck.c (build_function_call_real): Pass type attributes to check_function_format rather than name or assembler name. Don't require there to be a name or assembler name to check formats. testsuite: * g++.dg/warn/format2.C, gcc.dg/format/attr-7.c, gcc.dg/format/multattr-1.c, gcc.dg/format/multattr-2.c, gcc.dg/format/multattr-3.c: New tests. * gcc.dg/format/attr-3.c: Update expected error texts. Remove tests for format attributes on function pointers being rejected. From-SVN: r45945
2001-10-02attribs.c (decl_attributes): Possibly call insert_default_attributes to ↵Joseph Myers2-5/+27
insert default attributes on... * attribs.c (decl_attributes): Possibly call insert_default_attributes to insert default attributes on functions in a lazy manner. * builtin-attrs.def: New file; define the default format and format_arg attributes. * c-common.c (c_format_attribute_table): Move to earlier in the file. (c_common_nodes_and_builtins): Initialize format_attribute_table. (enum built_in_attribute, built_in_attributes, c_attrs_initialized, c_init_attributes, c_common_insert_default_attributes): New. (c_common_lang_init): Don't initialize format_attribute_table. Do call c_init_attributes. * Makefile.in (c-common.o): Depend on builtin-attrs.def. * c-common.h (init_function_format_info): Don't declare. (c_common_insert_default_attributes): Declare. * c-decl.c (implicitly_declare, builtin_function): Call decl_attributes. (init_decl_processing): Don't call init_function_format_info. (insert_default_attributes): New. * c-format.c (handle_format_attribute, handle_format_arg_attribute): Be quiet about inappropriate declaration when applying default attributes. (init_function_format_info): Remove. * tree.h (enum attribute_flags): Add ATTR_FLAG_BUILT_IN. (insert_default_attributes): Declare. cp: * decl.c (init_decl_processing): Don't call init_function_format_info. Initialize lang_attribute_table earlier. (builtin_function): Call decl_attributes. (insert_default_attributes): New. testsuite: * gcc.dg/format/attr-5.c, gcc.dg/format/attr-6.c: New tests. From-SVN: r45942
2001-10-01decl.c (grokdeclarator): Copy array typedef handling from C frontend.Jason Merrill2-2/+23
* decl.c (grokdeclarator): Copy array typedef handling from C frontend. * decl.c (grokdeclarator): Copy too-large array handling from C frontend. * stor-layout.c (layout_type): Don't complain about too-large array here. From-SVN: r45923
2001-09-29config-lang.in (target_libs): Added target-gperf, so that we don't try to ↵Alexandre Oliva2-2/+8
build it if C++ is disabled. * config-lang.in (target_libs): Added target-gperf, so that we don't try to build it if C++ is disabled. From-SVN: r45887
2001-09-24top level:Zack Weinberg5-1073/+208
* errors.h (warning, error, fatal, internal_error): Don't mark with ATTRIBUTE_PRINTF_n. * toplev.h (internal_error, fatal_io_error, warning, error, pedwarn, pedwarn_with_file_and_line, warning_with_file_and_line, error_with_file_and_line, sorry, error_for_asm, warning_for_asm): Likewise. cp: * Make-lang.in (CXX_OBJS): Take out cp/errfn.o. (cp/errfn.o): Delete rule. (cp/error.o): Depend on flags.h. * errfn.c: Delete file. * cp-tree.h: Declare warn_deprecated. Remove definitions of TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE, TFF_CHASE_NAMESPACE_ALIAS, and TFF_TEMPLATE_DEFAULT_ARGUMENTS. #define cp_error, cp_warning, cp_pedwarn, and cp_compiler_error to error, warning, pedwarn, and internal_error respectively. Make cp_deprecated into a macro. Don't define cp_printer typedef or declare cp_printers. * error.c: Include flags.h. Delete: struct tree_formatting_info, print_function_argument_list, print_declaration, print_expression, print_function_declaration, print_function_parameter, print_type_id, print_cv_qualifier_seq, print_type_specifier_seq, print_simple_type_specifier, print_elaborated_type_specifier, print_rest_of_abstract_declarator, print_parameter_declaration_clause, print_exception_specification, print_nested_name_specifier, and definition of cp_printers. (locate_error): New function. (cp_error_at, cp_warning_at, cp_pedwarn_at): Moved here and rewritten in terms of locate_error and diagnostic.c. (cp_tree_printer): Rename cp_printer; wire up to *_to_string instead of deleted print_* routines. Handle %C, %L, %O, %Q also. (init_error): Adjust to match. po: * POTFILES.in: Remove cp/errfn.c. From-SVN: r45765
2001-09-22attribs.c: New file, from c-common.c.Richard Kenner2-1/+6
* attribs.c: New file, from c-common.c. (attribute_tables): Now four elements. (format_attribute_table, lang_attribute_common): New variables. (init_attributes): Reflect above changes. (handle_mode_attribute): Delete check for wider than uintmax. * c-common.c: Delete parts moved to attribs.c. (enum attrs): Deleted; unused. (c_format_attribute_table): New variable. (c_common_lang_init): Initialize format_attribute_table with it. * c-common.h (decl_attributes): Remove decl. * tree.h (decl_attribute): Move it to here. * Makefile.in (C_AND_OBJS_OBJS): Add attribs.o. (attribs.o): New rule. * ch/Make-lang.in (cc1chill): Add attribs.o. * cp/Make-lang.in (CXX_C_OBJS): Add attribs.o. From-SVN: r45749
2001-09-21tree.def (FDESC_EXPR): New.Richard Henderson6-7/+63
gcc/ * tree.def (FDESC_EXPR): New. * expr.c (expand_expr): Handle it. * varasm.c (initializer_constant_valid_p): Likewise. (output_constant): Likewise. * defaults.h (TARGET_VTABLE_USES_DESCRIPTORS): New. * config/ia64/ia64.h (TARGET_VTABLE_USES_DESCRIPTORS): New. (ASM_OUTPUT_FDESC): New. * doc/tm.texi: Document the new macros. gcc/cp/ * class.c (set_vindex): Mind TARGET_VTABLE_USES_DESCRIPTORS. (build_vtbl_initializer): Likewise. (build_vfn_ref): New. * cp-tree.h: Declare it. * call.c (build_over_call): Use it. * decl2.c (mark_vtable_entries): Mark FDESC_EXPR. * typeck.c (get_member_function_from_ptrfunc): Mind descriptors. gcc/java/ * class.c (get_dispatch_table): Handle function descriptors. (build_dtable_decl): Likewise. * expr.c (build_invokevirtual): Likewise. gcc/testsuite/ * g++.old-deja/g++.abi/ptrmem.C: Update for ia64 c++ abi. * g++.old-deja/g++.abi/vtable2.C: Likewise. From-SVN: r45733
2001-09-21* decl.c (grokdeclarator): Use C syntax for attr_flags declaration.J"orn Rennecke2-1/+7
From-SVN: r45723
2001-09-21Table-driven attributes.Joseph Myers10-194/+241
* c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-15Make-lang.in (cp/error.o): Depend on real.hGabriel Dos Reis3-1/+7
* Make-lang.in (cp/error.o): Depend on real.h * error.c: #include "real.h" From-SVN: r45639
2001-09-15collect2.c (main): Const-ification.Kaveh R. Ghazi2-5/+6
* collect2.c (main): Const-ification. * gcc.c (translate_options, process_command): Use xstrdup in lieu of xmalloc/strcpy. (main): Use concat in lieu of xmalloc/strcpy/strcat. cp: * mangle.c (mangle_conv_op_name_for_type): Use concat in lieu of xmalloc/strcpy/strcat. From-SVN: r45631
2001-09-13c-parse.in (yyerror): Const-ification and/or static-ization.Kaveh R. Ghazi3-4/+10
* c-parse.in (yyerror): Const-ification and/or static-ization. * c-typeck.c (push_member_name): Likewise. * collect2.c (main): Likewise. * dbxout.c (dbxout_parms): Likewise. * diagnostic.c (format_with_decl): Likewise. * dwarf2out.c (output_ranges): Likewise. * dwarfout.c (fundamental_type_code): Likewise. * except.c (dw2_output_call_site_table): Likewise. * gcc.c (do_spec_1): Likewise. * genopinit.c (optabs): Likewise. * objc/objc-act.c (synth_id_with_class_suffix, start_class, gen_declaration_1, handle_impent): Likewise. * protoize.c (default_include, in_system_include_dir, abspath): Likewise. * sched-vis.c (visualize_stall_cycles): Likewise. * sdbout.c (plain_type_1, sdbout_end_function, sdbout_end_epilogue): Likewise. * varasm.c (decode_reg_name): Likewise. * 1750a.c (mod_regno_adjust): Likewise. * alpha.c (alpha_write_one_linkage, unicosmk_output_default_externs): Likewise. * arm.c (arm_condition_codes): Likewise. * arm.h (arm_condition_codes): Likewise. * avr.c (output_movsisf, encode_section_info): Likewise. * darwin.h (GEN_BINDER_NAME_FOR_STUB, GEN_SYMBOL_NAME_FOR_SYMBOL): Likewise. * i386.c (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. * i386.h (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. * m88k.c (output_function_profiler): Likewise. * mips.c (mips_output_conditional_branch): Likewise. * ns32k.c (ns32k_out_reg_names): Likewise. * ns32k.h (ns32k_out_reg_names): Likewise. * pj.c (pj_output_rval): Likewise. * rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Likewise. * sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue): Likewise. cp: * decl.c (warn_extern_redeclared_static, cp_make_fname_decl): Const-ification. * pt.c (tsubst_decl): Likewise. f: * bad.c (ffebad_finish): Const-ification and/or static-ization. * intrin.c (ffeintrin_cmp_name_): Likewise. * stc.c (ffestc_R904): Likewise. java: * expr.c (expand_invoke): Const-ification. * parse.y (patch_method_invocation): Likewise. From-SVN: r45581
2001-09-12decl2.c (lang_f_options): Const-ification.Kaveh R. Ghazi4-3/+9
* decl2.c (lang_f_options): Const-ification. * lex.c (cplus_tree_code_name): Likewise. * spew.c (yyerror): Likewise. From-SVN: r45565
2001-09-06Remove OP_IDENTIFIER.Ira Ruben1-1/+0
2001-09-06 Ira Ruben <ira@apple.com> Remove OP_IDENTIFIER. * tree.def (OP_IDENTIFIER): Remove. * tree.c (tree_node_kind enum): Remove op_id_kind. (tree_node_kind_names): Remove "op_identifiers". (make_node): Remove OP_IDENTIFIER test. (build_op_identifier): Removed because it isn't being used. * print-tree.c (print_node): Remove OP_IDENTIFIER case. * cp/pt.c (tsubst): Remove OP_IDENTIFIER case. From-SVN: r45457
2001-09-06oops, missed a bit in previous commitNathan Sidwell1-1/+1
From-SVN: r45436
2001-09-06re PR c++/3986 (ICE in build_rtti_vtbl_entries)Nathan Sidwell2-11/+35
cp: PR c++/3986 * class.c (force_canonical_binfo_r): Check & move an indirect primary base first. (force_canonical_binfo): Check that it's not already canonical. (mark_primary_virtual_base): Remove BINFO parameter. (mark_primary_bases): Adjust, set BINFO_LOST_PRIMARY_P here. testsuite: PR c++/3986 * g++.dg/abi/vbase1.C: New test. From-SVN: r45435
2001-09-06Remove TYPE_NONCOPIED_PARTS.Nathan Sidwell3-7/+15
* tree.h (TYPE_NONCOPIED_PARTS): Remove. (struct tree_type): Remove noncopied_parts. * c-tree.h (TYPE_ACTUAL_ARG_TYPES): Map onto TYPE_BINFO. * expr.c (save_noncopied_parts, init_noncopied_parts): Remove. (fixed_type_p): Remove. (expand_expr, INIT_EXPR): Don't deal with noncopied parts. (expand_expr, MODIFY_EXPR): Likewise. * ggc-common.c (ggc_mark_trees): Remove TYPE_NONCOPIED_PARTS. * doc/c-tree.texi: Remove TYPE_NONCOPIED_PARTS FIXME. cp: Remove TYPE_NONCOPIED_PARTS. * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Map onto CLASSTYPE_PURE_VIRTUALS. (TYPE_RAISES_EXCEPTIONS): Map onto TYPE_BINFO. * class.c (duplicate_tag_error): Remove TYPE_NONCOPIED_PARTS. (layout_class_type): Don't call fixup_inlin_methods here ... (finish_struct_1): ... call it here. From-SVN: r45434
2001-09-04decl.c (duplicate_decls): Remove code deadling with DECL_SAVED_INSNS.Mark Mitchell5-46/+47
* decl.c (duplicate_decls): Remove code deadling with DECL_SAVED_INSNS. * decl2.c (finish_file): Likewise. * pt.c (instantiate_decl): Likewise. * semantics.c (expand_body): Don't defer local functions if they wouldn't be deferred for some other reason. Don't generate RTL for functions that will not be emitted. (genrtl_start_function): Remove code deadling with DECL_SAVED_INSNS. (genrtl_finish_function): Likewise. From-SVN: r45386
2001-09-04re PR c++/4203 (empty base class optimization zeroes first byte of other ↵Nathan Sidwell2-3/+9
base class when using multiple inheritance) cp: PR c++/4203 * call.c (build_over_call): Do not optimize any empty base construction. testsuite: PR c++/4203 * g++.old-deja/g++.other/empty1.C: XFAIL. See PR c++/4222 * g++.dg/init/empty1.C: New test. From-SVN: r45374
2001-08-31error.c (dump_template_decl): Output template parameters together with their ↵Kriang Lerdsuwanakij2-4/+18
specifiers. * error.c (dump_template_decl): Output template parameters together with their specifiers. Output `class' prefix for template template parameter. (dump_decl): Fix formatting. From-SVN: r45329
2001-08-30optimize.c (inlinable_function_p): Allow only smaller single functions.Kurt Garloff2-5/+12
* optimize.c (inlinable_function_p): Allow only smaller single functions. Halve inline limit after reaching recursive limit. From-SVN: r45286
2001-08-30class.c (build_vtable_entry_ref): Subtract in char*, not ptrdiff_t.Joern Rennecke2-2/+11
* class.c (build_vtable_entry_ref): Subtract in char*, not ptrdiff_t. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r45284
2001-08-27emit-rtl.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.Andreas Jaeger4-134/+42
* emit-rtl.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout. * errors.c: Likewise. * final.c: Likewise. * dwarf2asm.c: Likewise. * doprint.c (checkit): Likewise. * diagnostic.c: Likewise. * collect2.c: Likewise. * calls.c: Likewise. * c-semantics.c (build_stmt): Likewise. * c-format.c (status_warning): Likewise. * c-errors.c (pedwarn_c99): Likewise. * builtins.c (validate_arglist): Likewise. * config/pj/pj.c (pj_printf): Likewise. * fix-header.c: Likewise. * gcc.c: Likewise. * gcov.c (fnotice): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c: Likewise. * protoize.c (notice): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c: Likewise. * tradcpp.c: Likewise. * tree.c: Likewise. * cp/tree.c (build_min_nt): Likewise. (build_min): Likewise. * cp/lex.c: Likewise. * cp/errfn.c: Likewise. * cp/rtti.c (create_pseudo_type_info): Likewise. From-SVN: r45185
2001-08-24* cp/rtti.c (VPARAMS): Fix parameter.Andreas Jaeger1-1/+1
From-SVN: r45151
2001-08-24c-common.c (c_alignof, [...]): Move here...Jason Merrill7-83/+53
* c-common.c (c_alignof, c_alignof_expr): Move here... * c-typeck.c: ...from here. * c-tree.h, c-common.h: Adjust. * tree.c (cp_build_qualified_type_real): Use get_qualified_type. (build_cplus_array_type): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT, to get an unqualified version. * decl2.c (grok_alignof): Lose. (build_expr_from_tree): Use expr_sizeof and c_alignof_expr. * typeck.c (c_alignof): Lose. * semantics.c (finish_sizeof, finish_alignof): New. * parse.y: Use them. * cp-tree.h: Declare them. From-SVN: r45145
2001-08-22pt.c (tsubst_expr): Hand off to the TREE_CHAIN of a statement.Jason Merrill3-30/+35
* pt.c (tsubst_expr): Hand off to the TREE_CHAIN of a statement. Don't loop in COMPOUND_STMT, FOR_STMT or TRY_BLOCK. * tree.c (cp_statement_code_p): A TAG_DEFN is a statement. From-SVN: r45106
2001-08-19typeck2.c (add_exception_specifier): Only require complete type if not in ↵Jakub Jelinek2-1/+8
processing template declaration. * typeck2.c (add_exception_specifier): Only require complete type if not in processing template declaration. * g++.dg/eh/template1.C: New test. From-SVN: r45032
2001-08-18except.c (TYPE_HASH): Delete.Kaveh R. Ghazi3-11/+14
* except.c (TYPE_HASH): Delete. * objc/objc-act.c (HASHFUNCTION): Cast to size_t, not HOST_WIDE_INT. * tree.c (TYPE_HASH): Delete. * tree.h (TYPE_HASH): Define. ch: * tree.c (TYPE_HASH): Moved to ../tree.h. cp: * decl.c: Cast argument to size_t, not HOST_WIDE_INT, in calls to GNU_xref_start_scope and GNU_xref_end_scope. * tree.c (TYPE_HASH): Moved to ../tree.h. From-SVN: r45004
2001-08-17cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS on COMPOUND_EXPRs.Mark Mitchell2-2/+12
* cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS on COMPOUND_EXPRs. From-SVN: r44956
2001-08-14class.c, cp-tree.h (build_vfn_ref): Remove.Richard Henderson5-16/+7
* class.c, cp-tree.h (build_vfn_ref): Remove. * call.c, rtti.c: Replace all refernces with build_vtbl_ref. From-SVN: r44913
2001-08-13call.c (build_over_call): Mark COMPOUND_EXPRs generated for empty class ↵Mark Mitchell2-0/+15
assignment as having side-effects... * call.c (build_over_call): Mark COMPOUND_EXPRs generated for empty class assignment as having side-effects to avoid spurious warnings. From-SVN: r44868
2001-08-13expr.h: Split out optab- and libfunc-related code to...Zack Weinberg3-1/+7
* expr.h: Split out optab- and libfunc-related code to... * optabs.h, libfuncs.h: ... these new headers. * Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h. (OPTABS_H): New. (various .o rules): Add $(OPTABS_H) and/or libfuncs.h to dependencies. * mkconfig.sh: Don't include insn-codes.h from config.h. * reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether enum insn_code is available. Move reload_in_optab and reload_out_optab array declarations to optabs.h. * regmove.c (gen_add3_insn): Move to optabs.c, export from there, prototype in expr.h. * gencodes.c: Cleanup: zap global variables, don't use printf where puts will do, don't bother defining MAX_INSN_CODE which nothing uses, let CODE_FOR_nothing get its value implicitly. * genemit.c, genopinit.c: Include optabs.h in generated file. * genoutput.c: Include insn-codes.h in generated file. * builtins.c, caller-save.c, combine.c, doloop.c, explow.c, expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c, reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c, config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c, config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c, config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c: Include optabs.h. * builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c, optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c, config/m88k/m88k.c, config/sparc/sparc.c: Include libfuncs.h. * reload.c: Include expr.h and optabs.h before reload.h. * config/alpha/alpha.c: Include tree.h before reload.h. * config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h, and reload.h in that order. * config/sparc/sparc.c: Include debug.h. * recog.c: Include insn-codes.h. cp: * Make-lang.in (cp/except.o): Add libfuncs.h to dependencies. * except.c: Include libfuncs.h. java: * Make-lang.in (java/decl.o): Update dependencies. * decl.c: Include libfuncs.h, don't include toplev.h. From-SVN: r44858
2001-08-13* decl.c (grokdeclarator): Clarify diagnostic message.Gabriel Dos Reis2-1/+5
From-SVN: r44852
2001-08-13decl2.c (do_nonmember_using_decl): Replace using directive with using ↵Kriang Lerdsuwanakij2-1/+6
declaration in the error message. * decl2.c (do_nonmember_using_decl): Replace using directive with using declaration in the error message. From-SVN: r44847
2001-08-11pt.c (maybe_fold_nontype_arg): Use TREE_TYPE of ARG as the criterion to ↵Kriang Lerdsuwanakij2-10/+19
avoid rebuilding expression tree... * pt.c (maybe_fold_nontype_arg): Use TREE_TYPE of ARG as the criterion to avoid rebuilding expression tree instead of processing_template_decl. * g++.dg/template/unify1.C: New test. From-SVN: r44793
2001-08-10c-common.h (RETURN_NULLIFIED_P): Lose.Jason Merrill6-34/+90
* c-common.h (RETURN_NULLIFIED_P): Lose. * c-semantics.c (genrtl_return_stmt): Don't check it. Support named return value optimization for inlines, too. * decl.c (finish_function): Nullify returns here. * semantics.c (genrtl_start_function): Not here. (cp_expand_stmt): Don't mess with CLEANUP_STMTs. (nullify_returns_r): No longer static. Just clear RETURN_EXPR. Also nullify the CLEANUP_STMT for the nrv. * cp-tree.h: Declare it. * optimize.c (declare_return_variable): Replace the nrv with the return variable. * typeck.c (check_return_expr): Be more flexible on alignment check. Ignore cv-quals when checking for a matching type. From-SVN: r44762
2001-08-09Move constructor/destructor handling into target hooks.Richard Henderson2-9/+14
From-SVN: r44747
2001-08-09tweak commentJason Merrill1-1/+4
From-SVN: r44744
2001-08-08* g++spec.c (lang_specific_driver): Quote argument after `-Xlinker'.John David Anglin2-0/+5
From-SVN: r44725
2001-08-07re PR c++/3820 (GCC 3.0 crashes with empty base class)Nathan Sidwell4-41/+35
cp: PR c++/3820 Stop using TYPE_NONCOPIED_PARTS. * call.c (build_over_call): Be careful when copy constructing or assigning to an empty class. * class.c (check_bases_and_members): It has a COMPLEX_ASSIGN_REF if it has a vptr. (layout_class_type): Don't add empty class padding to TYPE_NONCOPIED_PARTS. (finish_struct_1): Don't add the VFIELD either. * cp-tree.h (TYPE_HAS_TRIVIAL_INIT_REF): Mention _copy_ initialization. testsuite: * g++.dg/abi/empty4.C: New test. From-SVN: r44691
2001-08-07* tree.c (walk_tree): Walk siblings even if !walk_subtrees.Jason Merrill2-4/+14
From-SVN: r44686
2001-08-07improve commentJason Merrill1-1/+3
From-SVN: r44685
2001-08-06varasm.c (assemble_constructor): Take a symbol_ref and a priority instead of ↵Richard Henderson2-26/+11
a bare string. * varasm.c (assemble_constructor): Take a symbol_ref and a priority instead of a bare string. Move priority handling here from cp/decl2.c. * output.h: Update decls. * c-decl.c (c_expand_body): Update calls to assemble_constructor and assemble_destructor. * profile.c (output_func_start_profiler): Likewise. * objc/objc-act.c (finish_objc): Likewise. (build_module_descriptor): Return the symbol not the symbol name. * ch/grant.c (chill_finish_compile): Pass a symbol_ref and priority to assemble_constructor. * cp/decl2.c (finish_objects): Pass a symbol_ref and priority to assemble_{constructor,destructor}. Remove priority handling. * java/class.c (emit_register_classes): Pass a symbol_ref and priority to assemble_constructor. From-SVN: r44678