Commit Graph

388 Commits

Author SHA1 Message Date
Per Bothner 40de9f7604 cpplib.c (_cpp_pop_buffer): Do generate a _cpp_do_file_change callback even when popping the main file.
* cpplib.c (_cpp_pop_buffer):  Do generate a _cpp_do_file_change
	callback even when popping the main file.

	* cpplib.c (cpp_push_buffer):  Since we no longer set return_at_eof,
	remove the unused return_at_eof parameter.
	* cppfiles.c, cpplib.c, cppmacro.c, cpppch.c, fix-header.c:
	Update callers of cpp_push_buffer.

From-SVN: r72016
2003-10-02 00:30:34 -07:00
Alexandre Oliva e2e1fa50d9 cpplib.c (do_pragma): Reintroduce cb_line_change call in the code path that calls a handler.
* cpplib.c (do_pragma): Reintroduce cb_line_change call in the
code path that calls a handler.

From-SVN: r71744
2003-09-24 23:53:07 +00:00
Alexandre Oliva 5a8a65b1c9 * cpplib.c (do_pragma): Remove unnecessary cb_line_change.
From-SVN: r71416
2003-09-16 00:13:28 +00:00
Neil Booth 49634b3a45 cppfiles.c (struct _cpp_file): Rename once_only_next to next_file.
* cppfiles.c (struct _cpp_file): Rename once_only_next to
	next_file.  Remove import and pragma_once, add once_only.
	(find_file): Add new file structures to the all_files list.
	(should_stack_file): Mark #import-ed files once-only, and
	don't stack them if the file has already been stacked.
	(_cp_mark_file_once_only): Simplify.
	* cpphash.h (struct cpp_reader): Rename once_only_files
	to all_files.  Rename saw_pragma_once to seen_once_only.
	(_cpp_mark_file_once_only): Update prototype.
	* cpplib.c (do_pragma_once): Update.
testsuite:
	* import1.c, import2.c: New tests.

From-SVN: r70106
2003-08-02 16:29:46 +00:00
Neil Booth 8f9b40094d Makefile.in (LIBCPP_DEPS): Add HASHTAB_H.
* Makefile.in (LIBCPP_DEPS): Add HASHTAB_H.
	* cppfiles.c: Completely rewritten.
	* c-incpath.c (free_path, remove_duplicates, heads, tails, add_path):
	struct cpp_path is now struct cpp_dir.
	(remove_duplicates): Don't simplify path names.
	* c-opts.c (c_common_parse_file): cpp_read_next_file renamed
	cpp_stack_file.
	* cpphash.h: Include hashtab.h.
	(_cpp_file): Declare.
	(struct cpp_buffer): struct include_file is now struct _cpp_file,
	and struct cpp_path is now struct cpp_dir.  Rename members.
	(struct cpp_reader): Similarly.  New members once_only_files,
	file_hash, file_hash_entries, quote_ignores_source_dir,
	no_search_path, saw_pragma_once.  Remove all_include_files and
	max_include_len.  Make some members bool.
	(_cpp_mark_only_only): Renamed from _cpp_never_reread.
	(_cpp_stack_file): Renamed from _cpp_read_file.
	(_cpp_stack_include): Renamed from _cpp_execute_include.
	(_cpp_init_files): Renamed from _cpp_init_includes.
	(_cpp_cleanup_files): Renamed from _cpp_cleanup_includes.
	* cppinit.c (cpp_create_reader): Initialize no_search_path.  Update.
	(cpp_read_next_file): Rename and move to cppfiles.c.
	(cpp_read_main_file): Update.
	* cpplib.c (run_directive): Update for renamed members.
	(do_include_common, _cpp_pop_buffer): Update.
	(do_import): Undeprecate #import.
	(do_pragma_once): Undeprecate.  Use _cpp_mark_file_once_only.
	* cpplib.h: Remove file_name_map_list.
	(cpp_options): Remove map_list.
	(cpp_dir): Rename from cpp_path.  New datatype for name_map.
	(cpp_set_include_chains, cpp_stack_file, cpp_included): Update.
testsuite:
	* gcc.dg/cpp/include2.c: Only expect one message.

From-SVN: r69942
2003-07-29 22:26:13 +00:00
Kazu Hirata 938d968ed3 alias.c: Fix comment formatting.
* alias.c: Fix comment formatting.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* combine.c: Likewise.
	* cpplib.c: Likewise.
	* diagnostic.c: Likewise.
	* dojump.c: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* gcc.c: Likewise.
	* gcse.c: Likewise.
	* ggc-page.c: Likewise.
	* jump.c: Likewise.
	* loop.c: Likewise.
	* mips-tfile.c: Likewise.
	* recog.c: Likewise.
	* regclass.c: Likewise.
	* regmove.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.

From-SVN: r69689
2003-07-22 23:15:30 +00:00
Zack Weinberg a2f7be91fc hashtable.c (approx_sqrt): Make static.
* hashtable.c (approx_sqrt): Make static.
	* hashtable.h: Don't prototype approx_sqrt.
	* line-map.c (init_line_maps): Rename linemap_init.
	(free_line_maps): Rename linemap_free.
	(add_line_map): Rename linemap_add.
	(lookup_line): Rename linemap_lookup.
	(print_containing_files): Rename linemap_print_containing_files.
	* linemap.h: Update to match.

	* cpperror.c, cppinit.c, cpplib.c, cppmacro.c: Update calls to
	linemap routines to use new names.

