Commit Graph

29 Commits

Author SHA1 Message Date
Joseph Myers 9e637a2679 builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate.
* builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h,
	c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c,
	gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c,
	tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
	config/avr/avr.c, config/c4x/c4x.c, config/darwin.c,
	config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c,
	config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c,
	config/iq2000/iq2000.c, config/m32r/m32r.c,
	config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h,
	config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c,
	config/ns32k/ns32k.c, config/rs6000/host-darwin.c,
	config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c,
	config/sh/symbian.c, config/stormy16/stormy16.c,
	config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %<
	and %> as appropriate.  Use %' as apostrophe in diagnostics where
	applicable.  Use %< and %> in place of '' quotes where applicable.
	Use %qs in place of %<%s%>.  Consistently quote __builtin function
	names.

ada:
	* misc.c (gnat_handle_option): Use %< and %> for quoting in
	warning message.

cp:
	* call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c,
	pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for
	quoting in diagnostics.
	* parser.c (cp_parser_sizeof_operand): Use '' instead of `' for
	quoting in printf format.
	* decl.c (duplicate_decls, start_decl): Use %qD instead of
	unquoted %D.

objc:
	* objc-act.c: Use %q, %< and %> for quoting in diagnostics.

testsuite:
	* gcc.dg/builtin-prefetch-1.c: Adjust expected messages.

From-SVN: r90337
2004-11-09 10:13:30 +00:00
Joseph Myers 3f75a25471 c-aux-info.c, [...]: Follow code formatting conventions.
* c-aux-info.c, c-common.c, c-common.h, c-cppbuiltin.c, c-decl.c,
	c-format.c, c-incpath.c, c-lex.c, c-objc-common.c, c-opts.c,
	c-parse.in, c-pch.c, c-ppoutput.c, c-pragma.c, c-typeck.c: Follow
	code formatting conventions.

From-SVN: r88462
2004-10-03 21:53:05 +01:00
Joseph Myers 971801fff6 attribs.c, [...]: Use %<, %> and %q for quoting in diagnostics going through pretty-print.c.
gcc:
	* attribs.c, builtins.c, c-format.c, c-pch.c, coverage.c,
	except.c, fold-const.c, function.c, langhooks.c, params.c,
	reload.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
	tree-dump.c, tree-mudflap.c, tree.c, varasm.c: Use %<, %> and %q
	for quoting in diagnostics going through pretty-print.c.  Use ''
	for quoting in other diagnostic text.
	* langhooks.c: Include intl.h.  Mark text locating diagnostics for
	translation.
	* Makefile.in (langhooks.o): Update dependencies.
	* pretty-print.h (pp_printf): Mark as accepting GCC diagnostic
	formats.

gcc/testsuite:
	* g++.dg/ext/member-attr.C, g++.dg/warn/deprecated.C,
	gcc.dg/deprecated.c, gcc.dg/noreturn-1.c, gcc.dg/noreturn-4.c:
	Update expected messages.

libmudflap:
	* testsuite/libmudflap.c/pass35-frag.c: Update expected message.

From-SVN: r87563
2004-09-15 21:48:10 +01:00
Kazu Hirata 6cb38cd4ae c-common.c, [...]: Fix comment typos.
* c-common.c, c-pch.c, defaults.h, lambda-code.c, passes.c,
	tree-data-ref.c, tree-flow.h, tree-ssa-operands.c,
	tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h,
	value-prof.c: Fix comment typos.  Follow spelling conventions.

From-SVN: r87288
2004-09-10 10:44:48 +00:00
Nathan Sidwell 366de0ce7d c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable.
* c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable.
	* c-common.c (c_type_hash, c_common_nodes_and_builtins,
	c_expand_expr, boolean_increment, nonnull_check_p,
	check_function_arguments_recurse, fold_offsetof_1): Likewise.
	* c-cppbuiltin.c (define__GNUC__, builtin_define_stdint_macros,
	builtin_define_type_max): Likewise.
	* c-decl.c (bind, pop_scope, merge_decls, pushdecl_top_level,
	implicit_decl_warning, builtin_function, build_compound_literal,
	complete_array_type, grokdeclarator, get_parm_info,
	start_function, store_parm_decls_oldstyle,
	c_write_global_declarations): Likewise.
	* c-format.c (get_constant, decode_format_attr,
	maybe_read_dollar_number, get_flag_spec, check_format_arg,
	check_format_types, format_type_warning,
	find_char_info_specifier_index, init_dynamic_asm_fprintf_info,
	init_dynamic_diag_info, handle_format_attribute): Likewise.
	* c-gimplify.c (push_context, pop_context, finish_bc_block):
	* c-lex.c (c_lex_with_flags, lex_string): Likewise.
	* c-objc-common.c (c_tree_printer): Likewise.
	* c-pch.c (pch_init): Likewise.
	* c-pragma.c (maybe_apply_pragma_weak): Likewise.
	* c-pretty-print.c (pp_c_tree_decl_identifier): Likewise.
	* c-typeck.c (c_incomplete_type_error, composite_type,
	common_pointer_type, common_type, same_translation_unit_p,
	tagged_types_tu_compatible_p, finish_init, pop_init_level,
	set_designator, set_nonincremental_init_from_string,
	process_init_element, c_finish_if_stmt): Likewise.
	* caller-save.c (init_caller_save, save_call_clobbered_regs,
	insert_restore, insert_save, insert_one_insn): Likewise.
	* calls.c (emit_call_1, compute_argument_block_size,
	precompute_arguments, expand_call, emit_library_call_value_1,
	store_one_arg): Likewise.

From-SVN: r87140
2004-09-07 10:19:00 +00:00
Mark Mitchell 4684cd27fc c-common.h (lang_post_pch_load): New variable.
* c-common.h (lang_post_pch_load): New variable.
	* c-pch.c (lang_post_pch_load): Define it.
	(c_common_read_pch): Use it.
	* cgraphunit.c (record_call_1): Give the front end a chance to
	record additional needed entities when a variable is marked as
	needed.
	* tlink.c (recompile_files): Robustify.
	(scan_linker_output): If a symbol is assigned to a file,
	but after recompilation is not present there, issue an error
	message.

	* cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
	(lang_decl_flags): Narrow the width of "languages".  Add
	repo_available_p.
	(DECL_NEEDED_P): Remove.
	(FOR_EACH_CLONE): New macro.
	(DECL_REPO_AVAILABLE_P): Likewise.
	(DECL_TINFO_P): Likewise.
	(set_linkage_according_to_type): Declare.
	(import_export_vtable): Remove.
	(import_export_tinfo): Likewise.
	(mark_needed): New function.
	(decl_needed_p): Likewise.
	(note_vauge_linkage_fn): Likewise.
	(init_repo): Change prototype.
	(repo_template_used): Remove.
	(repo_template_instantiated): Likewise.
	(repo_emit_p): New function.
	(repo_export_class_p): Likewise.
	(no_linkage_check): Change prototype.
	* class.c (set_linkage_according_to_type): New function.
	(build_vtable): Use it.  Do not call import_export_vtable.  Set
	DECL_IGNORED_P if appropriate.
	* decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
	(make_rtL_for_nonlocal_decls): Check for template instantiations
	explicitly.
	(grokfndecl): Adjust call to no_linkage_check.
	(set_linkage_for_static_data_member): New function.
	(grokvardecl): Use it.  Adjust call to no_linkage_check.
	(grokdeclarator): Use set_linkage_for_static_data_member.
	* decl2.c (note_vague_linkage_fn): New function.
	(note_vague_linkage_var): Likewise.
	(finish_static_data_member_decl): Use it.
	(import_export_vtable): Remove.
	(import_export_class): Use repo_export_class_p.
	(var_finalized_p): Simplify.
	(maybe_emit_vtables): Simplify.
	(mark_needed): New function.
	(decl_needed_p): Likewise.
	(import_export_decl): Add documentation and consistency checks.
	Use repo_emit_p.  Handle virtual tables and RTTI information
	here.
	(import_export_tinfo): Remove.
	(write_out_vars): Call import_export_decl.
	(cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
	whenever one is.
	(finish_file): Use decl_needed_p.  Do not call import_export_decl
	for undefined static data members.  Do not warn about undefined
	inlines when using a repository.
	(mark_used): Use note_vague_linkage_fn.  Always defer template
	instantiations.
	* lex.c (cxx_init): Adjust call to init_repo.  Always set
	flag_unit_at_a-time.
	* method.c (synthesize_method): Remove unncessary
	import_export_decl call.
	(implicitly_declare_fn): Use set_linkage_according_to_type.
	* optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
	* pt.c (instantiate_class_template): Don't redundantly add classes
	to keyed_classes.  Don't call repo_template_used.
	(tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
	templates with internal linkage.
	(check_instantiated_args): Adjust call to no_linkage_check.
	(instantiate_template): Use FOR_EACH_CLONE.
	(mark_definable): New function.
	(mark_decl_instantiated): Use it.
	(do_decl_instantiation): Adjust tests for explicit instantiation
	after "extern template".
	(instantiate_class_member): Do not use repo_template_instantiated.
	(do_type_instantiation): Simplify.
	(instantiate_decl): Use mark_definable.  Check repo_emit_p.
	Simplify.
	* repo.c (repo_get_id): Remove.
	(original_repo): Remove.
	(IDENTIFIER_REPO_USED): Remove.
	(IDENTIFIER_REPO_CHOSEN): Remove.
	Remove all #if 0'd code.
	(repo_template_used): Remove.
	(repo_template_instantiated): Remove.
	(temporary_obstack_initialized_p): New variable.
	(init_repo): Register with lang_post_pch_load.  Avoid creating
	identifiers unnecessarily.  Don't use original_repo.  Close the
	file here.
	(reopen_repo_file_for_write): Not here.
	(finish_repo): Always write out a new repository file.
	(repo_emit_p): New function.
	(repo_export_class_p): Likewise.
	* rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
	(involves_incomplete_p): New function.
	(tinfo_base_init): Use it.
	(ptr_initializer): Remove non_public_ptr parameter.
	(ptm_initializer): Likewise.
	(get_pseudo_ti_init): Likewise.
	(unemitted_tinfo_decl_p): Remove.
	(emit_tinfo_decl): Use import_export_decl.
	* semantics.c (expand_body): Move updates of static_ctors and
	static_dtors to ...
	(expand_or_defer_fn): ... here.
	* tree.c (no_linkage_check): Add relaxed_p parameter.

	* g++.dg/abi/inline1.C: New test.
	* g++.dg/abi/local1-a.cc: Likewise.
	* g++.dg/abi/local1.C: Likewise.
	* g++.dg/abi/mangle11.C: Tweak location of warnings.
	* g++.dg/abi/mangle12.C: Likewise.
	* g++.dg/abi/mangle17.C: Likewise.
	* g++.dg/abi/mangle20-2.C: Likewise.
	* g++.dg/opt/interface1.C: Likewise.
	* g++.dg/opt/interface1.h: Likewise.
	* g++.dg/opt/interface1-a.cc: New test.
	* g++.dg/parse/repo1.C: New test.
	* g++.dg/template/repo1.C: Likewise.
	* g++.dg/warn/Winline-1.C: Likewise.
	* lib/gcc-dg.exp (gcc-dg-test-1): Fix -frepo handling.

From-SVN: r85309
2004-07-29 17:59:31 +00:00
Geoffrey Keating c0d578e68f c-opts.c (c_common_handle_option): Handle -fpch-preprocess.
2004-06-21  Geoffrey Keating  <geoffk@apple.com>

	* c-opts.c (c_common_handle_option): Handle -fpch-preprocess.
	* c-common.h (flag_pch_preprocess): Declare.
	(c_common_pch_pragma): Likewise.
	* c-common.c (flag_pch_preprocess): New.
	* c-pch.c (c_common_read_pch): Support -fpreprocess-only.
	(c_common_pch_pragma): New.
	* c-ppoutput.c (cb_read_pch): New.
	(init_pp_output): Support -fpch-preprocess.
	* c-pragma.c (init_pragma): Support #pragma GNUC pch_preprocess.
	* c.opt (fpch-preprocess): New.
	* gcc.c (cpp_options): When save-temps, pass -fpch-preprocess.
	* doc/cppopts.texi: Document -fpch-preprocess.
	* doc/invoke.texi (Precompiled Headers): Mention that
	-fpreprocessed is safe for PCH.  Mention that if an option is
	listed as safe that doesn't mean it does what you expect.

Index: gcc/testsuite/ChangeLog
2004-06-21  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/pch/save-temps-1.c: New file.
	* gcc.dg/pch/save-temps-1.hs: New file.

Index: libcpp/ChangeLog
2004-06-21  Geoffrey Keating  <geoffk@apple.com>

	* files.c (should_stack_file): Correct swapped parameters to call
	to cb.read_pch.
	* pch.c (cpp_valid_state): Handle -fpreprocessed.

From-SVN: r83478
2004-06-22 06:51:56 +00:00
Danny Smith 90aa6719a0 toplev.c (init_asm_output): Add explicit 'b' to mode when opening asm_out_file.
* toplev.c (init_asm_output): Add explicit 'b' to mode when
        opening asm_out_file.
        * c-pch.c (c_common_write_pch): Remove unnecessary fflush before
        reading asm_out_file. Replace fflush after reading asm_out_file
        with fseek.
        * hosthooks-def.h (HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY): Define
        default and add to HOST_HOOKS_INITIALIZER.
        * hosthooks.h (gt_pch_alloc_granularity): Declare hook function.
        * ggc-common.c (default_gt_pch_alloc_granularity): New function.
        (gt_pch_save): Use host_hooks.gt_pch_alloc_granularity
        to set mmi.offset padding.
         * config.gcc (i[34567]86-*-mingw32*): Set target_gtfiles to
        $(srcdir)/config/i386/winnt.c.
        (i[34567]86-*-pe | i[34567]86-*-cygwin*): Likewise.
        (i[34567]86-*-uwin*): Likewise.
        *i[34567]86-*-interix3*): Likewise.
        * config.host (i[34567]86-*-mingw32*): Set out_host_hook_obj.
        * config/i386/host-mingw32.c: New file.
        * config/i386/x-mingw32: Add rule for host-mingw32.o.
        * config/i386/winnt.c: (struct extern_list) Tag as GTY.
        (extern_head): Likewise.
        (struct export_list) Likewise.
        (export_head): Likewise.
        (i386_pe_record_external_function): Use ggc_alloc.
        (i386_pe_record_exported_symbol): Likewise.
        Include "gt-winnt.h" at end.
        * doc/hostconfig.texi: Document
	HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY.

From-SVN: r82643
2004-06-05 07:28:27 +00:00
Geoffrey Keating 54e109edfb re PR pch/13419 (Clarification of invoke.texi requested)
2004-04-08  Geoffrey Keating  <geoffk@apple.com>

	PR pch/13419
	PR pch/14137
	Radar #: 3315288
	* doc/invoke.texi (Precompiled Headers): Suggest -o
	to put an output file in a particular place.  Be more detailed
	about which options affect PCH validity and which options
	might not work.
	* c-pch.c (pch_matching): New.
	(MATCH_SIZE): New.
	(struct c_pch_validity): New field 'match'.
	(pch_init): Handle pch_matching.
	(c_common_valid_pch): Check pch_matching.

Index: testsuite/ChangeLog
2004-04-08  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/pch/valid-1.c, gcc.dg/pch/valid-2.c, gcc.dg/pch/valid-3.c,
	gcc.dg/pch/valid-4.c, gcc.dg/pch/valid-5.c, gcc.dg/pch/valid-6.c,
	gcc.dg/pch/valid-1.hs, gcc.dg/pch/valid-2.hs, gcc.dg/pch/valid-3.hs,
	gcc.dg/pch/valid-4.hs, gcc.dg/pch/valid-5.hs, gcc.dg/pch/valid-6.hs:
	New tests.

From-SVN: r80531
2004-04-08 23:41:09 +00:00
Kazu Hirata ca2b05bae5 c-incpath.c, [...]: Update copyright.
gcc/
	* c-incpath.c, c-incpath.h, c-pch.c, c.opt, cppexp.c,
	et-forest.h, genattr.c, ggc-none.c, hosthooks-def.h,
	hosthooks.h, params.h, ra-colorize.c, web.c,
	config/darwin-c.c, config/alpha/freebsd.h, config/arm/pe.c,
	config/avr/avr-protos.h, config/avr/avr.md,
	config/fr30/fr30-protos.h, config/fr30/fr30.md,
	config/h8300/fixunssfsi.c, config/i386/darwin.h,
	config/i386/freebsd.h, config/i386/freebsd64.h,
	config/ia64/hpux.h, config/ia64/unwind-ia64.c,
	config/ip2k/libgcc.S, config/m32r/xm-m32r.h,
	config/mmix/mmix-modes.def, config/ns32k/netbsd.h,
	config/ns32k/ns32k.md, config/pa/pa64-hpux.h,
	config/pa/pa64-regs.h, config/rs6000/aix41.h,
	config/rs6000/aix43.h, config/rs6000/host-darwin.c,
	config/sparc/aout.h, config/sparc/freebsd.h,
	config/sparc/litecoff.h, config/vax/vax-protos.h,
	doc/hostconfig.texi, doc/include/gcc-common.texi: Update
	copyright.

gcc/cp/
	* cp-lang.c, ptree.c: Update copyright.

From-SVN: r79506
2004-03-15 18:20:51 +00:00
Richard Henderson 4d0c31e68c c-pch.c (c_common_no_more_pch): Update for gt_pch_use_address extra arguments.
* c-pch.c (c_common_no_more_pch): Update for gt_pch_use_address
        extra arguments.
        * config.host (*-*-solaris2*, *-*-linux*): Add out_host_hook_obj
        and host_xmake_file fragments.
        * ggc-common.c (gt_pch_save): Update for gt_pch_get_address change.
        (gt_pch_restore): Similarly for gt_pch_use_address.
        (default_gt_pch_get_address): New.
        (mmap_gt_pch_get_address): Split out of gt_pch_save.
        (default_gt_pch_use_address): Split out of gt_pch_restore.
        (mmap_gt_pch_use_address): Likewise.
        * hooks.c (hook_voidp_size_t_null): Remove.
        (hook_bool_voidp_size_t_false): Remove.
        * hooks.h: Likewise.
        * hosthooks-def.h (HOST_HOOKS_GT_PCH_GET_ADDRESS): Use one of the
        default_ or mmap_ definitions.
        (HOST_HOOKS_GT_PCH_USE_ADDRESS): Likewise.
        * hosthooks.h (struct host_hooks): Update gt_pch_get_address
        and gt_pch_use_address.
        * config/host-linux.c, config/host-solaris.c: New files.
        * config/x-linux, config/x-solaris: New files.
        * config/rs6000/host-darwin.c darwin_rs6000_gt_pch_get_address):
        Update for changed definition.
        (darwin_rs6000_gt_pch_use_address): Likewise.
        * doc/hostconfig.texi: Update docs.

From-SVN: r79295
2004-03-10 19:19:04 -08:00
Geoffrey Keating 7a681365b9 re PR pch/12480 (pch error messages do not say they for PCH.)
PR 12480
	* c-pch.c (pch_init): Improve error message when precompiled
	header can't be written.

	PR 12606
	* c-pch.c (pch_init): Make a PCH file appear invalid while it's
	being written.
	(c_common_write_pch): Make it valid once it's done.

From-SVN: r74754
2003-12-17 22:04:34 +00:00
John David Anglin 0527bc4ebf re PR preprocessor/12847 (xxx.c:1:20: xxxx.h: No such file or directory)
PR preprocessor/12847
	* cppfiles.c, cppexp.c, cpperror.c, cpplib.h, cpplib.c, cpplex.c,
	cppinit.c, cpptrad.c, cppmacro.c, fix-header.c, cpppch.c, c-pch.c,
	c-incpath.c, cppcharset.c (DL_WARNING, DL_WARNING_SYSHDR, DL_PEDWARN,
	DL_ERROR, DL_ICE, DL_EXTRACT, DL_WARNING_P): Prefix macro names with
	"CPP_".

From-SVN: r73183
2003-11-01 22:56:54 +00:00
Geoffrey Keating 7bb1ad9314 re PR pch/10757 (Adding -fpic/-fPIC causes crash with PCH created without -fpic/-fPIC)
PR 10757
	* c-pch.c: Include target.h.  Improve comments.
	(struct c_pch_validity): Add target_data_length.
	(pch_init): Add target's validity data.
	(c_common_valid_pch): Check target's validity data.
	* target-def.h (TARGET_GET_PCH_VALIDITY): New.
	(TARGET_PCH_VALID_P): New.
	(TARGET_INITIALIZER): Add new fields.
	* target.h: Include tm.h.
	(struct gcc_target): Add get_pch_validity, pch_valid_p.
	* toplev.h (default_get_pch_validity): New prototype.
	(default_pch_valid_p): New prototype.
	* toplev.c (default_get_pch_validity): New routine.
	(default_pch_valid_p): New routine.
	* Makefile.in (TARGET_H): Add TM_H.  Replace all users of
	target.h with $(TARGET_H).
	(c-pch.o): Add TARGET_H.
	* doc/tm.texi (PCH Target): New node.
	(TARGET_GET_PCH_VALIDITY): Document.
	(TARGET_PCH_VALID_P): Document.

From-SVN: r72909
2003-10-24 21:28:13 +00:00
Mark Mitchell 926a822f2b c-pch.c (struct c_pch_validity): Add pch_init field.
* c-pch.c (struct c_pch_validity): Add pch_init field.
	(pch_init): Set it.
	(c_common_valid_pch): Check it.
	(get_ident): Bump the PCH version number.

From-SVN: r72804
2003-10-22 15:44:44 +00:00
Geoffrey Keating 7451756f31 c-pch.c: Add comments in various places.
* c-pch.c: Add comments in various places.
	(struct c_pch_validity): Add the lengths of various strings.
	(host_machine): New static.
	(target_machine): New static.
	(get_ident): Bump version number.
	(pch_init): Write out version, host, target validity data.
	(c_common_valid_pch): Check version, host, target.
	* Makefile.in (c-pch.o): Add version.h; define HOST_MACHINE and
	TARGET_MACHINE.

From-SVN: r72774
2003-10-21 23:28:05 +00:00
Geoffrey Keating 18c8152070 c-common.c (allow_pch): Remove.
2003-07-29  Geoffrey Keating  <geoffk@apple.com>

	* c-common.c (allow_pch): Remove.
	* c-common.h (allow_pch): Remove.
	(c_common_no_more_pch): Declare.
	* c-lex.c (c_lex): Call c_common_no_more_pch when appropriate.
	* c-pch.c: Include hosthooks.h.
	(c_common_valid_pch): Don't check allow_pch.
	(c_common_read_pch): Clear valid_pch to prevent reading PCH files.
	(c_common_no_more_pch): New.
	* ggc-common.c: Include hosthooks.h.
	(gt_pch_save): Call gt_pch_get_address.
	(gt_pch_restore): Call gt_pch_use_address.
	* hooks.c (hook_voidp_size_t_null): New.
	(hook_bool_voidp_size_t_false): New.
	* hooks.h (hook_voidp_size_t_null): New.
	(hook_bool_voidp_size_t_false): New.
	* hosthooks-def.h (HOST_HOOKS_GT_PCH_GET_ADDRESS): New.
	(HOST_HOOKS_GT_PCH_USE_ADDRESS): New.
	(HOST_HOOKS_INITIALIZER): Add HOST_HOOKS_GT_PCH_GET_ADDRESS,
	HOST_HOOKS_GT_PCH_USE_ADDRESS.
	* hosthooks.h (struct host_hooks): Add gt_pch_get_address,
	gt_pch_use_address.
	* doc/hostconfig.texi (Host Common): Document
	HOST_HOOKS_GT_PCH_GET_ADDRESS, HOST_HOOKS_GT_PCH_USE_ADDRESS.
	* Makefile.in (c-pch.o): Depend on hosthooks.h.
	(ggc-common.o): Likewise.

	* config/rs6000/host-darwin.c (HOST_HOOKS_GT_PCH_GET_ADDRESS): Define.
	(HOST_HOOKS_GT_PCH_USE_ADDRESS): Define.
	(pch_address_space): New.
	(darwin_rs6000_gt_pch_get_address): New.
	(darwin_rs6000_gt_pch_use_address): New.

Index: cp/ChangeLog
2003-07-29  Geoffrey Keating  <geoffk@apple.com>

	* parser.c (cp_lexer_new_main): Use c_common_no_more_pch instead
	of setting valid_pch by hand.

From-SVN: r69944
2003-07-29 23:36:53 +00:00
Neil Booth 37fa72e9d3 c-common.c (enum c_language_kind, flag_objc): Remove.
* 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-30 19:36:25 +00:00
Rainer Orth 2d583dcbac c-pch.c (c_common_write_pch): Flush asm_out_file to allow for subsequent writes.
* c-pch.c (c_common_write_pch): Flush asm_out_file to allow for
	subsequent writes.

From-SVN: r68696
2003-06-30 11:57:35 +00:00
Andreas Jaeger 2f6e4e977d c-lex.c: Convert to ISO C90.
* c-lex.c: Convert to ISO C90.
	* c-objc-common.c: Likewise.
	* c-opts.c: Likewise.
	* c-pch.c: Likewise.
	* c-ppoutput.c: Likewise.
	* c-pragma.h: Likewise.
	* c-pretty-print.c: Likewise.
	* c-pretty-print.h: Likewise.
	* c-semantics.c: Likewise.
	* c-tree.h: Likewise.
	* c-typeck.c: Likewise.

From-SVN: r68327
2003-06-22 15:41:26 +02:00
Neil Booth d185d26881 c-pch.c (asm_file_name): Remove.
* c-pch.c (asm_file_name): Remove.
	* common.opt: Add more switches.
	* flags.h (g_switch_set): Boolify.
	* opts.c (g_switch_value, g_switch_set, exit_after_options,
	version_flag): Move from toplev.c.
	(common_handle_option): Handle more switches from toplev.c.
	* toplev.c (display_help, display_target_options, decode_d_option,
	print_version): Make non-static, remove prototypes.
	(aux_base_name, asm_file_name, aux_info_file_name): Constify.
	(version_flag, g_switch_value, g_switch_set, exit_after_options):
	Remove.
	(independent_decode_option): Move some handlers to opts.c.
	* toplev.h (aux_info_file_name, aux_base_name, asm_file_name,
	exit_after_options, version_flag, display_help, display_target_options,
	print_version, decode_d_option): New.
java:
	* lang.c (version_flag): Rename to v_flag to avoid clash w/ toplev.h.

From-SVN: r67971
2003-06-15 08:30:02 +00:00
Zack Weinberg fa6ef81367 diagnostic.c (output_format): Add support for %m.
* 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-13 18:06:52 +00:00
Geoffrey Keating df02618685 c-pch.c: Include flags.h.
* c-pch.c: Include flags.h.  Add comments to routines.
	(struct c_pch_validity): New.
	(get_ident): Update PCH file version number.
	(pch_init): Output current debugging type.
	(c_common_valid_pch): Check debugging type.
	* Makefile.in (c-pch.o): Update dependencies.
	* flags.h (debug_type_names): Declare.
	* toplev.c (debug_type_names): Move out of decode_g_option.

From-SVN: r65499
2003-04-12 01:58:33 +00:00
Geoffrey Keating 33b4980079 dbxout.c (scope_labelno): Add GTY.
2003-04-04  Geoffrey Keating  <geoffk@apple.com>

	* dbxout.c (scope_labelno): Add GTY.
	(have_used_extensions): Add GTY.
	(source_label_number): Add GTY.
	(lastfile): Add GTY.
	(lastfile_is_base): New.
	(base_input_file): New.
	(dbxout_handle_pch): New.
	(dbx_debug_hooks): Add handle_pch.
	(xcoff_debug_hooks): Likewise.
	(dbxout_function_end): Remove scope_labelno.
	(dbxout_init): Set base_input_file.
	(dbxout_handle_pch): New.
	(dbxout_source_file): Honour lastfile_is_base.
	* dwarfout.c (dwarf_debug_hooks): Add dummy handle_pch.
	* sdbout.c (sdb_debug_hooks): Add dummy handle_pch.
	* vmsdbgout.c (vmsdbg_debug_hooks): Add dummy handle_pch.
	* dwarf2out.c (dwarf2_debug_hooks): Add dummy handle_pch.
	* debug.c (do_nothing_debug_hooks): Add dummy handle_pch.
	* debug.h (struct gcc_debug_hooks): Add handle_pch.
	* c-pch.c (pch_init): Don't call start_source_file, but do call
	handle_pch.
	(c_common_write_pch): Call handle_pch.
	(c_common_read_pch): Don't call start_source_file,
	or end_source_file.

Index: gcc/testsuite/ChangeLog
2003-04-04  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/pch/static-3.c: New.
	* gcc.dg/pch/static-3.hs: New.
	* gcc.dg/pch/pch.exp: Test with -O0 -g too.

From-SVN: r65266
2003-04-05 07:01:51 +00:00
Nathanael Nerode 54a7b5732a c-pch.c, [...]: Replace "GNU CC" with "GCC".
* c-pch.c, dummy-conditions.c, genautomata.c, genconditions.c,
	langhooks.c, tree-inline.c, unwind-dw2-fde-darwin.c,
	unwind-dw2-fde-glibc.c, unwind-libunwind.c, vmsdbgout.c: Replace
	"GNU CC" with "GCC".

From-SVN: r64297
2003-03-13 03:48:31 +00:00
Geoffrey Keating 6e5c4eaf2d lang-specs.h (objective-c-header): Use .gch not .pch; support -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-07 23:10:42 +00:00
Geoffrey Keating 8643e92d0d c-pch.c: Include langhooks.h.
* 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-07 01:20:52 +00:00
Kaveh R. Ghazi 70f8b89fd9 c-pch.c (asm_file_startpos): Change to `long'.
* c-pch.c (asm_file_startpos): Change to `long'.
	(pch_init): Use ftell, not ftello.
	(c_common_write_pch): Use ftell/fseek, not ftello/fseeko.
	Use `long' instead of `off_t'.
	(c_common_read_pch): Likewise.
	* ggc-common.c (gt_pch_save): Use long/ftell instead of
	off_t/ftello.

From-SVN: r61233
2003-01-12 16:44:09 +00:00
Geoffrey Keating 17211ab553 Merge from pch-branch.
From-SVN: r61136
2003-01-10 02:22:34 +00:00