aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
AgeCommit message (Collapse)AuthorFilesLines
2003-09-14objc-act.c: Convert to ISO C90 prototypes.Andreas Jaeger2-714/+462
* objc/objc-act.c: Convert to ISO C90 prototypes. * objc/objc-act.h: Likewise. From-SVN: r71371
2003-09-04cgraph.c (cgraph_mark_reachable_node): Split out from ...Richard Henderson1-2/+3
* cgraph.c (cgraph_mark_reachable_node): Split out from ... (cgraph_mark_needed_node): Remove needed argument. * cgraph.h: Update to match. * cgraphunit.c (decide_is_function_needed): Split out from ... (cgraph_finalize_function): Reorg. Avoid deferred_inline_function if we generated the function. (record_call_1): Update for cgraph_mark_reachable_node. * varasm.c (mark_referenced): Likewise. * objc/objc-act.c (mark_referenced_methods): Likewise. * decl2.c (mark_member_pointers_and_eh_handlers): Update for change in cgraph_mark_needed_node arguments. From-SVN: r71104
2003-09-03targhooks.c: New file.DJ Delorie1-1/+1
* targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-03Makefile.in (c-objc-common.o): Kill gt-c-objc-common.h dependency.Jan Hubicka1-2/+2
* Makefile.in (c-objc-common.o): Kill gt-c-objc-common.h dependency. * c-decl.c (finish_function): Kill arguments, always use cgraph path. * c-objc-common.c: Kill include of gt-c-objc-common.h (expand_deferred_fns, deffer_fn): Kill function. (deferred_fns): Kill variable. (finish_cdtor): Update finish_function call. (c_objc_common_finish_file): Always call cgraph code. * c-parse.c: Regenerate. * c-parse.y: Regenerate. * c-tree.h (finish_function): Update prototype. * objc-acct.c (build_module_descriptor, finish_method_def): Update call of finish_function. * cgraphunit.c (cgraph_default_inline_p, cgraph_analyze_function): Add forward prototype. (cgraph_finalize_function): In non-unit-at-a-time mode analyze the function and assemble it if needed. (cgraph_finalize_compilation_unit): Do nothing in non-unit-at-a-time mode. (cgraph_optimize): Likewise. (cgraph_expand_function): In non-unit-at-a-time mode keep function body even when it has no inline callees. * c-parse.in: Update calls to finish_function. From-SVN: r71028
2003-08-29tree-optimize.c: New file.Richard Henderson1-0/+3
gcc/ * tree-optimize.c: New file. * Makefile.in (OBJS-archive): Add tree-optimize.o. (tree-optimize.o): New. * c-decl.c (store_parm_decls): Use allocate_struct_function. (finish_function): Don't free_after_parsing or free_after_compilation. (set_save_expr_context): Move to tree-optimize.c. (c_expand_body_1): Use tree_rest_of_compilation. * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New. * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New. * c-objc-common.c (expand_deferred_fns): Don't emit unused inlines; iterate until closure. * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_START, LANG_HOOKS_RTL_EXPAND_STMT, LANG_HOOKS_RTL_EXPAND_END): New. (LANG_HOOKS_RTL_EXPAND_INITIALIZER): New. * langhooks.h (struct lang_hooks_for_rtl_expansion): New. * toplev.h (tree_rest_of_compilation): Declare it. gcc/cp/ * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New. (LANG_HOOKS_RTL_EXPAND_STMT): New. * cp-tree.h (cxx_expand_function_start): Declare. * decl.c (start_function): Use allocate_struct_function. Move stmts_are_full_exprs_p assertion from expand_body. Do not free_after_parsing or free_after_compilation. (cxx_push_function_context): Move code to set struct function data from genrtl_start_function. * optimize.c (optimize_function): Don't inc/dec function_depth. * semantics.c (expand_body): Use tree_rest_of_compilation. (cxx_expand_function_start): Rename from genrtl_start_function, omit bits done by tree_rest_of_compilation. (genrtl_finish_function): Remove. (clear_decl_rtl): Move to ../tree-optimize.c. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r70933
2003-08-20Makefile.in (STAGESTUFF): Move cc1obj$(exeext) from here ...Matt Kraai1-1/+1
* Makefile.in (STAGESTUFF): Move cc1obj$(exeext) from here ... * objc/config-lang.in (stagestuff): ... to here. From-SVN: r70596
2003-08-19PR c++/10538, PR c/5582Andrew Pinski1-0/+2
ChangeLog: * langhooks-def.h (lhd_decl_uninit): Declare. (LANG_HOOKS_DECL_UNINIT): New macro. (LANG_HOOKS_INITIALIZER): Adjust. * langhooks.h (struct lang_hooks): Add new field decl_uninit. * langhooks.c (lhd_decl_uninit): Define. * c-common.c (c_decl_uninit_1): New function. (c_decl_uninit): New function. (warn_init_self): Define. * c-common.h (c_decl_uninit): Declare. (warn_init_self): Declare. * c.opt: Introduce -Winit-self. * c-opts.c (c_common_handle_options): Set warn_init_self. * c-lang.c (LANG_HOOKS_DECL_UNINIT): Define. * objc/objc-lang.c (LANG_HOOKS_DECL_UNINIT): Define. * function.c (uninitialized_vars_warning): Call the language hook. * doc/invoke.texi: Document -Winit-self. cp/ChangeLog: * cp/cp-lang.c (LANG_HOOKS_DECL_UNINIT): Define. testsuite: * gcc.dg/uninit-D.c: New Test. * gcc.dg/uninit-E.c: New Test. * gcc.dg/uninit-F.c: New Test. * gcc.dg/uninit-G.c: New Test. From-SVN: r70574
2003-08-04c-common.c (flag_noniso_default_format_attributes): Delete.Roger Sayle1-2/+0
* c-common.c (flag_noniso_default_format_attributes): Delete. (built_in_attribute): Don't define/undefine DEF_FN_ATTR. (c_attrs_initialized): Delete. (c_common_nodes_and_builtins): Don't test c_attrs_initialized, always call c_init_attributes. (c_init_attributes): Don't define/undefine DEF_FN_ATTR. Don't set c_attrs_initialized when done. (c_common_insert_default_attributes): Delete. * c-common.h (flag_noniso_default_format_attributes): Delete. (c_coomon_insert_default_attributes): Delete prototype. * c-opts.c (set_std_c89, set_std_c99, set_std_cxx98): Dont set flag_noniso_default_format_attributes. * c-decl.c (c_insert_default_attributes): Delete. * c-tree.h (c_insert_default_attributes): Delete prototype. * attribs.c (decl_attributes): Don't call insert_default_attributes langhook. Update function description comment. * langhooks.h (lang_hooks): Remove insert_default_attributes field. * langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Delete. * c-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. * system.h: Poison LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES macro. cp/ * decl.c (cxx_insert_default_attributes): Delete. * cp-tree.h (cxx_insert_default_attributes): Don't prototype. * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. objc/ * objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. From-SVN: r70155
2003-07-31* objc/Make-lang.in (objc.stage1, objc.stage2, objc.stage3)Matt Kraai1-6/+0
(objc.stage4, objc.stageprofile, objc.stagefeedback): Remove moves of cc1obj. From-SVN: r69987
2003-07-25objc-act.c (objc_check_decl): Don't use xxx_with_decl.Gabriel Dos Reis1-3/+6
* objc/objc-act.c (objc_check_decl): Don't use xxx_with_decl. (objc_declare_class): Likewise. (error_with_ivar): Likewise. (start_class): Likewise. (warn_with_method): Likewise. java/ * expr.c (expand_java_field_op): Don't use xxx_with_decl (expand_java_field_op): Likewise. * class.c (layout_class_method): Likewise (emit_register_classes): Likewise. * decl.c (pushdecl): Likewise. (poplevel): Likewise. (force_poplevels): Likewise. (give_name_to_locals): Likewise. * check-init.c (check_for_initialization): Likewise. From-SVN: r69780
2003-07-19fixfixes.c [...]: Remove unnecessary casts.Kaveh R. Ghazi1-21/+18
gcc: * fixinc/fixfixes.c fixinc/fixincl.c fixinc/fixlib.c fixinc/server.c objc/objc-act.c: Remove unnecessary casts. f: * com.c data.c expr.c fini.c g77spec.c global.c lab.c lex.c name.c sta.c stc.c std.c storag.c stt.c stw.c symbol.c target.c type.c: Remove unnecessary casts. cp: * call.c class.c decl.c decl2.c g++spec.c lex.c parser.c pt.c rtti.c semantics.c typeck.c: Remove unnecessary casts. java: * class.c java-tree.h jcf-write.c jvspec.c: Remove unnecessary casts. treelang: * treetree.c: Remove unnecessary casts. From-SVN: r69593
2003-07-17re PR middle-end/11498 (asm can't be used to give a variable its own name)Geoffrey Keating1-0/+2
PR 11498 * Makefile.in (c-opts.o): Add $(LANGHOOKS_DEF_H). (langhooks.o): Add $(GGC_H), gt-langhooks.h. (GTFILES): Add langhooks.c. (gt-langhooks.h): New. * c-common.h (c_static_assembler_name): Prototype. * c-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define. * objc/objc-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define. * c-opts.c: Include langhooks-def.h. (c_static_assembler_name): New. * langhooks.c: Include ggc.h. Include gt-langhooks.h. (var_labelno): New. (lhd_set_decl_assembler_name): Give static objects with context unique names. * varasm.c (var_labelno): Delete. (make_decl_rtl): Don't change the assembler name once it's set. From-SVN: r69527
2003-07-17objc-lang.c: Override LANG_HOOKS_WRITE_GLOBALS to c_write_global_declarations.Zack Weinberg1-0/+3
* objc/objc-lang.c: Override LANG_HOOKS_WRITE_GLOBALS to c_write_global_declarations. From-SVN: r69525
2003-07-17Missed this hunk - belongs with the previous patchZack Weinberg1-1/+2
From-SVN: r69521
2003-07-17c-decl.c: Fix typos in several comments.Zack Weinberg1-7/+9
* c-decl.c: Fix typos in several comments. Remove all #if 0 blocks; reindent as needed. Remove unused argument to declare_parm_level; all callers changed. * c-parse.in: Update calls to declare_parm_level. Avoid issuing a double warning in some circumstances. * c-typeck.c: Update calls to declare_parm_level. * c-tree.h: Update prototype of declare_parm_level. * c-pragma.c (apply_pragma_weak): Don't complain about a redundant #pragma weak. * objc/objc-act.c (forward_declare_categories, build_selector_reference_decl, build_class_reference_decl, build_objc_string_decl, synth_forward_declarations, build_protocol_reference): Set TREE_PUBLIC on synthetic forward decl to 0, consistent with eventual definition. Correct comments to match. cp: * pt.c (get_bindings): Make definition consistent with forward declaration. From-SVN: r69519
2003-07-17c.opt: Document Uncodumented; use it.Neil Booth1-43/+0
* c.opt: Document Uncodumented; use it. Document ObjC options. * opts.c (print_filtered_help): Skip undocumented switches. * opts.h (CL_UNDOCUMENTED): New. * opts.sh: Handle Undocumented. * toplev.c (documented_lang_options): Prevent its becoming empty. f: * lang-options.h: Remove. * lang.opt: Document most options. objc: * lang-options.h: Remove. From-SVN: r69494
2003-07-14objc-act.h (CLASS_SUPER_NAME): Add a little typechecking.Geoffrey Keating2-4/+8
* objc/objc-act.h (CLASS_SUPER_NAME): Add a little typechecking. (TYPE_PROTOCOL_LIST): Share use of type.context with C frontend. (SET_TYPE_PROTOCOL_LIST): New. * objc/objc-act.c (get_static_reference): Use SET_TYPE_PROTOCOL_LIST. (get_object_reference): Likewise. From-SVN: r69364
2003-07-11Index: ChangeLogGeoffrey Keating1-4/+5
2003-07-10 Geoffrey Keating <geoffk@apple.com> * c-decl.c (finish_decl): Handle 'used' here... * cgraphunit.c (cgraph_finalize_function): ... and here ... * c-common.c: (handle_used_attribute): ... not here. * configure.in (onstep): Support --enable-intermodule. * Makefile.in (OBJS-common): New. (OBJS-md): New. (OBJS-archive): New. (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive. (OBJS-onestep): New. (libbackend.a): Support @onestep@. (libbackend.o): New. * configure: Regenerate. * c-common.h (c_reset_state): New prototype. (c_parse_file): New prototype. (finish_file): Move prototype from c-tree.h. * c-decl.c: Include <hashtab.h>. (builtin_decls): New. (current_file_decl): New. (duplicate_decls): Add extra parameter. Change all callers. Don't output duplicate common symbols. (link_hash_hash): New. (link_hash_eq): New. (poplevel): Handle popping of the top level. (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL. (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate. (pushdecl_top_level): Likewise. (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL. (c_init_decl_processing): Create TRANSLATION_UNIT_DECL. (finish_decl): Handle TRANSLATION_UNIT_DECL. (merge_translation_unit_decls): New. (c_write_global_declarations): New. (c_reset_state): New. (implicitly_declare): Handle TRANSLATION_UNIT_DECL. * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New. * c-objc-common.c (c_cannot_inline_tree_fn): Handle TRANSLATION_UNIT_DECL. (c_objc_common_finish_file): Call merge_translation_unit_decls. * c-opts.c (in_fnames): Rename from in_fname. (c_common_decode_option): Handle multiple input filenames. (c_common_post_options): Likewise. (c_common_parse_file): Likewise; also, call c_parse_file rather than yyparse. * c-parse.in: Move cleanup code to c_parse_file. (free_parser_stacks): Move contents to c_parse_file. (c_parse_file): New. * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT for integer types. (C_DECL_FILE_SCOPE): New. (finish_file): Move prototype to c-common.h. (merge_translation_unit_decls): New prototype. (comptypes): Add extra parameter to prototype. (c_write_global_declarations): New prototype. * c-typeck.c (tagged_types_tu_compatible_p): New. (function_types_compatible_p): Add extra parameter, change all callers. (type_lists_compatible_p): Likewise. (comptypes): Likewise. (struct tagged_tu_seen): New. (tagged_tu_seen_base): New. (build_unary_op): Handle TRANSLATION_UNIT_DECL. (c_mark_addressable): Remove #if 0 code. * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add comment explaining why it shouldn't have to. * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY options. * cppinit.c (cpp_read_next_file): New. (cpp_read_main_file): Use it. * cpplib.c (undefine_macros): New. (cpp_undef_all): New. * cpplib.h (cpp_read_next_file): Prototype. (cpp_undef_all): Prototype. * langhooks-def.h (write_global_declarations): Remove prototype. * toplev.h (write_global_declarations): Add prototype. * tree.c (decl_type_context): Use switch statement, handle TRANSLATION_UNIT_DECL. * tree.def: Update documentation for TRANSLATION_UNIT_DECL. (TRANSLATION_UNIT_DECL): New kind of tree. * tree.h: Update documentation for TRANSLATION_UNIT_DECL. * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies. * doc/invoke.texi: Make attempt to document new functionality. 2003-05-19 Per Bothner <bothner@apple.com> * gcc.c (combine_inputs): New. (process_command): Set combine_inputs. (do_spec_1): Handle combine_inputs. (main): Likewise. Index: cp/ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * decl.c (cp_finish_decl): Handle 'used' attribute. * cp-lang.c (c_reset_state): New dummy routine. * cp-tree.h (finish_file): Move prototype to c-common.h. * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. From-SVN: r69224
2003-07-09* objc-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.Jan Hubicka1-0/+2
From-SVN: r69144
2003-07-06c-common.h (c_comon_handle_filename, [...]): New.Neil Booth1-0/+4
* c-common.h (c_comon_handle_filename, c_common_missing_arguement): New. * c-lang.c (LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT): New. * c-opts.c (missing_arg): Rename c_common_missing_argument, update to be an appropriate langhook. (c_common_handle_option): Don't handle filenames. (c_common_handle_filename): New. * hooks.c (hook_void_constcharptr, hook_bool_constcharptr_size_t_false): New. * hooks.h (hook_void_constcharptr, hook_bool_constcharptr_size_t_false): New. * langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT): New. (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (struct lang_hooks): Add handle_filename and missing_argument. * opts.c (handle_option): Don't handle filenames here, but ... (handle_options): ... here. (common_handle_option): Don't handle missing arguments here. * objc/objc-lang.c (LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT): New. ada: * misc.c (gnat_handle_option): Don't handle filenames. cp: * cp-lang.c (LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT): Override. f: * top.c (ffe_handle_option): Don't handle filenames. java: * lang.c (java_handle_option): Don't handle filenames. From-SVN: r69011
2003-07-05cpplib.h (CPP_AT_NAME, [...]): New token types.Zack Weinberg1-21/+5
* cpplib.h (CPP_AT_NAME, CPP_OBJC_STRING): New token types. (struct cpp_options): Add narrow_charset, wide_charset, bytes_big_endian fields. Remove EBCDIC field. (cpp_init_iconv, cpp_interpret_string): New external interfaces. * cpphash.h: Include <iconv.h> if we have it, otherwise provide a dummy definition of iconv_t. (struct cpp_reader): Add narrow_cset_desc and wide_cset_desc fields. (_cpp_valid_ucn): Update prototype. (_cpp_destroy_iconv): New prototype. * doc/cpp.texi: Document character set handling. * doc/cppopts.texi: Document -fexec-charset= and -fexec-wide-charset=. * doc/extend.texi: Delete entire section on multiline strings. Rewrite section on __FUNCTION__ etc now that these are variables in C. * cppucnid.tab, cppucnid.pl: New files. * cppucnid.h: New generated file. * cppcharset.c: Include cppucnid.h. Lots of commentary added. (iconv_open, iconv, iconv_close): Provide dummy definitions if !HAVE_ICONV. (SOURCE_CHARSET, struct strbuf, init_iconv_desc, cpp_init_iconv, _cpp_destroy_iconv, convert_cset, width_to_mask, convert_ucn, emit_numeric_escape, convert_hex, convert_oct, convert_escape, cpp_interpret_string, narrow_str_to_charconst, wide_str_to_charconst): New. (ucn_valid_in_identifier): Use a binary search through the ucnranges table defined in cppucnid.h, not a long chain of if statements. (_cpp_valid_ucn): Add a limit pointer. Downgrade "universal character names are only valid in C++ and C99" to a warning. Issue the "meaning of \[uU] is different in traditional C" warning here. Take care not to let iconv see an invalid UCS value if we get a malformed UCN. Issue an error if we don't have iconv. (cpp_interpret_charconst): Moved here from cpplex.c. Use cpp_interpret_string to do the heavy lifting. * cppinit.c (cpp_create_reader): Initialize bytes_big_endian, narrow_charset, wide_charset fields of options structure. (cpp_destroy): Call _cpp_destroy_iconv. * cpplex.c (forms_identifier_p): Adjust call to _cpp_valid_ucn. (maybe_read_ucn, hex_digit_value, cpp_parse_escape): Delete. (cpp_interpret_charconst): Moved to cppcharset.c. * cpplib.c (dequote_string): Delete. (interpret_string_notranslate): New. (do_line, do_linemarker): Use interpret_string_notranslate. * Makefile.in (cppcharset.o): Depend on cppucnid.h. * c-common.c (fname_string, combine_strings): Delete. * c-common.h (fname_string, combine_strings): Delete prototypes. * c-lex.c (ignore_escape_flag): Delete. (cb_ident): Use cpp_interpret_string, not lex_string. (get_nonpadding_token): New function. (c_lex): Handle Objective-C @-prefixed identifiers and strings here. Adjust calls to lex_string. Don't write *value twice. (lex_string): Now handles string constant concatenation. Most of the work handed off to cpp_interpret_string. Call fix_string_type here. * c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): Replace with FUNC_NAME, throughout. (OBJC_STRING): New token type. (primary:STRING): No need to call fix_string_type here. (primary:objc_string): Make that OBJC_STRING. (objc_string nonterminal): Delete. (yylexname): Delete code to handle fake string constants. (yylexstring): Delete entirely. (_yylex): Handle CPP_AT_NAME and CPP_OBJC_STRING. No need to handle CPP_ATSIGN. * c.opt (-fexec-charset=, -fwide-exec-charset=): New options. * c-opts.c (missing_arg, c_common_handle_option): Handle OPT_fexec_charset_ and OPT_fwide_exec_charset_. (c_common_init): Set cpp_opts->bytes_big_endian, not cpp_opts->EBCDIC. Call cpp_init_iconv. (print_help): Document -fexec-charset= and -fexec-wide-charset=. (TARGET_EBCDIC): Delete default definition. * objc/objc-act.c (build_objc_string_object): No need to handle string constant concatenation. cp: * parser.c (cp_lexer_read_token): No need to handle string constant concatenation. testsuite: * gcc.c-torture/execute/wchar_t-1.x: New file; XFAIL wchar_t-1.c everywhere. * gcc.dg/concat.c: Concatenation of string constants with __FUNCTION__ / __PRETTY_FUNCTION__ is now a hard error. * gcc.dg/wtr-strcat-1.c: Loosen dg-warning regexp. * gcc.dg/cpp/escape-2.c: Use wide character constants where necessary to avoid multi-character character constant warning. * gcc.dg/cpp/escape.c: Likewise. * gcc.dg/cpp/ucs.c: Likewise. Remove backslashes from dg-bogus comments, as they confuse Tcl. Fix a typo. libstdc++-v3: * testsuite/22_locale/collate/compare/wchar_t/2.cc * testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc * testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc * testsuite/22_locale/collate/hash/wchar_t/2.cc * testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc * testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc * testsuite/22_locale/collate/transform/wchar_t/2.cc * testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc * testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc: XFAIL on all targets. From-SVN: r68952
2003-06-30c-common.c (enum c_language_kind, flag_objc): Remove.Neil Booth1-9/+2
* c-common.c (enum c_language_kind, flag_objc): Remove. (fix_string_type, check_case_value, c_common_nodes_and_builtins, c_add_case_label, finish_label_addr_expr, boolean_increment): Use c_dialect_ macros. * c-common.h (enum c_language_kind): Extend. (c_dialect_cxx, c_dialect_objc): New. (flag_objc): Remove. (c_common_init_options): Update prototype. * c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_ macros. * c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_ macros. * c-format.c (C_STD_VER, C_STD_NAME): Similarly. * c-lang.c (c_init_options): Remove. (c_language): Define. (LANG_HOOKS_INIT_OPTIONS): Use common hook. * c-lex.c (lex_charconst): Use c_dialect_cxx(). * c-opts.c (lang_flags): Make function-local. (c_common_init_options): Use c_dialect_ macros. Handle C++ diagnostic requirements. (c_common_handle_option, c_common_post_options): Use flag_cxx. * c-parse.in (init_reswords): Use c_dialect_objc (). * c-pch.c (get_ident): Use c_language. * c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros. * c-typeck.c (comptypes, build_c_cast): Similarly. * objc/objc-lang.c (c_language): Define. (LANG_HOOKS_INIT_OPTIONS): Use common hook. (objc_init_options): Remove. cp: * Make-lang.in: Update. * cp-lang.c (c_language): Define. (LANG_HOOKS_INIT_OPTIONS): Use common hook. * cp-tree.h (cxx_init_options): Remove. * lex.c: Don't include diagnostic.h. (cxx_init_options): Remove. From-SVN: r68734
2003-06-27c-tree.h (grokfield): Remove unused filename and line parameters.Nathan Sidwell1-98/+49
* c-tree.h (grokfield): Remove unused filename and line parameters. * c-decl.c (grokfield): Remove unused filename and line parameters. * c-parse.in (component_decl): Adjust field grokking rules, adjust grokfield calls. (component_declarator): Likewise. (component_notype_declarator): Likewise. * objc/objc-act.c (build_module_descriptor): Adjust grokfield calls. (build_protocol_template, build_method_prototype_list_template, build_method_prototype_template, build_category_template, build_selector_template, build_class_template, build_super_template, build_ivar_template, build_ivar_list_template, build_method_list_template, build_method_template, add_instance_variable): Likewise. From-SVN: r68560
2003-06-25re PR c/10178 (ICE in tree_low_cst)Zack Weinberg1-0/+2
PR 10178 * langhooks.h (struct lang_hooks): Add no_body_blocks bool. * langhooks-def.h (LANG_HOOKS_NO_BODY_BLOCKS): New; default false. * c-lang.c, objc/objc-lang.c: Override LANG_HOOKS_NO_BODY_BLOCKS to true. * stmt.c (is_body_block): If lang_hooks.no_body_blocks, always return 0. From-SVN: r68483
2003-06-14tree.h (init_function_start): Remove filename and line paramters.Nathan Sidwell1-3/+7
* tree.h (init_function_start): Remove filename and line paramters. * function.c (init_function_start): Remove filename and line parameters. Use DECL_SOURCE_LOCATION. * c-decl.c (store_parm_decls): Adjust init_function_start call. (c_expand_body_1): Likewise. * coverage.c (create_coverage): Likewise. * ada/utils.c (begin_subprog_body): Adjust init_function_start call. * cp/decl.c (start_function): Adjust init_function_start call. * cp/method.c (use_thunk): Likewise. * cp/semantics.c (genrtl_start_function): Likewise. * f/com.c (stor_parm_decls): Adjust init_function_start call. * java/class.c (emit_register_classes): Adjust init_function_start call. * java/decl.c (complete_start_java_method): Likewise. * java/resource.c (write_resource_constructor): Likewise. * objc/objc-act.c (build_tmp_function_decl): Set line number to zero. (hack_method_prototype): Adjust init_function_start call. * treelang/treetree.c (tree_code_create_function_initial): Adjust init_function_start call. From-SVN: r67953
2003-06-07Makefile.in (OJBS, c-opts.o): Update.Neil Booth1-5/+5
* Makefile.in (OJBS, c-opts.o): Update. (c-options.c, c-options.h): Rename options.h and options.c. (options.h): Rename options_.h. (opts.o): New. * c-common.h (c_common_handle_option): Replace c_common_decode_option. (c_common_init_options): Update prototype. * c-lang.c (c_init_options): Update prototype. (LANG_HOOKS_HANDLE_OPTION): Override. (LANG_HOOKS_DECODE_OPTION): Drop. * c-opts.c: Include opts.h and options.h instead of c-options.h and c-options.c. (lang_flags): Move to file scope. (find_opt, c_common_decode_option): Remove. (CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE, CL_REJECT_NEGATIVE): Move to opts.h. (missing_arg): Update prototype. (c_common_init_options): Update for new prototype. (c_common_handle_options): Filenames are passed as N_OPTS. * hooks.c (hook_int_void_0): New. * hooks.h (hook_int_void_0): New. * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default. (LANG_HOOKS_HANDLE_OPTION): Default to NULL for now. (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (init_options): Update. (handle_option): New. * opts.c, opts.h: New files. * opts.sh: Update c file to include opts.h and options.h. * toplev.c: Include opts.h; change options.h to options_.h. (parse_options_and_default_flags): Get lang_mask, use handle_option for language-specific handling. * objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. (objc_init_options): Update. ada: * misc.c (gnat_init_options): Update. cp: * cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. * cp-tree.h (cxx_init_options): Update. * lex.c (cxx_init_options): Update. f: * com.c (ffe_init_options): Update. java: * lang.c (java_init_options): Update. From-SVN: r67584
2003-06-05install.tex: Document profiledbootstrap.Jan Hubicka1-0/+6
* install.tex: Document profiledbootstrap. * Makefile.tpl (profiledbootstrap): New target. * Makefile.in (profiledbootstrap): New target. * Makefile.in (clean, distclean): Kill new stages (POSTSTAGE1_FLAGS_TO_PASS): Break from ... (STAGE2_FLAGS_TO_PASS): ... this one. (STAGEPROFILE_FLAGS_TO_PASS, STAGEFEEDBACK_FLAGS_TO_PASS): New. (stage[2-4]_build): Add POSTSTAGE1_FLAGS_TO_PASS. (stageprofile_build, stageprofile_copy, stagefeedback_build, stagefeedback_copy): New. (restageprofile, restagefeedback, stageprofile-start, stageprofile, stagefeedback-start): Likewise. * Make-lang.in: Add support for stageprofile and stagefeedback From-SVN: r67498
2003-05-29Remove OBJC_PROLOGUE everywhere.Stan Shebs1-4/+0
* objc/objc-act.c (finish_objc): Remove use of OBJC_PROLOGUE. * config/avr/avr.h: Remove no-op ref to OBJC_PROLOGUE. * config/d30v/d30v.h: Similarly. * config/ip2k/ip2k.h: Similarly. * doc/tm.texi: Remove doc of OBJC_PROLOGUE. From-SVN: r67229
2003-05-23rs6000.c (expand_block_move): Unify the TARGET_STRING and ! TARGET_STRING cases.Geoffrey Keating1-2/+2
* config/rs6000/rs6000.c (expand_block_move): Unify the TARGET_STRING and ! TARGET_STRING cases. From-SVN: r67140
2003-05-20tree.c (expr_last): New fn.Jason Merrill1-4/+4
* tree.c (expr_last): New fn. * tree.h: Declare it. * objc/objc-act (expr_last): Rename to objc_expr_last. From-SVN: r67035
2003-05-13diagnostic.c (output_format): Add support for %m.Zack Weinberg1-1/+1
* diagnostic.c (output_format): Add support for %m. (output_printf, output_verbatim, diagnostic_set_info, verbatim): Set err_no field of the text_info structure being initialized. (fatal_io_error): Delete function. * diagnostic.h (text_info): Add err_no field. * toplev.h (fatal_io_error): Delete prototype. * c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c * toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c * f/com.c, java/jcf-parse.c, java/jcf-write.c, java/lex.c * objc/objc-act.c: Replace all calls to fatal_io_error with calls to fatal_error; add ": %m" to the end of all the affected error messages. From-SVN: r66769
2003-05-12diagnostic.c (diagnostic_for_decl): Take a diagnostic_context argument.Zack Weinberg1-9/+0
* diagnostic.c (diagnostic_for_decl): Take a diagnostic_context argument. Restructure to be consistent with diagnostic_report_diagnostic. (diagnostic_count_diagnostic): Now static. Take a diagnostic_info argument, not just a diagnostic_t. Some code moved here from internal_error. Move a case label for clarity. (diagnostic_action_after_output): New function. Code moved here from internal_error and fatal_error. (bug_report_request): New #define so that this text appears in only one place. (diagnostic_report_diagnostic): Update to match changes to diagnostic_count_diagnostic. Call diagnostic_action_after_output. (diagnostic_set_info): Call gettext here. (pedwarn): Update comment. Don't call gettext here. (sorry): Use report_diagnostic. Don't call gettext here. (fatal_error): Remove final fnotice and exit, but call real_abort to prevent warnings about noreturn function returning. (internal_error): Likewise. Don't do ICE suppression here nor call context->internal_error. (warning_with_decl): Suppress for decls in system headers. Adjust call to diagnostic_for_decl. (pedwarn_with_decl): Likewise. (error_with_decl): Adjust call to diagnostic_for_decl. (error_recursion): Use bug_report_request. * diagnostic.h: Remove prototype of diagnostic_count_diagnostic. * objc/objc-act.c (error_with_ivar, warn_with_method): Don't call diagnostic_count_diagnostic. f: * bad.c: Don't call diagnostic_count_diagnostic. From-SVN: r66728
2003-05-08objc-act.c (error_with_ivar): Don't use error_with_file_and_line.Gabriel Dos Reis1-9/+4
* objc/objc-act.c (error_with_ivar): Don't use error_with_file_and_line. (warn_with_method): Don't use warning_with_file_and_line. From-SVN: r66607
2003-05-01input.h (lineno): Rename to ...Nathan Sidwell1-86/+83
* input.h (lineno): Rename to ... (input_line): ... here. * tree.h (lineno): Rename to ... (input_line): ... here. * scan.h (lineno): Rename to ... (input_line): ... here. * toplev.c (lineno): Rename to ... (input_line): ... here. (push_srcloc, pop_srcloc): Rename lineno to input_line. * c-common.c (c_expand_start_cond, fname_decl): Likewise. * c-decl.c (poplevel, pop_label_level, lookup_label, lookup_tag, store_parm_decls, c_expand_body_1): Likewise. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-lex.c (fe_file_change, cb_def_pragma, c_lex): Likewise. * c-opts.c (c_common_post_options, c_common_parse_file): Likewise. * c-parse.in (save_filename, maybe_type_qual, ifc): Likwise. * c-semantics.c (finish_stmt_tree, build_stmt, emit_local_var, gentrtl_goto_stmt, genrtl_expr_stmt_value, genrtl_decl_stmt, genrtl_if_stmt, genrtl_while_stmt, genrtl_do_stmt, genrtl_return_stmt, genrtl_for_stmt, build_break_stmt, build_continue_stmt, genrtl_switch_stmt, genrtl_asm_stmt, prep_stmt, find_reachable_label, expand_unreachable_stmt): Likewise. * coverage.c (create_coverage): Likewise. * diagnostic.c (pedwarn, sorry, error, fatal_error, internal_error, warning, diagnostic_report_current_module, inform): Likewise. * expr.c (expand_expr): Likewise. * integrate.c (expand_inline_function, output_inline_function): Likewise. * rtl-error.c (file_and_line_for_asm): Likewise. * tree-inline.c (find_alloca_call, find_builtin_longjmp_call, walk_tree): Likewise. * tree.c (make_node): Likewise. * ada, cp, f, java, objc, treelang: Likewise. ada * trans.c (build_unit_elab, set_lineno): Rename lineno to input_line. * utils.c (pushdecl, create_label_decl, begin_subprog_body, end_subprog_body): Likewise. * utils2.c (build_call_raise): Likewise. cp * class.c (finish_struct): Rename lineno to input_line. * decl.c (push_binding_level, pop_binding_level, suspend_binding_level, resume_binding_level, make_label_decl, use_label, start_function): Likewise. * decl2.c (warn_if_unknown_interface, start_static_initialization_or_destruction, generate_ctor_or_dtor_function, finish_file): Likewise. * error.c (cp_line_of, print_instantiation_full_context, print_instantiation_context): Likewise. * except.c (check_handlers_1, check_handlers): Likewise. * init.c (create_temporary_var): Likewise. * method.c (use_thunk, synthesize_method): Likewise. * parser.c (cp_lexer_set_source_position_from_token, cp_lexer_get_preprocessor_token): Likewise. * pt.c (push_tinst_level, pop_tinst_level, tsubst_friend_function, instantiate_class_template, tsubst_decl, tsubst, tsubst_expr, instantiate_decl): Likewise. * semantics.c (genrtl_try_block, finish_label_stmt, begin_class_definition, expand_body, genrtl_finish_function): Likewise. * tree.c (build_min_nt, build_min): Likewise. f * ansify.c (die_unless): Rename lineno to input_line. * com.c (ffecom_subscript_check_, ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_, bison_rule_pushlevel_, bison_rule_compstmt_, finish_function, store_parm_decls): Likewise. * intrin.c (ffeintrin_fulfill_generic): Likewise. * lex.c (ffelex_hash_, ffelex_include_, ffelex_next_line_, ffelex_file_fixed, ffelex_file_free): Likewise. * std.c (ffestd_exec_end): Likewise. * ste.c (ffeste_emit_line_note_, ffeste_start_block_, ffeste_start_stmt_): Likewise. * ste.h (ffeste_filelinenum, ffeste_set_line): Likewise. java * lex.h (lineno): Rename to ... (input_line): ... here * parse-scan.y (lineno): Rename to ... (input_line): ... here. (reset_report): Rename lineno to input_line. * check-init.c (check_init): Likewise. * class.c (push_class): Likewise. * decl.c (complete_start_java_method, end_java_method): Likewise. * expr.c (expand_byte_code): Likewise. * jcf-parse.c (give_name_to_class, parse_class_file): Likewise. * jcf-write.c (generate_bytecode_insns): Likewise. * lex.c (java_init_lex, java_allocate_new_line, do_java_lex): Likewise. * parse.h (YYNOT_TWICE): Likewise. * parse.y (empty_statement, expression_statement, java_pop_parser_context, java_parser_context_save_global, yyerror, register_fields, method_header, safe_layout_class, find_in_imports_on_demand, create_artificial_method, source_end_java_method, start_complete_expand_method, build_thisn_assign, java_complete_lhs, maybe_absorb_scoping_block): Likewise. objc * objc-act.c (objc_init): Rename lineno to input_line. (build_module_descriptor, build_selector_translation_table, build_protocol_template, build_method_prototype_list_template, build_category_template, build_selector_table, build_class_template, build_super_template, build_ivar_template, build_ivar_list_template, build_method_list_template, build_method_template, add_instance_variable): Likewise. treelang * tree1.c (treelang_init): Rename lineno to input_line. From-SVN: r66333
2003-04-13tree.c (build_constructor): New function.Zack Weinberg1-27/+32
* tree.c (build_constructor): New function. * tree.h: Prototype it. * c-typeck.c (build_c_cast, pop_init_level) * profile.c (build_function_info_value, build_gcov_info_value) (create_profiler): Use build_constructor. * builtins.c (expand_builtin_args_info): Remove #if 0 blocks. * objc/objc-act.c (build_constructor): Rename objc_build_constructor. Use build_constructor. (build_objc_string_object, objc_add_static_instance) (init_def_list, init_objc_symtab, init_module_descriptor) (generate_static_references, build_selector_translation_table) (build_descriptor_table_initializer, generate_descriptor_table) (build_protocol_initializer, build_ivar_list_initializer) (generate_ivars_list, build_dispatch_table_initializer) (generate_dispatch_table, generate_protocol_list) (build_category_initializer, build_shared_structure_initializer): Update to match. ada: * gigi.h, utils2.c (build_constructor): Rename gnat_build_constructor. Use build_constructor. * decl.c (gnat_to_gnu_entity) * trans.c (tree_transform, pos_to_constructor, extract_values) * ada/utils.c (build_template, convert_to_fat_pointer, convert) (unchecked_convert) * ada/utils2.c (build_binary_op, build_call_raise, build_allocator) (fill_vms_descriptor): Update to match. cp: * class.c (initialize_array) * decl.c (reshape_init) * decl2.c (build_expr_from_tree) * init.c (build_zero_init) * pt.c (tsubst_copy, tsubst_copy_and_build) * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer) (ptm_initializer, class_initializer, get_pseudo_ti_init) * semantics.c (finish_compound_literal) * typeck.c (build_ptrmemfunc1) * typeck2.c (store_init_value, process_init_constructor) (build_functional_cast): Use build_constructor. f: * com.c (ffecom_build_complex_constant_, ffecom_expr_) (ffecom_init_zero_, ffecom_transform_namelist_, ffecom_vardesc_) (ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_2) * ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_) (ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_): Use build_constructor. java: * class.c (make_field_value, make_method_value, get_dispatch_table) (make_class_data, emit_offset_symbol_table) * constants.c (build_constants_constructor) * java-tree.h (START_RECORD_CONSTRUCTOR) * parse.y (maybe_build_array_element_wfl): Use build_constructor. From-SVN: r65539
2003-04-11c-decl.c (struct binding_level): Add shadowed_tags and function_body...Zack Weinberg1-2/+2
2003-04-10 Zack Weinberg <zack@codesourcery.com> * c-decl.c (struct binding_level): Add shadowed_tags and function_body; remove this_block, tag_transparent, and subblocks_tag_transparent; update comments. (clear_binding_level, lookup_tag_reverse): Kill. (make_binding_level): Use ggc_alloc_cleared or memset. (lookup_tag): Remove struct binding_level* parameter. All callers changed. Just look at IDENTIFIER_TAG_VALUE, and current_binding_level->tags if asked for thislevel_only or if we might have to diagnose "struct foo; union foo;" (pushlevel): Ignore argument. Do not push another binding level on the transition from the parameters to the top level of the function body; just tweak the flags and proceed. (poplevel): Overhaul. Clear IDENTIFIER_TAG_VALUEs; on exiting a function body, separate the parameter list from the top-level local variables. (set_block): Do nothing. (pushtag): Set IDENTIFIER_TAG_VALUE and add an entry to shadowed_tags if necessary. (warn_if_shadowing): Nuke the special case for local shadowing parameter. (pushdecl): Do not create a shadow entry if we are replacing an older decl in the same binding level. (pushdecl_function_level): Tweak for new way of indicating function scope. (shadow_tag_warned): Use TYPE_NAME, not lookup_tag_reverse. (start_function): Don't set subblocks_tag_transparent. (finish_function): Fix up the binding_level stack for totally empty functions. Otherwise, don't call poplevel. * c-common.c (shadow_warning): MANDATORY argument is no longer necessary. Always use plain warning. * c-common.h: Update to match. * cfglayout.c (scope_to_insns_initialize): Clear block when we hit the FUNCTION_DECL. * function.c: Do not create cyclic tree structure. 2003-04-10 Zack Weinberg <zack@codesourcery.com> * c-tree.h (struct lang_identifier): Replace global_value, local_value members with symbol_value, tag_value. Kill implicit_decl and limbo_value. (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_LOCAL_VALUE, IDENTIFIER_LIMBO_VALUE, IDENTIFIER_IMPLICIT_DECL, C_MISSING_PROTOTYPE_WARNED): Kill. (IDENTIFIER_SYMBOL_VALUE, IDENTIFIER_TAG_VALUE, C_DECL_IMPLICIT, C_DECL_ISNT_PROTOTYPE): New. (C_DECL_ANTICIPATED): Rename to C_DECL_INVISIBLE. (implicit_decl_warning, lookup_name_current_level, record_function_scope_shadow): Don't prototype. (pushdecl_function_level): Prototype. * c-decl.c (truly_local_externals): New variable. (struct binding_level): Adjust commentary. (get_function_binding_level, clear_limbo_values, record_function_scope_shadow): Kill. (lookup_name_current_level, implicit_decl_warning): Are now static. (any_external_decl, record_external_decl): New static functions. (clone_underlying type): Split out of pushdecl. (c_print_identifier): Update to match changes to struct lang_identifier. (poplevel): Delete #if 0 block. Make externals invisible instead of clearing their IDENTIFIER_SYMBOL_VALUEs. Don't call clear_limbo_values. Refer to IDENTIFIER_SYMBOL_VALUE not IDENTIFIER_GLOBAL_VALUE or IDENTIFIER_LOCAL_VALUE. (duplicate-decls): For real parm decl after a forward decl, set TREE_ASM_WRITTEN here. Allow void foo(...) followed by foo(...) { } with only a warning. Say whether a previous declaration was implicit. (warn_if_shadowing): Now handles all shadowing, not just local-over-local. Clarify comments. (pushdecl): Rewritten. There is no longer a distinction between global and local symbol values; they're all IDENTIFIER_SYMBOL_VALUE. Call record_external_decl on all DECL_EXTERNAL decls, and use any_external_decl to check against previous externals. Kill #if 0 blocks. Don't tolerate error_mark_node being NULL. (pushdecl_top_level): Handle only those cases which Objective C (the only user) needs. (pushdecl_function_level): New function. (implicitly_declare): Create ordinary decls with C_DECL_IMPLICIT set. Recycle old decls, however they got created. (lookup_name): It's always IDENTIFIER_SYMBOL_VALUE. Return 0 for C_DECL_INVISIBLE symbols. (lookup_name_current_level): Likewise. Use chain_member. (c_make_fname_decl): Don't muck with DECL_CONTEXT. Use pushdecl_function_level. (builtin_function): Use C_DECL_INVISIBLE. (start_function): Don't muck with IDENTIFIER_IMPLICIT_DECL. Use C_DECL_ISNT_PROTOTYPE and C_DECL_IMPLICIT. (store_parm_decls): It's IDENTIFIER_SYMBOL_VALUE now. (identifier_global_value): Same. Must scan global_binding_level in extremis. * c-typeck.c (undeclared_variable): New static function, split from build_external_ref. (build_external_ref): Use DECL_CONTEXT, not IDENTIFIER_LOCAL_VALUE, to decide whether a local hides an instance variable. Restructure for clarity. * objc/objc-act.c: Use identifier_global_value, not IDENTIFIER_GLOBAL_VALUE. cp: * decl.c: Update all calls to shadow_warning. testsuite: * gcc.c-torture/execute/builtin-noret-2.c: New. * gcc.c-torture/execute/builtin-noret-2.x: New. XFAIL builtin-noret-2.c at -O1 and above. * gcc.dg/redecl.c: New. * gcc.dg/Wshadow-1.c: Update error regexps. From-SVN: r65460
2003-03-08c-common.h (c_common_init, [...]): Update.Neil Booth2-8/+6
* c-common.h (c_common_init, c_common_post_options): Update. * c-objc-common.c (c_objc_common_init): Update for new prototype. * c-opts.c (saved_lineno): New. (c_common_post_options, c_common_init): Update prototypes, move call to cpp_read_main_file from latter to former. * c-tree.h (c_ojbc_common_init): Update. * langhooks-def.h (lhd_post_options): New. (LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update. * langhooks.c (lhd_post_options): New. * langhooks.h (struct lang_hooks): Update post_options and init hooks. * toplev.c (no_backend): New. (process_options): Call post_options hook and set main_input_filename and input_filename here. (lang_dependent_init, do_compile): post_options hook moved to process_options. * objc/objc-act.c (objc_init): Update prototype. * objc/objc-act.h (objc_init): Update prototype. ada: * misc.c (gnat_init): Update for new prototype. cp: * cp-tree.h (cxx_init): Update prototype. * lex.c (cxx_init): Similarly. f: * com.c (ffe_init): Update prototype; move code to ffe_post_options. (ffe_post_options): New. java: * lang.c (java_init): Update prototype, move code to java_post_options. (java_post_options): Similarly. treelang: * tree1.c (in_fname): Fix type. (treelang_init): Update prototype and use of in_fname. * treelang.h (in_fname): Fix type. * treetree.c (tree_code_if_start, tree_code_if_else, tree_code_if_end, tree_code_create_function_prototype, tree_code_create_function_initial, tree_code_create_funciton_wrapup, tree_code_create_variable, tree_code_output_expression_statement) : Fix prototypes and use of filenames. * treetree.h: Similarly. From-SVN: r64001
2003-03-07lang-specs.h (objective-c-header): Use .gch not .pch; support ↵Geoffrey Keating1-5/+5
-no-integrated-cpp. * objc/lang-specs.h (objective-c-header): Use .gch not .pch; support -no-integrated-cpp. * c-pch.c (get_ident): Use c_language_kind and flag_objc rather than langhooks.name. From-SVN: r63955
2003-03-07c-pch.c: Include langhooks.h.Geoffrey Keating4-14/+29
* c-pch.c: Include langhooks.h. (IDENT_LENGTH): New. (get_ident): New. (pch_ident): Delete. (pch_init): Use get_ident, IDENT_LENGTH. (c_common_valid_pch): Likewise. Also, use actual language in warning message. * Makefile.in (c-pch.o): Add langhooks.h to dependencies. * objc/config-lang.in (gtfiles): Add objc-act.c. Remove duplicate c-parse.in. * objc/Make-lang.in (objc/objc-act.o): Add dependency on gt-objc-objc-act.h. (gt-objc-objc-act.h): New rule. * objc/lang-specs.h: Support PCH. * objc/objc-act.c: Include gt-objc-objc-act.h. (objc_add_static_instance): Move num_static_inst out, mark for PCH. (build_selector_reference_decl): Move idx out, mark for PCH. (build_class_reference_decl): Likewise. (build_objc_string_decl): Move *_idx out, mark for PCH. (build_tmp_function_decl): Move xxx out, mark for PCH. From-SVN: r63924
2003-03-04sourcebuild.texi (Front End Directory): Document tags.Tom Tromey1-0/+3
* doc/sourcebuild.texi (Front End Directory): Document tags. * configure: Rebuilt. * configure.in (target_list): Added tags. * Makefile.in (TAGS): Depend on lang.clean. Include subdirectory TAGS files by reference. * objc/Make-lang.in (objc.tags): New target. From-SVN: r63808
2003-03-02gcc.c (default_compilers): Add -no-integrated-cpp flag to invoke an external ↵Ashif Harji1-4/+4
cpp during compilation. * gcc.c (default_compilers): Add -no-integrated-cpp flag to invoke an external cpp during compilation. (option_map): Likewise. * cp/lang-specs.h (default_compilers): Similarly. * objc/lang-specs.h (default_compilers): Similarly. * doc/invoke.texi: Document -no-integrated-cpp flag. From-SVN: r63664
2003-02-26* objc-act.c: (mark_referenced_methods): Fix compilation problem.Jan Hubicka1-2/+2
From-SVN: r63478
2003-02-26objc-act.c: Include cgraph.hJan Hubicka2-0/+29
* objc-act.c: Include cgraph.h (mark_referenced_methods): New function. (objc_init): Call it. * objc-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Set. * c-decl.c (finish_function): Honor can_defer_p even in unit-at-a-time mode. * optabs.c (expand_fix): Do not widen the input operand. * expr.c (emit_group_store): Fix crash when converting single register into complex register. * Makefile.in (jump.o, regclass.o, alias.o): Add dependency on timevar.h * alias.c: Include timevar.h (init_alias_analysis): Set timevar * jump.c: Include timevar.h (rebuild_jump_labels): Set timevar * regcalss.c: Include timevar.h (reg_scan): Set timevar * timevar.def (TV_ALIAS_ANALYSIS, TV_REG_SCAN, TV_REBUILD_JUMP): New From-SVN: r63464
2003-01-31tree.h (TYPE_BINFO_SIZE, [...]): Remove.Nathan Sidwell1-1/+1
* tree.h (TYPE_BINFO_SIZE, TYPE_BINFO_SIZE_UNIT): Remove. (BINFO_ELTS): New #define. * stor-layout.c (finalize_record_size): Don't set them. * cp/cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS. (BINFO_LANG_ELTS): New #define. * cp/tree.c (make_binfo): Use BINFO_LANG_ELTS. * java/class.c (make_class): Use BINFO_ELTS. (set_super_info): Likewse. (add_interface_do): Likewise. * objc/objc-act.c (start_class): Use BINFO_ELTS. From-SVN: r62180
2003-01-30* objc/Make-lang.in (objc-parse.y): Find c-parse.in in $(srcdir).Loren J. Rittle1-1/+1
From-SVN: r62127
2003-01-21Makefile.in (GCC_WARN_CFLAGS): Add $(WERROR) $($@-warn) (gtype-desc.o-warn...Kaveh R. Ghazi1-0/+2
gcc: * Makefile.in (GCC_WARN_CFLAGS): Add $(WERROR) $($@-warn) (gtype-desc.o-warn, c-decl.o-warn, varasm.o-warn, gcc.o-warn, insn-conditions.o-warn, out_object_file, gengtype-yacc.o-warn, c-parse.o-warn): Add -Wno-error. (STAGE2_FLAGS_TO_PASS): Add WERROR="@WERROR@". * configure.in (--enable-werror): Add new flag. * doc/install.texi (--enable-werror): Document. * configure: Regenerate. * objc/Make-lang.in (objc/objc-parse.o-warn): Add -Wno-error. cp: Make-lang.in (cp/decl.o-warn): Add -Wno-error. f: Make-lang.in (f/sta.o-warn): Add -Wno-error. java: Make-lang.in (jvspec.o-warn): Add -Wno-error. From-SVN: r61544
2003-01-11Makefile.in (parsedir): New variable.Geoffrey Keating1-8/+8
* Makefile.in (parsedir): New variable. (docobjdir): New variable. (c-parse.o, c-parse.c, c-parse.y, gengtype-lex.o, gengtype-yacc.o, gengtype-lex.c, gengtype-yacc.c): Use parsedir. (info, cpp.info, gcc.info, gccint.info, gccinstall.info, cppinternals.info, generated-manpages, gcov.1, cpp.1, gcc.1, gfdl.7, gpl.7, fsf-funding.7, maintainer-clean, install-info, install-man): Use docobjdir. * objc/Make-lang.in (objc/objc-parse.c, objc/objc-parse.y, objc.maintainer-clean): Use parsedir. From-SVN: r61189
2003-01-10Merge from pch-branch.Geoffrey Keating1-0/+1
From-SVN: r61136
2003-01-02except.c, [...]: Fix Copyright years.Steven Bosscher4-4/+8
2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl> * cp/except.c, cp/expr.c, cp/friend.c, cp/g++spec.c, cp/lang-options.h, cp/lang-specs.h, cp/lex.h, cp/ptree.c, cp/repo.c, java/jcf-reader.c, java/jvgenmain.c, java/keyword.gperf, java/lang-options.h, java/mangle.c, java/mangle_name.c, java/xref.c, java/zextract.c,java/zipfile.h, objc/Make-lang.in, objc/config-lang.in, objc/lang-specs.h, objc/objc-act.h: Fix Copyright years. From-SVN: r60783
2003-01-01Make-lang.in, [...]: Replace "GNU CC" with "GCC" in the copyright header.Steven Bosscher8-41/+41
* objc/Make-lang.in, objc/config-lang.in, objc/lang-options.h, objc/lang-specs.h, objc/objc-act.c, objc/objc-act.h, objc/objc-lang.c, objc/objc-tree.def: Replace "GNU CC" with "GCC" in the copyright header. From-SVN: r60742