From-SVN: r69672
2003-07-22 16:24:53 +00:00
Kaveh R. Ghazi 703ad42b4b alias.c [...]: Remove unnecessary casts.
* alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c
	c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in
	c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c
	collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c
	cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c
	cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c
	dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c
	fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c
	gcse.c genattr.c genattrtab.c genautomata.c genconditions.c
	genemit.c genextract.c genoutput.c genrecog.c gensupport.c
	ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c
	integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c
	loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c
	postreload.c prefix.c print-tree.c protoize.c ra-build.c
	ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c
	regmove.c regrename.c reload.c reload1.c reorg.c resource.c
	sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c
	simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c
	tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c
	varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary
	casts.

From-SVN: r69587
2003-07-19 14:47:15 +00:00
Zack Weinberg 438396422c Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H).
* Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H).
	(hashtable.o, line-map.o, mkdeps.o): Likewise, from dependency
	list.  Move these all together down by cpplib.

	* cpplib.h: Don't refer to MAX_WCHAR_TYPE_SIZE when determining
	definition of CPPCHAR_SIGNED_T.

	* cppcharset.c, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, cppinit.c
	* cpplex.c, cpplib.c, cppmacro.c, cpppch.c, cpptrad.c, hashtable.c
	* line-map.c, mkdeps.c: Don't include coretypes.h or tm.h.

	* cpphash.c (_cpp_init_hashtable): Don't use gcc_obstack_init.
	* cppinit.c (cpp_create_reader): Likewise.

	* cpphash.h (scan_out_logical_line): Rename _cpp_scan_out_logical_line.
	* cpptrad.c: Likewise.  All callers changed.
	* cpplib.c: All callers changed.
	* c-ppoutput.c: Replace 'uchar' with 'unsigned char' throughout.
	* hashtable.h: Define GTY(x) to nothing here too.

From-SVN: r69298
2003-07-13 17:34:18 +00:00
Kazu Hirata 4ed432168c c-format.c: Fix comment formatting.
* c-format.c: Fix comment formatting.
	* c-typeck.c: Likewise.
	* coverage.c: Likewise.
	* cppcharset.c: Likewise.
	* cpplib.c: Likewise.
	* dbxout.c: Likewise.
	* gcov-io.h: Likewise.
	* toplev.c: Likewise.

From-SVN: r69276
2003-07-12 22:49:48 +00:00
Geoffrey Keating d1bd0ded61 Index: ChangeLog
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-11 08:33:21 +00:00
Zack Weinberg 6b88314c65 cppcharset.c (one_utf8_to_cppchar, [...]): New functions.
* cppcharset.c (one_utf8_to_cppchar, one_cppchar_to_utf8,
	one_utf8_to_utf32, one_utf32_to_utf8, one_utf8_to_utf16,
	one_utf16_to_utf8, conversion_loop, convert_utf8_utf16,
	convert_utf8_utf32, convert_utf16_utf8,	convert_utf32_utf8,
	convert_no_conversion, convert_using_iconv): New functions.
	(APPLY_CONVERSION): New macro.
	(struct conversion, conversion_tab): New data structure.
	(init_iconv_desc): Check conversion_tab for a custom conversion
	primitive before trying to use iconv.
	(convert_cset): Deleted.
	(cpp_init_iconv): Use UTF- terminology, not UCS-.
	(_cpp_destroy_iconv): Update to match.
	(_cpp_valid_ucn): We don't need iconv to implement UCNs.
	(convert_ucn): Use one_cppchar_to_utf8 and APPLY_CONVERSION.
	(convert_escape, cpp_interpret_string): Use APPLY_CONVERSION.
	(_cpp_interpret_string_notranslate): New function, moved here
	from cpplib.c.

	* cpphash.h (convert_f, struct cset_converter): New types.
	(struct cpp_reader): narrow_cset_desc and wide_cset_desc
	are now struct cset_converter, not bare iconv_t.
	Update prototypes.
	* cpplib.c (interpret_string_notranslate): Moved to cppcharset.c;
	all callers changed.

From-SVN: r69204
2003-07-10 23:16:31 +00:00
Zack Weinberg e6cc3a24c2 cpplib.h (CPP_AT_NAME, [...]): New token types.
* 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-07-05 00:24:00 +00:00
Zack Weinberg 6cf87ca4e5 * cpplib.h, cpphash.h, cppcharset.c, cpperror.c, cppexp.c
* cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c
	* cppmacro.c, cpppch.c, cpptrad.c, cppspec.c: Convert to
	ISO C: new-style function declarations, no need for PARAMS,
	no special punctuation on indirect function calls, use string
	constant concatenation where convenient.

From-SVN: r68070
2003-06-17 06:17:44 +00:00
Kaveh R. Ghazi fad205ffba decl.c, [...]: Don't use the PTR macro.
cp:
	* cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR
	macro.

gcc:
	* bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c,
	config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c,
	dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c,
	function.c, gcc.c, genoutput.c, gensupport.c, global.c,
	haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c,
	loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c,
	read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c,
	stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use
	the PTR macro.

