1. 22 Sep, 2002 1 commit
    • ChangeLog: Follow spelling conventions. · da7d8304
      	* 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
      Kazu Hirata committed
  2. 03 Sep, 2002 1 commit
    • Debian BTS Bug # · 79ba5e3b
      	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
      Neil Booth committed
  3. 12 Aug, 2002 2 commits
    • c-opts.c (deps_seen, [...]): New. · f4ff5a69
      	* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
      	handle_deferred_opts, sanitize_cpp_opts, defer_opt,
      	struct deferred_opt): New.
      	(COMMAND_LINE_OPTIONS): Add -M*.
      	(missing_arg): Update.
      	(c_common_decode_option): Handle -M*.
      	(c_common_post_options): Handle -M*.  Use sanitize_cpp_opts;
      	don't call cpp_post_options.
      	(c_common_finish, check_deps_environment_vars): Update.
      	* cppfiles.c (stack_include_file, handle_missing_header): Update.
      	* cpphash.h (CPP_PRINT_DEPS): Remove.
      	* cppinit.c: Don't include version.h.
      	(cpp_create_reader): Don't call deps_init.  Initialize
      	warn_long_long.
      	(cpp_read_main_file): Init deps if necessary.
      	(cpp_destroy): Conditionally free deps.
      	(cpp_finish): Update.
      	(no_tgt): Remove.
      	(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
      	(cpp_post_options): Rename post_options.
      	* cpplib.h (struct cpp_options): Remove some dependency options;
      	move others to a new structure.
      	(cpp_post_options): Remove.
      	(cpp_finish): Comment.
      	* fix-header.c (read_scan_file): Don't call cpp_post_options.
      treelang:
      	* treelang.c: Remove cpp_post_options.
      
      From-SVN: r56239
      Neil Booth committed
    • cpphash.h (struct printer): New from cppmain.c. · a3737481
      	* cpphash.h (struct printer): New from cppmain.c.
      	(cpp_reader): New member.
      	* cppmain.c (struct printer): Move to cpphash.h.
      	(options, print): Remove.
      	(account_for_newlines, print_line, maybe_print_line,
      	cpp_preprocess_file, setup_callbacks, scan_translation_unit,
      	scan_translation_unit_trad, cb_line_change, cb_ident,
      	cb_define, cb_undef, cb_include, cb_file_change, dump_macro,
      	cb_def_pragma): Make reentrant.
      
      From-SVN: r56233
      Neil Booth committed
  4. 23 Jul, 2002 1 commit
    • cppexp.c (parse_defined): Mark macro used. · a69cbaac
      	* 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
      Neil Booth committed
  5. 27 Jun, 2002 1 commit
    • cpphash.h (_cpp_set_trad_context): Remove. · 951a0766
      	* 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
      Neil Booth committed
  6. 19 Jun, 2002 1 commit
    • cpphash.h (struct cpp_reader): Make date and time strings. · 278c4662
      	* cpphash.h (struct cpp_reader): Make date and time strings.
      	(_cpp_builtin_macro_text, _cpp_copy_replacement_text,
      	_cpp_replacement_text_len): New.
      	* cppinit.c (cpp_create_reader): Update.
      	(init_builtins): Register appropriate builtins for -traditional-cpp.
      	* cppmacro.c (new_number_token): Remove.
      	(_cpp_builtin_macro_text): New.
      	(builtin_macro): Use it.
      	(cpp_macro_definition): Update to handle traditional macros.
      	* cppmain.c (cb_line_change): Don't do column positioning for
      	traditional output.
      	* cpptrad.c (enum ls): Rename ls_fun_macro to ls_fun_open.  New
      	state ls_fun_close.
      	(skip_whitespace): Fix.
      	(maybe_start_funlike): Don't set state.parsing_args.
      	(scan_out_logical_line): Remove duplicate error.  Use lex_state
      	rather than state.parsing_args.
      	(push_replacement_text): Handle builtins.
      	(_cpp_replacement_text_len, _cpp_copy_replacement_text): New.
      
      From-SVN: r54771
      Neil Booth committed
  7. 18 Jun, 2002 1 commit
    • cpplib.c (dtable): Update. · d97371e0
      	* 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
      Neil Booth committed
  8. 14 Jun, 2002 1 commit
    • cpphash.h (struct cpp_buffer): Remove saved_line_base. · bf9d5852
      	* cpphash.h (struct cpp_buffer): Remove saved_line_base.
      	* cpptrad.c: Update comments.
      	(skip_whitespace, copy_comment): Take a new parameter.
      	(skip_escaped_newlines): Don't duplicate escaped newline test.
      	(copy_comment): Different location for CUR, decide here how
      	to copy / replace the comment.
      	(skip_whitespace): Copy whitespace.
      	(_cpp_overlay_buffer, _cpp_remove_overlay): Don't play with line_base.
      	(scan_out_logical_line): Let copy comment handle keeping or
      	replacing comments.
      	(scan_parameters, _cpp_create_trad_definition): Update.
      
      From-SVN: r54605
      Neil Booth committed
  9. 13 Jun, 2002 1 commit
    • cpphash.h (_cpp_lex_identifier_trad): Remove. · b66377c1
      	* 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
      Neil Booth committed
  10. 11 Jun, 2002 1 commit
    • Makefile.in: Update cppmain.o. · 1a76916c
      	* 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
      Neil Booth committed
  11. 10 Jun, 2002 2 commits
    • cpphash.h (_cpp_read_logical_line_trad, [...]): Update prototypes. · afb03408
      	* cpphash.h (_cpp_read_logical_line_trad,
      	_cpp_expansions_different_trad): Update prototypes.
      	* cpplex.c (continue_after_nul): New.
      	* cppmain.c: Include cpphash.h.
      	(scan_translation_unit_trad): New.
      	(cpp_preprocess_file): Call it.
      	* cpptrad.c (_cpp_read_logical_line_trad): Take new parameter
      	overlay.
      	(_cpp_expansions_different_trad): Update prototype.
      
      From-SVN: r54446
      Neil Booth committed
    • cpphash.h (struct cpp_macro): Put comments on their own lines. · 6618c5d4
      	* cpphash.h (struct cpp_macro): Put comments on their own lines.
      	(_cpp_expansions_different_trad): New.
      	* cppmacro.c (warn_of_redefinition): Fix for traditional case.
      	* cpptrad.c (canonicalize_text): New.
      	(scan_out_logical_line): Handle no arguments correctly.
      	(save_replacement_text): Commit memory when finished.
      	(_cpp_expansions_different_trad): New.
      
      From-SVN: r54432
      Neil Booth committed
  12. 09 Jun, 2002 2 commits
    • cpphash.h (_cpp_push_text_context): Update. · 1ce676a0
      	* cpphash.h (_cpp_push_text_context): Update.
      	(_cpp_arguments_ok): New.
      	* cppmacro.c (_cpp_arguments_ok): New, split out from...
      	(collect_args): ...here.
      	(_cpp_push_text_context): Change inputs.
      	* cpptrad.c (struct fun_macro, maybe_start_funlike, save_argument,
      	replace_args_and_push): New.
      	(lex_identifier, _cpp_lex_identifier_trad, scan_parameters):
      	Don't use IS macros directly.
      	(scan_out_logical_line): Handle function-like macro argument
      	collection.
      	(push_replacement_text): Update.
      	(replacement_length): Remove.
      	(_cpp_create_trad_definition): Don't skip whitespace before
      	checking for '('.
      
      From-SVN: r54412
      Neil Booth committed
    • Makefile.in (LIBCPP_OBJS): Take out version.o. · 5a9ee623
      	* Makefile.in (LIBCPP_OBJS): Take out version.o.
      	* cpphash.h (cpp_reader): Take out print_version member.
      	* cppinit.c: (cpp_handle_option): Don't do anything with
      	-version.  Just set help_only for --version, --target-help.
      	Just set verbose option for -v.
      	(cpp_post_options): Don't print a version string.
      
      From-SVN: r54390
      Zack Weinberg committed
  13. 07 Jun, 2002 1 commit
    • cpptrad.c (struct block, [...]): New. · c70f6ed3
      	* cpptrad.c (struct block, BLOCK_HEADER_LEN, BLOCK_LEN,
      	scan_parameters, save_replacement_text, replacement_length): New.
      	(scan_out_logical_line): Take a macro and save parameters if
      	non-NULL.
      	(_cpp_logical_line_trad): Update.
      	(_cpp_create_trad_definition): Update to handle function-like
      	macros.
      	* cpplex.c (new_buff): Update.
      	(struct dummy, DEFAULT_ALIGNMENT, CPP_ALIGN): Move...
      	* cpphash.h: ...here.
      	(CPP_ALIGN2, _cpp_save_parameter): New.
      	* cppmacro.c (save_parameter): Rename, export.
      	(parse_params): Update.
      
      From-SVN: r54331
      Neil Booth committed
  14. 05 Jun, 2002 1 commit
    • cpphash.h (_cpp_create_definition): Update prototype. · cbc69f84
      	* 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
      Neil Booth committed
  15. 04 Jun, 2002 1 commit
    • cpphash.h (FIRST, [...]): New. · 82eda77e
      	* cpphash.h (FIRST, LAST, CUR, RLIMIT): New.
      	(struct cpp_context): Add traditional fields.
      	* cppmacro.c (paste_all_tokens, push_ptoken_context,
      	push_token_context, cpp_get_token, _cpp_backup_tokens): Update.
      	* cpptrad.c (skip_comment, lex_identifier,
      	_cpp_read_logical_line_trad, scan_out_logical_line): Update.
      
      From-SVN: r54242
      Neil Booth committed
  16. 29 May, 2002 1 commit
    • cppexp.c (cpp_num): Move to cpplib.h. · cd7ab83f
      2002-05-29  Neil Booth  <neil@daikokuya.demon.co.uk>
      	    Zack Weinberg <zack@codesourcery.com>
      
      	* cppexp.c (cpp_num): Move to cpplib.h.
      	(CPP_ERROR): Remove.
      	(interpret_float_suffix, interpret_int_suffix): New.
      	(struct suffix, vsuf_1, vsuf_2, vsuf_3): Remove.
      	(cpp_classify_number, cpp_interpret_integer): New.
      	(interpret_number): Remove.
      	(eval_token): Update to use new routines.
      	* cpphash.h (cpp_num_part): Move to cpplib.h.
      	* cppinit.c (cpp_post_options): Set warn_long_long.
      	* cpplib.h (struct cpp_options): Add warn_long_long.
      	(cpp_num, cpp_num_part, CPP_N_CATEGORY, CPP_N_INVALID,
      	CPP_N_INTEGER, CPP_N_FLOATING, CPP_N_WIDTH, CPP_N_SMALL,
      	CPP_N_MEDIUM, CPP_N_LARGE, CPP_N_RADIX, CPP_N_DEC, CPP_N_HEX,
      	CPP_N_OCTAL, CPP_N_UNSIGNED, CPP_N_IMAGINARY, cpp_classify_number,
      	cpp_interpret_integer): New.
      testsuite:
      	* gcc.dg/cpp/c++98-pedantic.c, gcc.dg/cpp/c89-pedantic.c,
      	gcc.dg/cpp/c94-pedantic.c, gcc.dg/cpp/gnuc89-pedantic.c,
      	gcc.dg/cpp/if-1.c: Update for modified diagnostics.
      
      Co-Authored-By: Zack Weinberg <zack@codesourcery.com>
      
      From-SVN: r54007
      Neil Booth committed
  17. 27 May, 2002 1 commit
    • c-common.c (c_common_init): Set CPP arithmetic precision. · c9220e3a
      	* c-common.c (c_common_init): Set CPP arithmetic precision.
      	* cppexp.c (cpp_num_part): Move typedef ...
      	* cpphash.h: ...here; make unsigned HOST_WIDE_INT.
      	* cppinit.c (cpp_create_reader): Default to host long arithmetic.
      	(sanity_checks): Update.
      testsuite:
      	* gcc.dg/cpp/arith-2.c, gcc.dg/cpp/arith-3.c: New tests.
      	* gcc.dg/cpp/if-3.c: Remove.
      
      From-SVN: r53911
      Neil Booth committed
  18. 22 May, 2002 1 commit
    • cpperror.c: Fix formatting. · df383483
      	* 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
      Kazu Hirata committed
  19. 21 May, 2002 1 commit
    • c-common.c (c_common_init): Set options->unsigned_char from flag_signed_char. · 2a1dc0d8
      	* c-common.c (c_common_init): Set options->unsigned_char from
      	flag_signed_char.
      	(cb_register_builtins): Define __STRICT_ANSI__ and
      	__CHAR_UNSIGNED__ here...
      	* cppinit.c (init_builtins): Not here.
      	(cpp_create_reader): unsigned_char option defaults to 0, not
      	!DEFAULT_SIGNED_CHAR.
      	(COMMAND_LINE_OPTIONS, cpp_handle_option): Lose -fsigned-char
      	and -funsigned-char.
      
      	* cpphash.h (struct spec_nodes): Kill n__STRICT_ANSI__.
      	* cpphash.c (_cpp_init_hashtable): Don't set it.
      	* cppmacro.c (builtin_macro) [BT_STDC]: Use the language setting
      	directly.  Clarify comment.
      
      From-SVN: r53703
      Zack Weinberg committed
  20. 17 May, 2002 1 commit
    • Makefile.in: Update for cpptrad.c. · 004cb263
      	* Makefile.in: Update for cpptrad.c.
      	* cpphash.h (struct cpp_buffer): New members for buffer
      	overlays.
      	(struct cpp_reader): New members for traditional output.
      	(_cpp_read_logical_line, _cpp_overlay_buffer): New.
      	* cppinit.c (cpp_create_reader): Set trad_line.
      	(cpp_destroy): Free trad_out_base if used.
      	(cpp_read_main_file): Overlay an empty buffer if traditional.
      	(cpp_finish_options): Don't do builtins.
      	(COMMAND_LINE_OPTIONS): Add -traditional-cpp.
      	(cpp_handle_option): Handle it.
      	* cpplex.c (continue_after_nul): New.
      	(_cpp_lex_direct): Use handle_nul.
      	* cpplib.h (struct cpp_options): New traditional option.
      	* cpptrad.c: New file.
      
      From-SVN: r53568
      Neil Booth committed
  21. 16 May, 2002 1 commit
  22. 04 May, 2002 1 commit
    • c-lex.c (lex_string): Let cpp_parse_escape handles truncation and sign-extension. · 4268e8bb
      	* c-lex.c (lex_string): Let cpp_parse_escape handles truncation
      	and sign-extension.
      	(lex_charconst): Update for change in prototype of
      	cpp_interpret_charconst.  Extend from cppchar_t to HOST_WIDE_INT
      	appropriately.
      	* cpphash.h (BITS_PER_CPPCHAR_T): New.
      	* cppinit.c (cpp_create_reader): Initialize them for no
      	change in semantics.
      	(cpp_post_options): Add sanity checks.
      	* cpplex.c (cpp_parse_escape): Handle precision, sign-extension
      	and truncation issues.  Calculate in type cppchar_t.
      	(MAX_CHAR_TYPE_SIZE, MAX_WCHAR_TYPE_SIZE): Remove.
      	(cpp_interpret_charconst): Calculate in type cppchar_t.  Handle
      	run-time dependent precision correctly.  Return whether the
      	result is signed or not.
      	* cpplib.c (dequote_string): Use cppchar_t; update.
      	* cpplib.h (cppchar_signed_t): New.
      	struct cpp_options): New precision members.
      	(cpp_interpret_charconst, cpp_parse_escape): Update prototypes.
      
      From-SVN: r53152
      Neil Booth committed
  23. 28 Apr, 2002 2 commits
    • cppexp.c (lex): Move some code to _cpp_parse_expr, but keep most cases as function eval_token. · 60284a59
      	* cppexp.c (lex): Move some code to _cpp_parse_expr, but
      	keep most cases as function eval_token.
      	(eval_token): New function.
      	(_cpp_parse_expr): Read token here for improved diagnostics.
      	Don't use op_as_text.  Detect bad ':' here.
      	(reduce): Don't detect bad ':' here.
      	(op_as_text): Remove.
      	* cpphash.h (_cpp_test_assertion): Change prototype.
      	* cpplib.c (_cpp_test_assertion): Change prototype.
      testsuite:
      	* gcc.dg/cpp/if-cexp.c: Add a test.
      
      From-SVN: r52866
      Neil Booth committed
    • cppexp.c (lex): Update to use state.skip_eval. · 87ed109f
      	* cppexp.c (lex): Update to use state.skip_eval.
      	(struct op): Remove prio and flags members.
      	(FLAG_BITS, FLAG_MASK, PRIO_SHIFT, EXTRACT_PRIO, EXTRACT_FLAGS,
      	SHORT_CIRCUIT, RIGHT_ASSOC, ..._PRIO, op_to_prio): Remove.
      	(LEFT_ASSOC): New macro.
      	(optab): New table of operator priorities and flags.
      	(SHIFT): Update.
      	(_cpp_parse_expr): Clean up logic.  Return bool.  Use a
      	malloc-ed parser stack.
      	(reduce): New; reduce the operator stack.
      	(_cpp_expand_op_stack): Expand the operator stack as necessary.
      	* cpphash.h (struct op): Predeclare.
      	(struct cpp_reader): New members op_stack, op_limit.
      	(struct lexer_state): New member skip_eval.
      	(_cpp_parse_expr): Update.
      	(_cpp_expand_op_stack): New.
      	* cpplib.c (do_if): Update.
      	* cppinit.c (cpp_create_reader): Create op stack.
      	(cpp_destroy): And destroy it.
      	* cpplib.h (CPP_LAST_CPP_OP): Correct.
      	(TTYPE_TABLE): Correct.
      testsuite:
      	* gcc.dg/cpp/if-mop.c: Update.
      	* gcc.dg/cpp/if-mpar.c: Add test.
      	* gcc.dg/cpp/if-oppr.c: Update.
      
      From-SVN: r52853
      Neil Booth committed
  24. 22 Apr, 2002 1 commit
    • cppfiles.c (_cpp_pop_file_buffer): Return void. · af0d16cd
      	* cppfiles.c (_cpp_pop_file_buffer): Return void.  Move
      	file change and include code to _cpp_pop_buffer.
      	* cpphash.h (struct pending_option): Predeclare.
      	(struct cpp_reader): New member next_include_file.
      	(_cpp_pop_file_buffer): Update.
      	(_cpp_push_next_buffer): Update, rename.
      	* cppinit.c (cpp_destroy): Free include chain and pending here.
      	(cpp_finish_options): Simplify.
      	(_cpp_push_next_buffer): Rename and clean up.
      	* cpplib.c (cpp_pop_buffer): Move code from _cpp_pop_file_buffer.
      	Clarify.
      	* cppmacro.c (cpp_scan_nooutput): Set return_at_eof here.
      
      From-SVN: r52621
      Neil Booth committed
  25. 21 Apr, 2002 1 commit
    • cppexp.c (struct op, [...]): Replace U_CHAR with uchar. · 562a5c27
      	* cppexp.c (struct op, parse_number): Replace U_CHAR with uchar.
      	* cppfiles.c (read_include_file): Similarly.
      	* cpphash.h (DSC, U_CHAR, ustrcmp, ustrncmp, ustrlen,
      	uxstrdup ustrchr, ufputs): Similarly.
      	* cppinit.c (TRIGRAPH_MAP, cpp_destroy): Similarly.
      	* cpplex.c (parse_slow, unescaped_terminator_p, save_comment,
      	cpp_ideq, parse_identifier, parse_number): Similarly.
      	* cpplib.c (struct directive, dequote_string, D, run_directive,
      	cpp_push_buffer): Similarly.
      	* cppmacro.c (new_string_token, builtin_macro, cpp_quote_string,
      	_cpp_create_definition, check_trad_stringification,
      	cpp_macro_definition): Similarly.
      
      From-SVN: r52587
      Neil Booth committed
  26. 14 Apr, 2002 1 commit
    • cpperror.c (print_location): Don't print include chain if line == 0. · ebef4e8c
      	* cpperror.c (print_location): Don't print include chain
      	if line == 0.
      	(cpp_begin_message): Update to use DL_ macros.
      	(cpp_ice, cpp_fatal, cpp_error_from_errno, cpp_warning,
      	cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line,
      	cpp_notice, cpp_notice_from_errno): Remove.
      	(cpp_error, cpp_error_with_line): Update to take a diagnostic
      	level.
      	(cpp_errno): New.
      	* cppexp.c (CPP_ICE): Remove.
      	(SYNTAX_ERROR, SYNTAX_ERROR2, parse_number, parse_defined,
      	lex, integer_overflow, _cpp_parse_expr): Update.
      	* cppfiles.c (read_include_file, find_include_file,
      	handle_missing_header, _cpp_read_file, remap_filename): Update.
      	* cpphash.h (enum error_type): Remove.
      	(_cpp_begin_message): Update.
      	* cppinit.c (append_include_chain, remove_dup_dirs, output_deps,
      	cpp_handle_option, cpp_post_options): Update.
      	* cpplex.c (trigraph_p, skip_escaped_newlines, skip_block_comment,
      	skip_whitespace, parse_identifier, parse_slow, parse_string,
      	_cpp_lex_direct, cpp_spell_token, maybe_read_ucs, cpp_parse_escape,
      	cpp_interpret_charconst): Update.
      	* cpplib.c (check_eol, directive_diagnostics, _cpp_handle_directive,
      	lex_macro_node, do_undef, glue_header_name, parse_include,
      	do_include_common, read_flag, do_line, do_linemarker, do_ident,
      	cpp_register_pragma, do_pragma_once, do_pragma_system_header,
      	do_pragma_poison, do_pragma_dependency, _cpp_do__Pragma, do_else,
      	do_elif, do_endif, parse_answer, parse_assertion, do_assert,
      	_cpp_pop_buffer, do_diagnostic): Update.
      	* cpplib.h (DL_WARNING, DL_WARNING_SYSHDR, DL_PEDWARN, DL_ERROR,
      	DL_FATAL, DL_ICE, DL_EXTRACT, DL_WARNING_P): New.
      	(cpp_ice, cpp_fatal, cpp_error_from_errno, cpp_warning,
      	cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line,
      	cpp_notice, cpp_notice_from_errno): Remove.
      	(cpp_error, cpp_error_with_line): Update to take a diagnostic
      	level.
      	(cpp_errno): New.
      	* cppmacro.c (builtin_macro, stringify_arg, paste_all_tokens,
      	collect_args, enter_macro_context, save_parameter, parse_params,
      	_cpp_create_definition, check_trad_stringification,
      	cpp_macro_definition): Update.
      	* cppmain.c (cpp_preprocess_file): Update.
      	* fix-header.c (read_scan_file): Update.
      
      From-SVN: r52302
      Neil Booth committed
  27. 22 Mar, 2002 1 commit
    • cpphash.h (struct cpp_reader): Remove mls_line and mls_col. · d4e6133f
              * cpphash.h (struct cpp_reader): Remove mls_line and mls_col.
              * cpplex.c (unterminated): Delete.
              (parse_string): No string literal may extend over multiple
              lines.  Suppress the error when preprocessing assembly.
      	* cppmain.c (scan_translation_unit): Strings are single-line.
      
              * doc/cpp.texi: Update to match.
              * testsuite/gcc.dg/cpp/multiline.c: Update to match.
      
      From-SVN: r51195
      Neil Booth committed
  28. 14 Mar, 2002 1 commit
    • cpphash.h (struct lexer_state): Remove line_extension member. · dcc229e5
      	* cpphash.h (struct lexer_state): Remove line_extension member.
      	* cpplib.c (dequote_string, do_linemarker): New functions.
      	(linemarker_dir): New data object.
      	(DIRECTIVE_TABLE): No longer need to interpret #line in
      	preprocessed source.  Delete obsolete comment about return
      	values of handlers.
      	(end_directive, directive_diagnostics, _cpp_handle_directive):
      	Don't muck with line_extension.
      	(directive_diagnostics): No need to issue warnings for
      	linemarkers here.
      	(_cpp_handle_directive): Issue warnings for linemarkers here,
      	when appropriate.  Dispatch linemarkers to do_linemarker, not
      	do_line.
      	(do_line): Code to handle linemarkers split out to do_linemarker.
      	Convert escape sequences in filename argument, both places.
      
      	* cppmacro.c (quote_string): Rename cpp_quote_string and
      	export.  All callers changed.
      	* cpplib.h (cpp_quote_string): Prototype.
      	* cppmain.c (print_line): Call cpp_quote_string on to_file
      	before printing it.
      
      	* doc/cpp.texi: Document that escapes are now interpreted in
      	#line and in linemarkers, and that non-printing characters are
      	converted to octal escapes when linemarkers are generated.
      
      From-SVN: r50779
      Zack Weinberg committed
  29. 02 Feb, 2002 1 commit
    • cpphash.h (struct spec_nodes): Remove n__CHAR_UNSIGNED__. · 0fef3fd0
      	* cpphash.h (struct spec_nodes): Remove n__CHAR_UNSIGNED__.
      	* cpphash.c (_cpp_init_hashtable): Similarly.
      	* cppinit.c (cpp_create_reader): Default the signed_char flag.
      	(init_builtins): Define __CHAR_UNSIGNED__ appropriately.
      	(COMMAND_LINE_OPTIONS): Recognise -f{un,}signed-char.
      	(cpp_handle_option): Handle the new options.
      	* cpplex.c (cpp_interpret_charconst): Use new flag.
      	* cpplib.h (struct cpp_options): New member signed_char.
      	* gcc.c (cpp_unique_options): Remove %c spec and documentation.
      	(cpp_options): Handle -fsigned-char and -funsigned-char.
      	(static_specs): Remove signed_char_spec.
      	(do_spec1): Don't handle %c.
      	* system.h: Poison SIGNED_CHAR_SPEC.
      	* tradcif.y (yylex): Use flag_signed_char.
      	* tradcpp.h (flag_signed_char): New.
      	* tradcpp.c (flag_signed_char): New.
      	(main): Handle new command-line options.
      	(initialize_builtins): Define __CHAR_UNSIGNED__ if appropriate.
      config:
      	* alpha/alpha.h (SIGNED_CHAR_SPEC): Remove.
      	* avr/avr.h: Remove old comments.
      	* i960/i960.h (CPP_SPEC): Pass -fsigned-char if -mic*.
      	(CC1_SPEC): Pass -fsigned-char if -mic*.
      	(SIGNED_CHAR_SPEC): Remove.
      doc:
      	* tm.texi (SIGNED_CHAR_SPEC): Remove documentation.
      testsuite:
      	* gcc.dg/cpp/uchar-1.c, uchar-2.c, uchar-3.c: New tests.
      
      From-SVN: r49444
      Neil Booth committed
  30. 03 Jan, 2002 2 commits
  31. 27 Nov, 2001 1 commit
    • cpphash.c (_cpp_init_hashtable): Update. · 0abc6a6a
      	* cpphash.c (_cpp_init_hashtable): Update.
      	* cpphash.h (struct spec_nodes): Remove n_L.
      	* cpplex.c (_cpp_lex_direct): Check for prefix L separately.
      
      	* Makefile.in: Update, and add c-objc-common.o dependencies.
      	* c-lang.c: Remove unnecessary includes.
      	(c_init): Move bulk of code to c_objc_common_init, and call it.
      	(c_tree_printer, c_missing_noreturn_ok_p, c_disregard_inline_limits,
      	inline_forbidden_p, c_cannot_inline_tree_fn): Move to
      	c-objc-common.c.
      	* c-objc-common.c: New.  Mostly pulled from c-lang.c.
      	* c-tree.h (c_disregard_inline_limits, c_cannot_inline_fn,
      	c_objc_common_init, c_missing_noreturn_ok_p): New.
      	* toplev.c: Update comment.
      	* doc/passes.texi: Update.
      	* objc/ojbc-act.c (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
      	LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS,
      	LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Override.
      	(objc_init): Update to use c_objc_common_init.
      
      From-SVN: r47388
      Neil Booth committed
  32. 21 Oct, 2001 1 commit
    • cpphash.h (struct cpp_buffer): Delete read_ahead and extra_char. · 480709cc
      	* cpphash.h (struct cpp_buffer): Delete read_ahead and extra_char.
      	* cpplex.c (lex_percent, lex_dot): Remove.
      	(get_effective_char, skip_block_comment, skip_line_comment,
      	parse_identifier_slow, parse_number, parse_string, save_comment,
      	_cpp_lex_direct): Update to do lookback freely.
      	(IF_NEXT_IS, BACKUP): New macros.
      	* cpplib.c (cpp_push_buffer): Don't set read_ahead and extra_char.
      	* cppmacro.c (paste_tokens): Update.
      
      From-SVN: r46392
      Neil Booth committed
  33. 02 Oct, 2001 1 commit
    • cpphash.h: Update comments. · 644eddaa
      	* cpphash.h: Update comments.
      	(cpp_context): Update.
      	(spec_nodes): Remove n__Pragma.
      	* cppinit.c (cpp_create_reader): Update.
      	(builtin_array): Add _Pragma.
      	* cpplib.h: Update comments.
      	(NODE_DISABLED, BT_PRAGMA): New.
      	(cpp_start_lookahead, cpp_stop_lookahead): Remove prototypes.
      	* cppmacro.c (struct cpp_macro): Remove disabled.
      	(builtin_macro): Return int, handle _Pragma, push the new token
      	on the context stack.
      	(funlike_invocation_p): Unconstify, update.
      	(enter_macro_context): Handle builtins here.
      	(replace_args, push_token_context, push_ptoken_context):
      	Update for prototype changes.
      	(_cpp_pop_context): Update.
      	(cpp_get_token): Don't handle buitins, nor _Pragma here.
      	(cpp_sys_macro_p): Update.
      	(_cpp_free_definition): Clear disabled flag.
      	(_cpp_create_definition): Upate.
      	* cppmain.c: Update comments.
      
      From-SVN: r45948
      Neil Booth committed
  34. 30 Sep, 2001 1 commit
    • cpphash.h (POOL_ALIGN, [...]): Remove. · 8c3b2693
      	* cpphash.h (POOL_ALIGN, POOL_FRONT, POOL_LIMIT, POOL_BASE,
      	POOL_SIZE, POOL_ROOM, POOL_COMMIT, struct cpp_chunk,
      	struct cpp_pool, _cpp_init_pool, _cpp_free_pool, _cpp_pool_reserve,
      	_cpp_pool_alloc, _cpp_next_chunk): Remove.
      	(_cpp_extend_buff, BUFF_ROOM): Update.
      	(_cpp_append_extend_buff): New.
      	(struct cpp_reader): Remove macro_pool, add a_buff.
      	* cppinit.c (cpp_create_reader): Initialize a_buff, instead of
      	macro_pool.
      	(cpp_destroy): Free a_buff instead of macro_pool.
      	* cpplex.c (new_chunk, chunk_suitable, _cpp_next_chunk,
      	new_chunk, _cpp_init_pool, _cpp_free_pool, _cpp_pool_reserve,
      	_cpp_pool_alloc, ): Remove.
      	(parse_number, parse_string): Update use of _cpp_extend_buff.
      	(_cpp_extend_buff): Update.
      	(_cpp_append_extend_buff, cpp_aligned_alloc): New.
      	* cpplib.c (glue_header_name, parse_answer):
      	Update use of _cpp_extend_buff.
      	(cpp_register_pragma, cpp_register_pragma_space): Use
      	_cpp_aligned_alloc.
      	(do_assert, do_unassert): Check for EOL, update.
      	* cppmacro.c (stringify_arg, collect_args): Update to use
      	_cpp_extend_buff and _cpp_append_extend_buff.
      	(save_parameter, parse_params, alloc_expansion_token,
      	_cpp_create_definition): Rework memory management.
      
      	* gcc.dg/cpp/redef2.c: Add test.
      
      From-SVN: r45899
      Neil Booth committed
  35. 28 Sep, 2001 1 commit
    • cpphash.h (struct cpp_buff): Make unsigned. · ece54d54
      	* cpphash.h (struct cpp_buff): Make unsigned.
      	(_cpp_get_buff): Take length of size_t.
      	(_cpp_unaligned_alloc): New.
      	(BUFF_ROOM, BUFF_FRONT, BUFF_LIMIT): New.
      	(struct cpp_reader): Remove ident_pool.  Add u_buff.
      	* cppinit.c (cpp_create_reader): Initialize u_buff, not ident_pool.
      	(cpp_destroy): Destroy u_buff, not ident_pool.
      	* cpplex.c (parse_number, parse_string, save_comment,
      	cpp_token_as_text): Update to use the unaligned buffer.
      	(new_buff): Make unsigned.
      	(_cpp_unaligned_alloc): New.
      	* cpplib.c (glue_header_name): Update to use the unaligned buffer.
      	* cppmacro.c (new_number_token, builtin_macro, stringify_arg):
      	Similarly.
      	(collect_args): Make unsigned.
      
      From-SVN: r45858
      Neil Booth committed