From-SVN: r68043
2003-06-16 21:41:10 +00:00
Kaveh R. Ghazi 9a23858679 builtin-attrs.def, [...]: Don't use macros from "symcat.h", instead rely on ISO C.
* builtin-attrs.def, builtin-attrs.def, builtins.c, cpplex.c,
	cpplib.c, gencheck.c, gengenrtl.c, machmode.def, protoize.c: Don't
	use macros from "symcat.h", instead rely on ISO C.

	* system.h: Don't include "symcat.h".
	* configure.in (AC_C_STRINGIZE): Delete.
	* config.in, configure: Regenerate.

From-SVN: r68035
2003-06-16 19:14:22 +00:00
Kazu Hirata 6356f89288 ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* ChangeLog.2: Likewise.
	* c-decl.c: Likewise.
	* cfgloop.h: Likewise.
	* cgraph.c: Likewise.
	* coverage.c: Likewise.
	* cppcharset.c: Likewise.
	* cpphash.h: Likewise.
	* cpplex.c: Likewise.
	* cpplib.c: Likewise.
	* dbxout.c: Likewise.
	* df.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* emit-rtl.c: Likewise.
	* explow.c: Likewise.
	* gcov-io.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gengtype.c: Likewise.
	* ggc.h: Likewise.
	* opts.c: Likewise.
	* real.c: Likewise.
	* reload.c: Likewise.
	* stmt.c: Likewise.

From-SVN: r67849
2003-06-12 19:01:08 +00:00
Neil Booth 59325650b1 cpplex.c (cpp_token_len): Tighten up.
* cpplex.c (cpp_token_len): Tighten up.
	(cpp_token_as_text): Need extra byte now.
	* cpplib.c (glue_header_name): Need extra 2 bytes.
	* cppmacro.c (cpp_macro_definition): Need extra byte.

From-SVN: r66049
2003-04-24 20:03:57 +00:00
Neil Booth 6338b35872 Makefile.in (c-lex.o, [...]): Update.
* Makefile.in (c-lex.o, LIBCPP_OBJS, cpplex.o): Update.
	* c-lex.c (MULTIBYTE_CHARS): Remove conditionals.
	(lex_string): Take cpp_string with full spelling.
	(cb_ident): Update.
	(c_lex): Update diagnostics.
	* cpplex.c (SPELL_NUMBER, SPELL_STRING): Combine into SPELL_LITERAL.
	(create_literal): New.
	(lex_string): Unterminated literals have type CPP_OTHER.
	(_cpp_lex_direct): Update calls to lex_string.  Use create_literal
	for CPP_OTHER.
	(cpp_token_len, cpp_spell_token, cpp_output_token): Simplify.
	(_cpp_equiv_tokens, cpp_interpret_charconst): Update.
	* cpplib.c (parse_include, do_line, do_linemarker,
	destringize_and_run): Update for token storing full spelling.
	* cpplib.h: Update token spelling types.
	* cppmacro.c (stringify_arg, check_trad_stringification):
	Update for token storing full spelling.
cp:
	* Make-lang.in (lex.o): Remove mbchar.h.
	* lex.c (MULTIBYTE_CHARS): Lose.
	* parser.c (cp_lexer_get_preprocessor_token): CPP_OTHER handled
	in c-lex.c.
testsuite:
	* gcc.dg/cpp/include2.c: Update.
	* gcc.dg/cpp/multiline-2.c: New.
	* gcc.dg/cpp/multiline.c: Update.
	* gcc.dg/cpp/strify2.c: Update.
	* gcc.dg/cpp/trad/literals-2.c: Update.

From-SVN: r66019
2003-04-23 22:44:06 +00:00
Neil Booth 74eb4b3e2e c-ppoutput.c (cb_include): Don't take a cpp_token.
* c-ppoutput.c (cb_include): Don't take a cpp_token.
	* cppfiles.c: Don't undef strcmp.
	(find_include_file): Don't take a cpp_token.  Check for empty
	file names.
	(_cpp_execute_include, _cpp_compare_file_date): Don't take a cpp_token.
	(cpp_push_include): Simplify.
	* cpphash.h (_cpp_execute_include, _cpp_compare_file_date): Update.
	* cpplib.c (glue_header_name): Return the file name, not a cpp_token.
	(parse_include): Similary.  Don't check for zero-length filenames.
	(do_include_common, do_pragma_dependency): Update accordingly.
	* cpplib.h (struct cpp_callbacks): Change prototype of include.

From-SVN: r65894
2003-04-21 19:21:59 +00:00
Neil Booth 26aea0737b cppfiles.c (ENABLE_VALGRIND_CHECKING, [...]): Remove.
* cppfiles.c (ENABLE_VALGRIND_CHECKING, VALGRIND_DISCARD,
	MMAP_THRESHOLD, TEST_THRESHOLD, SHOULD_MMAP): Remove.
	(struct include_file): Remove fefcnt, mapped members.
	(open_file, stack_include_file, _cpp_pop_file_buffer): Disable caching.
	(read_include_file): Don't use mmap, terminate buffers in '\r'.
	(purge_cache): Don't use munmap.
	* cpphash.h (CPP_BUF_COLUMN): Update.
	(lexer_state): Remove lexing_comment.
	(struct _cpp_line_note): New.
	(struct cpp_buffer): New members cur_note, notes_used, notes_cap,
	next_line and need_line.  Remove col_adjust and saved_flags.
	(_cpp_process_line_notes, _cpp_clean_line, _cpp_get_fresh_line,
	_cpp_skip_block_comment, scan_out_logical_line): New.
	(_cpp_init_mbchar): Remove.
	* cppinit.c (init_library): Remove call to _cpp_init_mbchar.
	(cpp_read_main_file): Set line to 1 earlier.
	(post_options): -traditional-cpp doesn't want trigraphs.
	* cpplex.c (MULTIBYTE_CHARS): Remove code predicated on this.
	(add_line_note, _cpp_clean_line, _cpp_process_line_notes,
	_cpp_get_fresh_line): New.
	(handle_newline, skip_escaped_newlines, trigraph_p,
	continue_after_nul, _cpp_init_mbchar): Remove.
	(get_effective_char): Update.
	(_cpp_skip_block_comment): Rename from skip_block_comment, simplify.
	(skip_line_comment): Simplify.
	(skip_whitespace, parse_identifier, parse_slow, parse_number,
	parse_string): Update.
	(cpp_lex_direct): Use clean lines and process line notes.  Update.
	(cpp_interpret_charconst): No MULTIBYTE_CHARS.
	* cpplib.c (prepare_directive_trad): Call scan_out_logical_line
	directly.
	(_cpp_handle_directive): Don't set saved_flags.
	(run_directive, destringize_and_run, cpp_define, cpp_define_builtin,
	cpp_undef, handle_assertion, cpp_push_buffer): Update.
	(_cpp_pop_buffer): Free notes.
	* cppmacro.c (builtin_macro, paste_tokens): \n terminate buffer.
	* cpppch.c (cpp_read_state): \n terminate buffer.
	* cpptrad.c (skip_escaped_newlines, handle_newline): Remove.
	(copy_comment): Use _cpp_skip_block_comment.
	(skip_whitespace, lex_identifier, _cpp_read_logical_line_trad):
	Simplify.
	(_cpp_overlay_buffer, _cpp_remove_overlay, push_replacement_text,
	save_replacement_text): Update.
	(scan_out_logical_line): Update to use clean lines and process
	line notes.
	* fix-header.c (read_scan_file): Update.
testsuite:
	* gcc.dg/cpp/_Pragma4.c: Remove stray space.
	* gcc.dg/cpp/trad/escaped-eof.c: Correct line number.

From-SVN: r65808
2003-04-19 00:22:51 +00:00
Neil Booth 23345bbbcc /home/neil/diffs/include.log
From-SVN: r64373
2003-03-14 21:47:50 +00:00
Zack Weinberg a8d0ddaf4c cpphash.h (struct lexer_state): Add directive_wants_padding.
* cpphash.h (struct lexer_state): Add directive_wants_padding.
	* cpplib.c (_cpp_handle_directive): Set directive_wants_padding
	for directives of type INCL.
	(glue_header_name, parse_include): Use get_token_no_padding.
	* cppmacro.c (replace_args): If directive_wants_padding,
	provide padding tokens.

	* testsuite/gcc.dg/cpp/include3.c: New test.
	* testsuite/gcc.dg/cpp/inc/foo.h: New file.

From-SVN: r63231
2003-02-21 18:06:30 +00:00
Zack Weinberg 3963c2e00e cpplib.c (do_include_common): Move warnings for #include_next and #import out to callers.
* cpplib.c (do_include_common): Move warnings for
	#include_next and #import out to callers.  Use early-return
	instead of nested ifs.  Don't do check_eol here.
	(parse_include): Do check_eol here with the rest of the
	parsing stuff.
	(do_include_next, do_import): Now handle warnings.

From-SVN: r62772
2003-02-12 17:01:53 +00:00
Jason Merrill 9fbd3e4166 cpplib.h (struct cpp_options): Add warn_deprecated field.
* cpplib.h (struct cpp_options): Add warn_deprecated field.
        * cppinit.c (cpp_create_reader): Turn it on by default.
        * c-opts.c (c_common_decode_option): Set it.
        * cpplib.c (do_pragma_once): Only complain about #pragma once
        if warn_deprecated is set.

From-SVN: r62005
2003-01-28 14:30:00 -05:00
Geoffrey Keating 17211ab553 Merge from pch-branch.
From-SVN: r61136
2003-01-10 02:22:34 +00:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Hans-Peter Nilsson 2402645b4d cpplib.c (_cpp_test_assertion): Default *value to 0.
* cpplib.c (_cpp_test_assertion): Default *value to 0.

	* cppexp.c (num_part_mul): Initialize result.unsignedp, to 1.

From-SVN: r59648
2002-11-29 22:41:04 +00:00
Neil Booth 8128cccfcf re PR preprocessor/8524 (_Pragma within macros is improperly expanded)
PR preprocessor/8524
	* cpplib.c (run_directive): Remove previous kludge to _Pragma.
	Add a new one in its place, which hopefully works.
	(skip_rest_of_line): Change test for bottom-of-context-stack.
testsuite:
	* gcc.dg/cpp/_Pragma5.c: New test.

From-SVN: r59232
2002-11-18 20:43:40 +00:00
Kazu Hirata da7d830409 ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* ChangeLog.0: Likewise.
	* ChangeLog.1: Likewise.
	* ChangeLog.2: Likewise.
	* ChangeLog.3: Likewise.
	* ChangeLog.4: Likewise.
	* ChangeLog.5: Likewise.
	* ChangeLog.6: Likewise.
	* FSFChangeLog.10: Likewise.
	* FSFChangeLog.11: Likewise.
	* alias.c: Likewise.
	* basic-block.h: Likewise.
	* c-aux-info.c: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-decl.c: Likewise.
	* c-format.c: Likewise.
	* c-semantics.c: Likewise.
	* c-typeck.c: Likewise.
	* calls.c: Likewise.
	* cfganal.c: Likewise.
	* cfgloop.c: Likewise.
	* collect2.c: Likewise.
	* combine.c: Likewise.
	* conflict.c: Likewise.
	* cppexp.c: Likewise.
	* cppfiles.c: Likewise.
	* cpphash.h: Likewise.
	* cppinit.c: Likewise.
	* cpplex.c: Likewise.
	* cpplib.c: Likewise.
	* cpplib.h: Likewise.
	* cppmacro.c: Likewise.
	* cse.c: Likewise.

From-SVN: r57398
2002-09-22 02:03:17 +00:00
Kazu Hirata 05713b80e0 ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* ChangeLog.0: Likewise.
	* ChangeLog.1: Likewise.
	* ChangeLog.2: Likewise.
	* ChangeLog.3: Likewise.
	* ChangeLog.4: Likewise.
	* ChangeLog.5: Likewise.
	* ChangeLog.6: Likewise.
	* FSFChangeLog.10: Likewise.
	* FSFChangeLog.11: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-format.c: Likewise.
	* c-opts.c: Likewise.
	* cpplib.c: Likewise.
	* langhooks.h: Likewise.
	* real.c: Likewise.
	* reg-stack.c: Likewise.
	* toplev.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/arm.md: Likewise.
	* config/arm/linux-gas.h: Likewise.
	* config/arm/netbsd.h: Likewise.
	* config/c4x/c4x.c: Likewise.
	* config/c4x/c4x.h: Likewise.
	* config/c4x/c4x.md: Likewise.
	* config/c4x/libgcc.S: Likewise.
	* config/fr30/fr30.md: Likewise.
	* config/frv/frv.md: Likewise.
	* config/ia64/ia64.md: Likewise.
	* config/mips/mips.h: Likewise.
	* config/mn10300/mn10300.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/v850/v850.md: Likewise.
	* doc/extend.texi: Likewise.
	* doc/invoke.texi: Likewise.
	* doc/md.texi: Likewise.

From-SVN: r57166
2002-09-15 18:24:08 +00:00
Neil Booth 79ba5e3b9e Debian BTS Bug #
Debian BTS Bug #
	* cpphash.h (FIRST, LAST, CUR, RLIMIT): Fix definitions.
	* cpplib.c (destringize_and_run): Kludge around getting
	tokens from in-progress macros.
	(_cpp_do__Pragma): Simplify.
testsuite:
	* gcc.dg/cpp/_Pragma4.c: New test.

From-SVN: r56773
2002-09-03 21:55:40 +00:00
Neil Booth 8bfb14674d re PR preprocessor/7526 (cpp0 core dump when _Pragma implies #pragma dependency)
PR preprocessor/7526
	* cpplib.c (run_directive): Kludge so _Pragma dependency works.
testsuite:
	* gcc.dg/cpp/_Pragma3.c: New test.

From-SVN: r56332
2002-08-14 20:17:55 +00:00
Neil Booth a69cbaac60 cppexp.c (parse_defined): Mark macro used.
* cppexp.c (parse_defined): Mark macro used.
	* cpphash.h (struct cpp_macro): New member "used".
	(_cpp_mark_macro_used, _cpp_warn_if_unused_macro): New.
	(struct cpp_reader): New member.
	* cppinit.c (cpp_finish_options): Set first_unused_line.
	(cpp_finish): Warn of unused macros if requested.
	(OPT_TABLE): New switches.
	(cpp_handle_option): Handle them.
	* cpplib.c (do_undef): Warn if macro unused.
	(do_ifdef, do_ifndef): Mark macro used.
	* cpplib.h (struct cpp_options): New member.
	* cppmacro.c (_cpp_warn_if_unused_macro): New.
	(enter_macro_context): Mark macro used.
	(_cpp_create_definition): Mark macro unused; warn if unused
	when redefined.
	* cpptrad.c (scan_out_logcial_line, push_replacement_text):
	Mark macros used.
	* doc/cppopts.texi: Update.
testsuite:
	* gcc.dg/cpp/trad/Wunused.c, gcc.dg/cpp/trad/Wunused.h,
	gcc.dg/cpp/Wunused.c, gcc.dg/cpp/Wunused.h: New tests.

From-SVN: r55692
2002-07-23 22:57:49 +00:00
Neil Booth 74d06cf221 cpplib.c (do_sccs): Handle #sccs on all systems.
* cpplib.c (do_sccs): Handle #sccs on all systems.
	* system.h (SCCS_DIRECTIVE): Poison.
	* config/darwin.h, config/freebsd.h, config/netbsd.h,
	config/ptx4.h, config/svr3.h, config/svr4.h, config/alpha/elf.h,
	config/arm/linux-elf.h, config/c4x/c4x.h, config/d30v/d30v.h,
	config/i370/i370.h, config/i386/gas.h, config/i386/sco5.h,
	config/i960/i960.h, config/m68hc11/m68hc11.h, config/m68k/3b1.h,
	config/m68k/3b1g.h, config/m68k/crds.h, config/m68k/mot3300.h,
	config/m68k/pbb.h, config/m88k/m88k.h, config/mips/mips.h,
	config/sparc/pbd.h, config/stormy16/stormy16.h, config/vax/vaxv.h:
	Remove all references to SCCS_DIRECTIVE.
	* doc/cpp.texi, doc/tm.texi: Update.

From-SVN: r55542
2002-07-17 21:31:42 +00:00
Neil Booth cd98faa138 cpperror.c (cpp_error): Default to directive_line within directives here.
* cpperror.c (cpp_error): Default to directive_line within
	directives here.
	* cppexp.c (cpp_interpret_integer): Only use traditional
	number semantics in directives.
	* cpplib.c (prepare_directive_trad): Don't reset pfile->line.
	(do_include_common): Similarly.
	* cpptrad.c (scan_out_logical_line): Implement accurate
	quoting of <> in #include.
	* doc/cpp.texi: Update.

From-SVN: r55347
2002-07-09 22:21:37 +00:00
Neil Booth 1d63a28afc cpplib.c (_cpp_handle_directive): Move #define-specific code to the #define handler...
* cpplib.c (_cpp_handle_directive): Move #define-specific
	code to the #define handler...
	(do_define): ...here.
	(lex_macro_node): No longer a need to check for comments here.

From-SVN: r55077
2002-06-28 20:27:14 +00:00
Neil Booth d1a586888e re PR preprocessor/7138 (gcc-3.2 failed to compile kernel)
PR preprocessor/7138
	* cpplib.c (_cpp_handle_directive): Do traditional
	preparation after setting state.angled_headers.
	* cpptrad.c (scan_out_logical_line): Fix potential
	quote bug.

From-SVN: r55055
2002-06-28 06:26:54 +00:00
Neil Booth 951a076609 cpphash.h (_cpp_set_trad_context): Remove.
* cpphash.h (_cpp_set_trad_context): Remove.
	* cpplib.c (prepare_directive_trad): Do nothing for #define.
	(cpp_push_buffer, _cpp_pop_buffer): Don't call _cpp_set_trad_context.
	* cpptrad.c: Update comments.
	(_cpp_read_logical_line_trad): Let scan_logical_line handle
	updating the current context.
	(scan_logical_line): Update the current context.
	(_cpp_create_trad_definition): Similarly.
	(_cpp_set_trad_context): Remove.

From-SVN: r55022
2002-06-27 06:01:58 +00:00
Neil Booth 0c6db54457 cpplib.c (do_include_common): Revert to correct line number if -traditional.
* cpplib.c (do_include_common): Revert to correct line number
	if -traditional.
	* cpptrad.c (scan_out_logical_line): Treat null directive as
	white space.  Invlidate MI optimization for non-whitespace
	text outside a directive.
testsuite:
	* gcc.dg/cpp/mi7.c, gcc.dg/cpp/mi7a.h, gcc.dg/cpp/mi7b.h,
	gcc.dg/cpp/trad/builtins.c, gcc.dg/cpp/trad/builtins.h,
	gcc.dg/cpp/trad/cmdlne-C.c, gcc.dg/cpp/trad/cmdlne-C2.c,
	gcc.dg/cpp/trad/maccom1.c, gcc.dg/cpp/trad/maccom2.c,
	gcc.dg/cpp/trad/maccom3.c, gcc.dg/cpp/trad/maccom4.c,
	gcc.dg/cpp/trad/maccom6.c, gcc.dg/cpp/trad/mi1.c,
	gcc.dg/cpp/trad/mi1c.h, gcc.dg/cpp/trad/mi1nd.h,
	gcc.dg/cpp/trad/mi1ndp.h, gcc.dg/cpp/trad/mi1x.h,
	gcc.dg/cpp/trad/mi2.c, gcc.dg/cpp/trad/mi2a.h,
	gcc.dg/cpp/trad/mi2b.h, gcc.dg/cpp/trad/mi2c.h
	gcc.dg/cpp/trad/mi3.c, gcc.dg/cpp/trad/mi3.def,
	gcc.dg/cpp/trad/mi3.h, gcc.dg/cpp/trad/mi4.c,
	gcc.dg/cpp/trad/mi5.c, gcc.dg/cpp/trad/mi6.c,
	gcc.dg/cpp/trad/mi6a.h, gcc.dg/cpp/trad/mi6b.h,
	gcc.dg/cpp/trad/mi6c.h, gcc.dg/cpp/trad/mi6d.h,
	gcc.dg/cpp/trad/mi6e.h, gcc.dg/cpp/trad/mi7.c,
	gcc.dg/cpp/trad/mi7a.h, gcc.dg/cpp/trad/mi7b.h: New tests.

From-SVN: r54978
2002-06-25 06:00:30 +00:00
Neil Booth 00b94a4440 cpperror.c (cpp_error): For traditional CPP, default to diagnostics on pfile->line.
* cpperror.c (cpp_error): For traditional CPP, default to
	diagnostics on pfile->line.
	* cpplib.c (prepare_directive_trad): Set line number for
	diagnostics for #define too.
	* cpptrad.c (skip_whitespace): Skip comments properly.
	(_cpp_expansions_different_trad): Initialize quote2.
testsuite:
	* gcc.dg/cpp/trad: New directory with traditional tests copied
	from parent directory.
	* gcc.dg/cpp/assert_trad1.c, gcc.dg/cpp/assert_trad2.c,
	gcc.dg/cpp/assert_trad3.c, gcc.dg/cpp/defined_trad.c,
	gcc.dg/cpp/hash2.c, gcc.dg/cpp/tr-define.c, gcc.dg/cpp/tr-direct.c,
	gcc.dg/cpp/tr-sign.c, gcc.dg/cpp/tr-str.c, gcc.dg/cpp/uchar-2.c:
	Move to trad/ and rename.
	* gcc.dg/cpp/trad/__STDC__.c, gcc.dg/cpp/trad/comment.c,
	gcc.dg/cpp/trad/escaped-eof.c, gcc.dg/cpp/trad/redef1.c,
	gcc.dg/cpp/trad/redef2.c: New tests.
	* gcc.dg/cpp/trad/trad.exp: New driver.

From-SVN: r54870
2002-06-21 05:29:09 +00:00
Neil Booth 017acb41cd cppexp.c (cpp_interpret_integer): Don't force traditional numbers to be unsigned.
* cppexp.c (cpp_interpret_integer): Don't force traditional
	numbers to be unsigned.
	* cpplib.c (prepare_directive_trad): Set line number for
	diagnostics.
	* cpptrad.c (scan_out_logical_line): Continue scanning out
	at start of buffer.
	* gcc.c (trad_capable_cpp): Use cc1 always.
f:
	* lang-specs.h: Use cc1 for traditional preprocessing.
testsuite:
	* gcc.dg/cpp/assert_trad1.c, gcc.dg/cpp/assert_trad2.c,
	gcc.dg/cpp/assert_trad3.c, gcc.dg/cpp/defined_trad.c,
	gcc.dg/cpp/hash2.c, gcc.dg/cpp/tr-define.c, gcc.dg/cpp/tr-direct.c,
	gcc.dg/cpp/tr-sign.c, gcc.dg/cpp/tr-str.c, gcc.dg/cpp/uchar-2.c:
	Remove.

From-SVN: r54856
2002-06-20 20:34:19 +00:00
Neil Booth d97371e024 cpplib.c (dtable): Update.
* cpplib.c (dtable): Update.
	(end_directive): Decrement expansion prevention count.
	Clear state.in_expression.
	(prepare_directive_trad): Set state.in_expression.
	Increment expansion prevention count.
	* cpptrad.c (enum ls): New.
	(_cpp_overlay_buffer): Set overlaid_buffer.
	(_cpp_remove_overlay): Use overlaid_buffer.
	(_cpp_read_logcial_line_trad): Update buffer when it might
	have changed.
	(scan_out_logical_line): Handle state transitions for assertions
	and defined() in #if, and for funlike invocations including the
	directive case.  Handle '<' and '>' as a quote mechanism in
	#include.  Warn about unterminated macro invocations.
	* cpphash.h (struct lexer_state): New member in_expression.
	(struct cpp_reader): New member overlaid buffer.

From-SVN: r54732
2002-06-18 06:27:40 +00:00
Neil Booth b66377c173 cpphash.h (_cpp_lex_identifier_trad): Remove.
* cpphash.h (_cpp_lex_identifier_trad): Remove.
	* cpplib.c (end_directive): Don't skip, always remove overlay
	apart from #define.
	(prepare_directive_trad): Handle NULL pfile->directive.
	(_cpp_handle_directive): Always call prepare_directive_trad
	if traditional.
	* cppmain.c (check_multiline_token): Rename account_for_newlines,
	generalize inputs.
	(scan_translation_unit_trad): Use it.
	* cpptrad.c (skip_comment): Rename copy_comment, copy comment to
	output, get escaped newline in comment close correct.
	(check_output_buffer, skip_whitespace): Update.
	(_cpp_lex_identifier_trad): Remove.
	(scan_out_logical_line): Handle -C and comments in directives
	properly.

From-SVN: r54599
2002-06-13 21:16:00 +00:00
Neil Booth 974c43f1e3 cpplib.c (end_directive): Handle line skipping.
* cpplib.c (end_directive): Handle line skipping.  Only remove
	the rest of the line if the directive was valid.
	* cppmacro.c (_cpp_push_text_context): Set NODE_DISABLED when
	expanding a traditional macro.
	* cpptrad.c (recursive_macro): New.
	(read_logical_line_trad): Handle skipping.
	(scan_out_logical_line): Continue after a successful directive.
	Don't expand macros whilst skipping, or if recursing.
	(_cpp_create_trad_definition): scan_out_logical_line now sets
	the output current position.

From-SVN: r54573
2002-06-13 06:25:28 +00:00
Neil Booth 1a76916c78 Makefile.in: Update cppmain.o.
* Makefile.in: Update cppmain.o.
	* cpphash.h (struct cpp_reader): Move some members to a
	nested structure.
	(trad_line): Rename saved_line.
	(_cpp_read_logical_line_trad): Update.
	(_cpp_remove_overlay): New.
	* cppinit.c (cpp_create_reader): No need to set saved_line.
	(cpp_destroy): Update.
	(cpp_read_main_file): Only overlay if compiling.
	* cpplex.c (continue_after_nul): Return false if in directive.
	* cpplib.c (EXPAND): New.
	(directive_table, SEEN_EOL): Update.
	(end_directive): Remove overlay if traditional; don't skip
	line in traditional #define.
	(prepare_directive_trad): New.
	(_cpp_handle_directive, run_directive): Update for traditional
	directives.
	(lex_macro_node): Simplify, don't use lex_identifier_trad.
	* cpplib.h (struct options): Add preprocess_only.
	* cppmain.c: Don't include intl.h.
	(cpp_preprocess_file): Set options->preprocess_only.
	(scan_translation_unit_trad): Fix, and print line numbers.
	* cpptrad.c (check_output_buffer, lex_identifier, scan_parameters,
	maybe_start_funlike, scan_out_logical_line, replace_args_and_push,
	save_replacement_text, _cpp_create_trad_definition): Update for
	variable renaming.
	(_cpp_overlay_buffer): Save line number.
	(_cpp_remove_overlay): Rename from restore_buff, restore line.
	(_cpp_read_logical_line_trad): Don't handle overlays here.
	(scan_out_logical_line): Process directives.

From-SVN: r54485
2002-06-11 05:36:17 +00:00
Neil Booth cbc69f844e cpphash.h (_cpp_create_definition): Update prototype.
* cpphash.h (_cpp_create_definition): Update prototype.
	(_cpp_push_text_context, _cpp_create_trad_definition): New.
	( cpp_lex_identifier_trad): New.
	(_cpp_set_trad_context): New.
	* cppinit.c (cpp_finish_options): Don't conditionalize builtins.
	* cpplib.c (SEEN_EOL): Update.
	(lex_macro_node): Update for -traditional.
	(cpp_push_buffer, _cpp_pop_buffer): Similarly.
	* cppmacro.c (_cpp_create_definition): Split into
	create_iso_definition() and _cpp_create_trad_definition().
	(warn_of_redefinition): Update prototype; handle traditional
	macros.
	(_cpp_push_text_context): New.
	* cpptrad.c (skip_whitespace, push_replacement_text): New.
	(lex_identifier): Call ht_lookup with correct start.
	(_cpp_lex_identifier_tradm _cpp_create_trad_definition,
	_cpp_set_trad_context): New.
	(scan_out_logical_line): Update to handle changing contexts.

From-SVN: r54293
2002-06-05 20:27:12 +00:00
Neil Booth 913189081f cppexp.c (possible_sum_sign, [...]): Remove.
* cppexp.c (possible_sum_sign, integer_overflow, left_shift,
	right_shift): Remove.
	(cpp_num, cpp_num_part, PART_PRECISION, HALF_MASK, LOW_PART,
	HIGH_PART): New.
	(struct op): Use cpp_num.
	(num_zerop, num_eq, num_positive, num_greater_freq, num_trim,
	num_part_mul, num_unary_op, num_binary_op, num_negate,
	num_bitwise_op, num_inequality_op, num_equality_op, num_mul,
	num_div_op, num_lshift, num_rshift, append_digit): New.
	(interpret_number, parse_defined, eval_token, reduce): Update
	for two-integer arithmetic.
	(binary_handler): New typedef.
	(optab): Update.
	(COMPARE, EQUALITY, BITWISE, MINMAX, UNARY, SHIFT): Delete.
	(_cpp_parse_expr, reduce): Update to handle two-integers.
	* cpplib.c (_cpp_test_assertion): Back up on CPP_EOF.
testsuite:
	* gcc.dg/cpp/arith-1.c: New semantic tests.
	* gcc.dg/cpp/if-1.c: Update.

From-SVN: r53900
2002-05-26 18:42:21 +00:00
Neil Booth bdee42b16c cpperror.c (_cpp_begin_message): No special casing of CPP_FATAL_LIMIT.
* cpperror.c (_cpp_begin_message): No special casing
	of CPP_FATAL_LIMIT.
	* cppinit.c (sanity_checks): s/DL_FATAL/DL_ICE/.
	(output_deps, cpp_handle_option, cpp_post_options): Use DL_ERROR.
	* cpplib.c (do_include_common): Use DL_ERROR.
	* cpplib.h (CPP_FATAL_LIMIT, CPP_FATAL_ERRORS, DL_FATAL): Remove.
	(DL_ICE): Renumber.
	* fix-header.c (read_scan_file): Update.

From-SVN: r53765
2002-05-23 06:07:45 +00:00
Kazu Hirata df38348381 cpperror.c: Fix formatting.
* cpperror.c: Fix formatting.
	* cppexp.c: Likewise.
	* cppfiles.c: Likewise.
	* cpphash.c: Likewise.
	* cpphash.h: Likewise.
	* cppinit.c: Likewise.
	* cpplex.c: Likewise.
	* cpplib.c: Likewise.
	* cppmacro.c: Likewise.
	* cppmain.c: Likewise.
	* cppspec.c: Likewise.

From-SVN: r53751
2002-05-22 22:02:16 +00:00