1. 03 Jan, 2002 1 commit
  2. 14 Sep, 2001 1 commit
    • cpperror.c (print_location): Take line and column, for default positioning use… · 97293897
      cpperror.c (print_location): Take line and column, for default positioning use the previously lexed token.
      
      	* cpperror.c (print_location): Take line and column, for
      	default positioning use the previously lexed token.
      	(_cpp_begin_message): Take line and column.
      	(cpp_ice, cpp_fatal, cpp_error, cpp_error_with_line, cpp_warning,
      	cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line): Update.
      	* cpphash.h (_cpp_begin_message): Update prototype.
      	* cppinit.c (push_include): Don't set output line.
      	* cpplex.c (_cpp_lex_token): Callback for start of new output lines.
      	* cpplib.c (do_diagnostic, _cpp_pop_buffer): Update.
      	(do_pragma): Kludge for front ends.  Don't expand macros at all.
      	* cpplib.h (cpp_lookahead, cpp_token_with_pos, cpp_get_line): Remove.
      	(struct cpp_token): Remove output_line.
      	(struct cpp_callbacks): New member line_change.
      	* cppmacro.c (builtin_macro, paste_all_tokens, replace_args,
      	cpp_get_token): Preserve BOL flag.
      	(cpp_get_line): Remove.
      	(_cpp_backup_tokens): Remove useless abort().
      	* cppmain.c (cb_line_change): New.
      	(scan_translation_unit): Don't worry about starting new lines here.
      	* scan-decls.c (scan_decls): Update.
      	* c-lex.c (c_lex, init_c_lex): Update.
      	(cb_line_change, src_lineno): New.
      
      From-SVN: r45613
      Neil Booth committed
  3. 22 Aug, 2001 1 commit
    • cpperror.c (print_location): Don't show _Pragma. · 29401c30
      	* cpperror.c (print_location): Don't show _Pragma.
      	* cppfiles.c (_cpp_pop_file_buffer): Handle -include file pushing
      	and file change callback generation here.
      	(stack_include_file): Update use of cpp_push_buffer.
      	* cpphash.h (_cpp_pop_file_buffer): Update prototype.
      	(struct cpp_buffer): Remove type, pfile members.
      	* cppinit.c (cpp_handle_option): Use free_chain.
      	* cpplex.c (_cpp_lex_token): Don't do -include file pushing here.
      	(skip_escaped_newlines, get_effective_char, lex_percent): Take
      	a cpp_reader rather than a cpp_buffer.
      	(skip_escaped_newlines, get_effective_char, skip_block_comment,
      	skip_line_comment, parse_string, lex_percent, lex_dot,
      	_cpp_lex_token): Update accordingly.
      	* cpplib.c (_cpp_pop_buffer): Don't do file change callback
      	generation here.
      	(cpp_push_buffer): Update prototype.
      	(run_directive): Update use of cpp_push_buffer.
      	(_cpp_do__Pragma, cpp_define, cpp_define_builtin, cpp_undef,
      	handle_assertion): Update use of run_directive.
      	* cpplib.h (enum cpp_buffer_type): Remove.
      	(cpp_push_buffer): Update prototype.
      	* fix-header.c (read_scan_file): Update.
      
      From-SVN: r45112
      Neil Booth committed
  4. 18 Aug, 2001 1 commit
    • ansidecl.h: Reorganize for readability... · b649398a
      include:
              * ansidecl.h: Reorganize for readability, remove documentation
              of obsolete macros, document PARAMS and VPARAMS.  Add new
              macros VA_OPEN, VA_CLOSE, and VA_FIXEDARG for nicer variadic
              function implementation.
      
      gcc:
              * cpperror.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
      
      From-SVN: r45011
      Zack Weinberg committed
  5. 17 Aug, 2001 1 commit
    • cpperror.c (print_location): Don't take a file name; use the line map instead. · bb74c963
      	* cpperror.c (print_location):  Don't take a file name; use the
      	line map instead.
      	(_cpp_begin_message): Similarly.
      	(cpp_ice, cpp_fatal, cpp_error, cpp_error_with_line, cpp_warning,
      	cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line): Update.
      	(cpp_pedwarn_with_file_and_line): Remove.
      	* cppfiles.c (stack_include_file): Update; set filename to stdin
      	here when appropriate.
      	* cpphash.h (struct cpp_buffer): Remove nominal_fname.
      	(_cpp_begin_message): Don't take a file name.
      	* cppinit.c: Add comment.
      	* cpplex.c: Fix end-of-directive indicator.
      	* cpplib.c: Don't include intl.h.
      	(run_directive, do_diagnostic): Update.
      	(do_line): Update to not use nominal_fname.
      	(cpp_push_buffer): Don't take a filename.
      	* cpplib.h (struct ht): Remove.
      	(cpp_push_buffer): Don't take a filename.
      	(cpp_pedwarn_with_file_and_line): Remove.
      	* cppmacro.c (struct cpp_macro): Remove file.
      	(builtin_macro): Update.
      	(_cpp_create_definition): Update.
      	* cppmain.c: Correct comment.
      	* fix-header.c (read_scan_file): Update.
      
      From-SVN: r44986
      Neil Booth committed
  6. 11 Aug, 2001 1 commit
    • c-lex.c (map): Make const. · 47d89cf3
      	* c-lex.c (map): Make const.
      	(cb_file_change): Update for callback passing a line map.
      	Don't assume we have a previous map.  Remove sanity check
      	about popping too many files.
      	* cpperror.c (print_location): Make map const.
      	* cppfiles.c (stack_include_file): Update; line maps now hold sysp.
      	(cpp_make_system_header): Similarly.
      	(search_from): Similarly.
      	(_cpp_execute_include): Don't remember where we came from.
      	* cpphash.h (struct cpp_buffer): Remove return_to_line, sysp.
      	(struct cpp_reader): Make map const.
      	(CPP_IN_SYSTEM_HEADER, _cpp_do_file_change): Update.
      	* cpplib.c (do_line): Update; line maps now hold sysp.
      	(cpp_push_buffer): Similarly.
      	(_cpp_do_file_change): Similarly; callback with map instead.
      	(cpp_get_line_maps): Constify return value.
      	(_cpp_pop_buffer): Update.
      	* cpplib.h (struct cpp_file_change): Remove.
      	(struct cpp_callbacks): Update.
      	(cpp_get_line_maps): Constify return value.
      	* cppmacro.c (_cpp_create_definition): Update.
      	* cppmain.c (struct printer): Constify map.
      	(maybe_print_line): Similarly.
      	(print_line): Similarly.  Deduce flags 1 and 2 here.
      	(cb_file_change): Update.
      	* line-map.c (free_line_maps): Warn regardless.
      	(add_line_map): Return pointer to const.  When passed NULL to_file
      	with LC_LEAVE, use the obvious values for the return point so the
      	caller doesn't have to figure them out.
      	(lookup_line): Return pointer to const.
      	(print_containing_files): Take pointer to const.
      	* line-map.h (struct line_map): New members reason, sysp.
      	(add_line_map): Return pointer to const.
      	(lookup_line): Similarly.
      	(print_containing_files): Take pointer to const.
      
      From-SVN: r44789
      Neil Booth committed
  7. 06 Aug, 2001 1 commit
    • cpperror.c (print_containing_files): Moved to line-map.c. · fde84349
      	* cpperror.c (print_containing_files): Moved to line-map.c.
      	(print_location): line-map.c handles re-listing or otherwise.
      	* cpphash.h (struct lexer_state): Remove next_bol.
      	(struct cpp_buffer): Remove include_stack_listed.
      	* cpplib.c (do_line, cpp_push_buffer, _cpp_pop_buffer):
      	Remove faked buffer handling.
      	(_cpp_do_file_change): Tweak.
      	* cpplib.h (enum cpp_buffer_type): Remove BUF_FAKE.
      	* cppmain.c (struct printer): Remove filename.
      	(print_line, cb_file_change): Update accordingly.
      	* line-map.c: Include intl.h.
      	(init_line_maps): Initialize last_listed.
      	(free_line_maps): Sanity check, warn if ENABLED_CHECKING.
      	(add_line_map): Sanity check inputs, warn if ENABLED_CHECKING.
      	(print_containing_files): New.
      	* line-map.h (struct line_maps): New member last_listed.
      	(print_containing_files, INCLUDED_FROM): New.
      	* Makefile.in: Update.
      	* po/POTFILES.in: Add line-map.c.
      
      From-SVN: r44670
      Neil Booth committed
  8. 05 Aug, 2001 1 commit
    • re PR preprocessor/3081 (Preprocessor merges 2 first lines when -imacros is being used) · 67821e3a
      	PR preprocessor/3081
      	* c-lex.c (map): New.
      	(cb_file_change): Update map and use it.
      	(cb_def_pragma, cb_define, cb_undef): Use map and line.
      	(c_lex): Update to use map.
      	* cpperror.c (print_location): Move to using logical line numbers.
      	* cppfiles.c (stack_include_file): Update for new _cpp_do_file_change.
      	(cpp_make_system_header): Similarly.
      	(_cpp_execute_include): Stop line numbering hacks.  Store the
      	line we will return to.
      	* cpphash.h (CPP_BUF_LINE): Remove.
      	(struct cpp_buffer): Remove lineno and pseudo_newlines.
      	Add map and return_to_line.
      	(_cpp_do_file_change): Update.
      	* cppinit.c (cpp_start_read): Update line kludge.
      	* cpplex.c (handle_newline): Don't update lineno and pseudo_newlines.
      	(trigraph_ok): Use logical line numbers for diagnostics.
      	(skip_block_comment): Likewise.
      	(skip_whitespace): Likewise.
      	(skip_line_comment): Use pfile->line instead.
      	(_cpp_lex_token): Update to use logical line numbering exclusively.
      	Handle BOL locally.  Accept new lines in directives, but keep
      	pfile->line decremented.  Diagnostics use logical lines.  Update
      	directive handling.
      	* cpplib.c (SEEN_EOL): New.
      	(skip_rest_of_line, check_eol): Use it.
      	(end_directive): Increase line number when accepting the newline
      	at the end of a directive.
      	(run_directive): Simplify.
      	(do_line): Bad LC_LEAVEs become LC_RENAMEs.  Update.
      	(_cpp_do_file_change): Update to take buffer line number as an
      	argument, and store the current map in the cpp_reader.  Remove
      	line number kludges.
      	(_cpp_do__Pragma): Restore output position after a _Pragma.
      	(cpp_push_buffer): Don't set output line or lineno.
      	(_cpp_pop_buffer): Transfer more info from a faked buffer.
      	Remove line kludge.  Set output_line.
      	* cppmacro.c (builtin_macro): Update handling of __LINE__.
      	(parse_arg): Use logical lines.
      	(save_lookahead_token): Save EOFs too now.
      	* cppmain.c (struct printer): Fix comments.
      	(printer_init): Simplify, let caller do errors.
      	(scan_translation_unit, check_multiline_token, dump_macro): Update.
      	(maybe_print_line): Simplify.
      	(print_line): Don't print a linemarker if -P.
      	(cb_define, cb_undef, cb_def_pragma, cb_ident, cb_include): Update.
      	(cb_file_change): Simplify.
      	* line-map.h (LAST_SOURCE_LINE): Fix.
      	(CURRENT_LINE_MAP): New.
      
      	* gcc.dg/cpp/19951025-1.c: Revert.
      	* gcc.dg/cpp/directiv.c: We no longer process directives that
      	interrupt macro arguments.
      
      From-SVN: r44650
      Neil Booth committed
  9. 02 Aug, 2001 1 commit
    • line-map.c: New. · d82fc108
      	* line-map.c: New.
      	* line-map.h: New.
      	* Makefile.in (line-map.o): New.
      	(LIBCPP_OBJS, LIBCPP_DEPS): Update.
      	* c-lex.c (cb_file_change): Update for new cpp_file_change structure.
      	* cpperror.c (print_containing_files): Similarly.
      	(print_location): Update.  Don't output a space before _Pragma.
      	* cppfiles.c (stack_include_file): Set to line 1 immediately.
      	(stack_include_filee, cpp_make_system_header): Update.
      	(_cpp_execute_include): Get logical line number right for calling
      	as-yet-unterminated #include.
      	* cpphash.h (struct cpp_reader): Add line_maps.
      	(_cpp_do_file_change): Update.
      	* cppinit.c (cpp_create_reader): Initialize line maps.
      	(cpp_destroy): Destroy line maps.
      	(cpp_start_read): Get logical line number right.
      	* cpplex.c (parse_string): Only warn once for multi-line strings.
      	Use boolean variable for null warning.
      	* cpplib.c (_cpp_handle_directive): End the directive if it isn't
      	already.
      	(do_include_common): End the directive early.
      	(do_line): Don't warn about out-of-range lines in preprocessed
      	source.  Update.  Remove unused variables.
      	(_cpp_do_file_change): Update for new line mapping.
      	(pragma_cb): New typedef.
      	(cpp_register_pragma): Stop looking ahead before calling the
      	handler.  Clean up.
      	(do_pragma_system_header): End directive early.
      	(cpp_get_line_maps): New.
      	(cpp_pop_buffer): Fudge logical line.  Update.
      	* cpplib.h: Include line-map.h
      	(enum cpp_fc_reason): Remove.
      	(struct cpp_file_change): Update.
      	(cpp_get_line_maps): New.
      	* cppmain.c (struct_printer): New member map.
      	(cb_file_change): Update for new mappings.
      	* fix-header.c (cb_file_change): Similarly.
      testsuite:
      	* gcc.dg/cpp/19951025-1.c: Update.
      
      From-SVN: r44584
      Neil Booth committed
  10. 22 Apr, 2001 1 commit
  11. 08 Apr, 2001 1 commit
  12. 23 Jan, 2001 1 commit
  13. 17 Dec, 2000 2 commits
    • cppmain.c (check_multiline_token): New function. · dfbf62ec
              * cppmain.c (check_multiline_token): New function.
              (scan_buffer): Use it.
              (cb_change_file): Restructure to avoid warning.
              * cpperror.c (print_location): Initialize col.
      
      From-SVN: r38332
      Neil Booth committed
    • c-lex.c: Move main_input_filename handling to FC_ENTER. · ad2a084d
              * c-lex.c: Move main_input_filename handling to FC_ENTER. Clean up.
              * cpperror.c (print_containing_files): Get right line number.
              (print_location): Output column of 1 if 0.
              * cppfiles.c (stack_include_file): cpp_push_buffer handles
              the callback.
              * cpphash.h (_cpp_do_file_change): No longer external.
              * cpplib.c (do_file_change): Now local to cpplib.c.
              (do_line): Fake a buffer stack for preprocessed files.
              (cpp_push_buffer): Create a file_change callback.  Handle faked
              buffers.
              (cpp_pop_buffer): Similarly.
              * cpplib.h: BUF_FAKE: New buffer type.
              * cppmain.c: Update to handle correct file renaming where a
              #line is the first line of the main file, and produce only
              the renamed file, not the original file, as output.
      
      From-SVN: r38319
      Neil Booth committed
  14. 11 Dec, 2000 1 commit
    • cpperror.c (print_location): New function. · 0bda4760
              * cpperror.c (print_location): New function.
              (print_containing_files): Simplify.
              (_cpp_begin_message): Simplify and use print_location.
              * cppfiles.c (stack_include_file): Update.
              (_cpp_pop_file_buffer): Update.
              * cpphash.h (struct cpp_buffer): New members
              include_stack_listed and type.
              * cpplib.c (_cpp_handle_directive): Buffer->inc is not null.
              (run_directive): Take buffer type.  cpp_push_buffer cannot fail.
              (_cpp_do__Pragma, cpp_define, _cpp_define_builtin, cpp_undef,
              handle_assertion): Update.
              (cpp_push_buffer): Take a buffer type and file name.
              (cpp_pop_buffer): Update.  Clear include_stack_listed.
              * cpplib.h (input_stack_listing_current): Remove.
              (enum cpp_buffer_type): New.
              (cpp_push_buffer): New prototype.
              * cppmacro.c (builtin_macro): Simplify; buffer cannot be null.
              * fix-header.c (read_scan_file): Update.
      
      From-SVN: r38186
      Neil Booth committed
  15. 17 Nov, 2000 1 commit
  16. 28 Oct, 2000 1 commit
    • New macro expander. · 93c80368
      2000-10-28  Neil Booth  <neilb@earthling.net>
      
      	New macro expander.
      
      	* cpplib.c (struct answer): New.
      	(struct if_stack): Use cpp_lexer_pos rather than line and col.
      	Rename cmacro mi_cmacro.
      	(struct directive, KANDR, STDC89, EXTENSION, COND, IF_COND, INCL,
      	IN_I): New directive and flags.
      	(skip_rest_of_line, check_eol, run_directive, glue_header_name,
      	parse_answer, parse_assertion, find_answer): New functions.
      	(parse_ifdef, detect_if_not_defined, validate_else): Remove.
      	(lex_macro_node): New function to replace parse_ifdef and
      	get_define_node.
      
      	(_cpp_handle_directive): New function, combines _cpp_check_directive
      	and _cpp_check_linemarker.
      
      	(do_define, do_undef, parse_include, do_include, do_import,
      	do_include_next, read_line_number, do_line, do_ident, do_pragma,
      	do_pragma_once, do_pragma_poison, do_pragma_dependency):
      	Update for new token getting interface.
      
      	(do_ifdef, do_ifndef, do_if, do_else, do_endif, push_conditional)
      	: Update for new multiple-include optimisation technique.
      	(do_elif): Don't forget to invalidate controlling macros.
      
      	(unwind_if_stack, cpp_defined, cpp_push_buffer, cpp_pop_buffer): Update.
      	(parse_assertion, parse_answer, find_answer, _cpp_test_assertion):
      	Functions to handle assertions with the new token interface.
      	(do_assert, do_unassert): Use them.
      
      	(cpp_define, _cpp_define_builtin, cpp_undef, cpp_assert, cpp_unassert):
      	Use run_directive.
      
      	(_cpp_init_stacks): Register directive names.  Don't register special
      	nodes.
      
      	* cpperror.c (print_containing_files, _cpp_begin_message): Update to
      	new position recording regime.
      	(cpp_ice, cpp_fatal, cpp_error, cpp_error_with_line, cpp_warning,
      	cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line,
      	cpp_pedwarn_with_file_and_line): Update for _cpp_begin_message changes.
      	(cpp_type2name): Move to cpplex.c.
      
      	* cppexp.c (parse_charconst): spec_nodes is no longer a pointer.
      	(parse_defined): Update to handle new multiple include optimisation
      	method.  Remove poisoned identifier warning.
      	(parse_assertion, TYPE_NAME): Delete.
      	(lex): Update for multiple include optimisation, removal of
      	CPP_DEFINED, to use _cpp_test_assertion for assertions and
      	cpp_token_as_text.
      	(_cpp_parse_expr): Update for MI optimisation, and to use op_as_text.
      	(op_as_text): New function, to wrap cpp_token_as_text.
      
      	* cppfiles.c (stack_include_file, _cpp_pop_file_buffer):
      	Update for MI optimisation.
      	(_cpp_execute_include): Take a token rather than 3 arguments.  Fix
      	segfault on diagnostic.
      	(_cpp_compare_file_date): Take a token rather than 3 args.
      	(cpp_read_file): Work correctly for zero-length files.
      
      	* cpphash.c (_cpp_init_macros, _cpp_cleanup_macros): Rename
      	_cpp_init_hashtable and _cpp_cleanup_hashtable.
      	(cpp_lookup): Place identifiers at front of identifier pool
      	for _cpp_lookup_with_hash.
      	(_cpp_lookup_with_hash): Require identifiers to be at the front of
      	the identifier pool.  Commit the memory if not already in the
      	hash table.
      
      	* cppinit.c (cpp_reader_init): Move cpp_init_completed test to top.
      	Initialise various members of cpp_reader, memory pools, and the
      	special nodes.
      	(cpp_printer_init): Delete.
      	(cpp_cleanup): Update.
      	(struct builtin, builtin_array, initialize_builtins): Update for new
      	hashnode definition and builtin handling.
      	(cpp_start_read, cpp_finish): Don't take or initialise a
      	printer.  Update.
      
      	* cpplib.h (cpp_printer, cpp_toklist, CPP_DEFINED, BOL,
      	PASTED, VAR_ARGS, BEG_OF_FILE, IN_DIRECTIVE, KNOWN_DIRECTIVE,
      	T_VOID, T_SPECLINE, T_DATE, T_FILE, T_BASE_FILE, T_INCLUDE_LEVEL,
      	T_TIME, T_STDC, T_OPERATOR, T_POISON, T_MACRO, T_ASSERTION): Delete.
      	(struct cpp_pool, struct cpp_macro, struct cpp_lexer_pos,
      	struct cpp_lookahead, CPP_DHASH, enum mi_state, enum mi_ind,
      	NO_EXPAND, VARARGS_FIRST, struct cpp_token_with_pos,
      	struct toklist, struct cpp_context, struct specnodes,
      	TOKEN_LOOKAHEAD, TOKEN_BUFFSIZE, NODE_OPERATOR, NODE_POISONED,
      	NODE_BUILTIN, NODE_DIAGNOSTIC, NT_VOID, NT_MACRO, NT_ASSERTION,
      	enum builtin_type, cpp_can_paste): New.
      	(struct cpp_token): Delete line and col members.
      	(struct cpp_buffer): New member output_lineno.
      	(struct lexer_state): Delete indented, in_lex_line, seen_dot.
      	Add va_args_ok, poisoned_ok, prevent_expansion, parsing_args.
      	(struct cpp_reader): New members lexer_pos, macro_pos, directive_pos,
      	ident_pool, temp_string_pool, macro_pool, argument_pool, string_pool,
      	base_context, context, directive, mi_state, mi_if_not_defined,
      	mi_lexed, mi_cmacro, mi_ind_cmacro, la_read, la_write, la_unused,
      	mlstring_pos, macro_buffer, macro_buffer_len.
      	Delete members mls_line, mls_column, token_list, potential_control_macro,
      	temp_tokens, temp_cap, temp_alloced, temp_used, first_directive_token,
      	context_cap, cur_context, no_expand_level, paste_level, contexts, args,
      	save_parameter_spellings, need_newline, .
      	Change type of date, time and spec_nodes members.
      	Change prototypes for include and ident callbacks.
      	(struct cpp_hashnode): Change type of name.  Remove union members
      	expansion and code.  Add members macro, operator and builtin.
      
      	(cpp_token_len, cpp_token_as_text, cpp_spell_token, cpp_start_read,
      	cpp_finish, cpp_avoid_paste, cpp_get_token, cpp_get_line,
      	cpp_get_output_line, cpp_macro_definition, cpp_start_lookahead,
      	cpp_stop_lookahead): New prototypes.
      	(cpp_printer_init, cpp_dump_definition): Delete prototypes.
      
      	(U_CHAR, U, ustrcmp, ustrncmp, ustrlen, uxstrdup, ustrchr, ufputs):
      	Move from cpphash.h.
      
      	* cpphash.h (U_CHAR, U, ustrcmp, ustrncmp, ustrlen, uxstrdup, ustrchr,
      	ufputs): Move to cpplib.h.
      	(enum spell_type, struct token_spelling, _cpp_token_spellings, TOKEN_SPELL,
      	TOKEN_NAME, struct answer, FREE_ANSWER, KANDR, STDC89, EXTENSION,
      	COND, EXPAND, INCL, COMMENTS, IN_I, struct directive, directive_handler,
      	struct spec_nodes, _cpp_digraph_spellings, _cpp_free_temp_tokens,
      	_cpp_init_input_buffer, _cpp_grow_token_buffer, _cpp_init_toklist,
      	_cpp_clear_toklist, _cpp_expand_token_space, _cpp_expand_name_space,
      	_cpp_equiv_tokens, _cpp_equiv_toklists, _cpp_process_directive,
      	_cpp_run_directive, _cpp_get_line, _cpp_get_raw_token, _cpp_glue_header_name,
      	_cpp_can_paste, _cpp_check_directive, _cpp_check_linemarker,
      	_cpp_parse_assertion, _cpp_find_answer): Delete.
      	(VALID_SIGN, ALIGN, POOL_FRONT, POOL_LIMIT, POOL_BASE, POOL_SIZE,
      	POOL_USED, POOL_COMMIT, struct cpp_chunk, _cpp_lex_token, _cpp_init_pool,
      	_cpp_free_pool, _cpp_pool_reserve, _cpp_pool_alloc, _cpp_next_chunk,
      	_cpp_lock_pool, _cpp_unlock_pool, _cpp_test_assertion,
      	_cpp_handle_directive, DSC): New.
      	(struct include_file): New member defined.
      
      	(DO_NOT_REREAD, _cpp_begin_message, _cpp_execute_include,
      	_cpp_compare_file_date): Update.
      	(_cpp_pop_context, _cpp_get_token, _cpp_free_lookaheads, _cpp_push_token): New.
      	(_cpp_init_macros, _cpp_cleanup_macros): Rename to _cpp_init_hashtable,
      	_cpp_cleanup_hashtable.
      
      	* Makefile.in: Remove cppoutput.c.
      
      	* cppoutput.c: Delete
      
      	* fixheader.c (read_scan_file): Update for new cpp_get_token
      	prototype.
      	(recognized_function): New argument LINE.
      
      	* scan-decls.c (skip_to_closing_brace, scan_decls): Update for
      	new cpp_get_token prototype.
      
      	* scan.h (recognized_function): Update prototype.
      
      	* po/POTFILES.in: Remove cppoutput.c.
      
      From-SVN: r37098
      Neil Booth committed
  17. 28 Sep, 2000 1 commit
    • cpperror.c (_cpp_begin_message): Do the test for suppression of warnings and… · d8090680
      cpperror.c (_cpp_begin_message): Do the test for suppression of warnings and pedantic warnings before the "is a...
      
      	* cpperror.c (_cpp_begin_message):  Do the test for suppression
              of warnings and pedantic warnings before the "is a warning an
              error" tests.
      	* cppinit.c (cpp_handle_option): Remove surplus \n.
      	* cpplex.c (ON_REST_ARG): Delete.
      	(skip_block_comment): Initialise prevc.
      	(parse_args): Improve error messages.
      	(maybe_paste_with_next): Use CONTEXT_VARARGS rather
      	than ON_REST_ARG.
      	* cpplib.c (cpp_push_buffer): Fix grammar in message.
      	* cppmain.c (main): Set callbacks for #ident and #pragma
      	only if no_output option is false.
      	(do_pragma_implementation): Only call the #pragma handler
      	if it is set in the cpp_reader structure.
      
      From-SVN: r36655
      Neil Booth committed
  18. 25 Sep, 2000 1 commit
    • flags.h: Declare warning flag warn_system_headers. · 317639a8
      2000-09-25  Branko Cibej  <branko.cibej@hermes.si>
      
              * flags.h:  Declare warning flag warn_system_headers.
              * toplev.c:  Define it.
              (W_options): Add option -Wsystem-headers.
              * diagnostic.c (count_error): Test warn_system_headers.
              * invoke.texi:  Add description for -Wsystem-headers.
      	* cpplib.h (cpp_options): New member warn_system_headers.
      	* cpphash.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Don't test
      	CPP_IN_SYSTEM_HEADER.
      	* cpplib.c (do_import, do_pragma_once): Likewise.
      	* cpperror.c (_cpp_begin_message): Test warn_system_headers
      	and CPP_IN_SYSTEM_HEADER.
      	* cppinit.c (handle_option): Recognize -Wsystem_headers.
      	(print_help): Describe -Wsystem_headers.
      	* cpplex.c (lex_line): Reorganize condition so that warnings
      	about C++ comments in system headers can be enabled. Remove
      	label do_line_comment.
      
      From-SVN: r36636
      Branko Cibej committed
  19. 29 Aug, 2000 1 commit
    • cpperror.c (print_file_and_line): If line is (unsigned int)-1, print just the filename. · 2c8f0515
      	* cpperror.c (print_file_and_line): If line is (unsigned int)-1,
      	print just the filename.
      	* cpplex.c (_cpp_run_directive): Add additional argument, the
      	name to give the synthetic buffer.  This defaults to
      	translated "<command line>".
      	* cpplib.c (cpp_define, cpp_undef, cpp_assert, cpp_unassert):
      	Adjust to match.
      	(_cpp_define_builtin): New function.
      	* cppinit.c (initialize_builtins): Use _cpp_define_builtin.
      	* cpphash.h: Update prototypes.
      
      	* tradcpp.c (main): Process -D and -U simultaneously, in the
      	order they appeared on the command line.
      
      From-SVN: r36043
      Zack Weinberg committed
  20. 09 Aug, 2000 1 commit
    • configure.in (--enable-c-cpplib): Uncomment. · 9ec7291f
      	* configure.in (--enable-c-cpplib): Uncomment.  Use AC_DEFINE
      	instead of extra_c_flags.
      	(--enable-c-mbchar): Use AC_DEFINE instead of extra_c_flags.
      	* configure: Regenerate.
      	* config.in: Regenerate.
      
      	* cpperror.c (cpp_type2name): New function.
      	* cpplex.c (lex_line): If we issued an error for an invalid
      	preprocessing directive, discard that logical line.
      	* cpplib.c (do_line): Call a hook function if the current file
      	is renamed by #line.
      	(do_ident): Pass the contents of the string, not the entire
      	token, to the callback function.
      	* cpplib.h (CPP_LAST_PUNCTUATOR): New #define.
      	(cb.rename_file): New hook function.
      	(cb.ident): Adjust prototype.
      	(cpp_type2name): Prototype.
      	* cppmacro.c (dump_macro_args): Correct precedence lossage.
      
      	* cppmain.c (cb_ident): Update for changed interface.
      	(cb_rename_file): New function.
      	(main): Set rename callback.
      
      From-SVN: r35593
      Zack Weinberg committed
  21. 02 Aug, 2000 1 commit
    • cpperror.c (v_message): Split into _cpp_begin_message and v_message macro. · 58fea6af
      	* cpperror.c (v_message): Split into _cpp_begin_message and
      	v_message macro.  All callers updated.
      	(_cpp_begin_message): Do inhibit_errors/inhibit_warnings
      	checks here.
      
      	* cppfiles.c (cpp_syshdr_flags): New function.
      	(read_include_file): Don't call cpp_output_tokens.  Call
      	enter_file hook.
      	* cppinit.c (dump_macros_helper): Moved to cppmain.c.
      	(cpp_reader_init): Don't initialize token_buffer.  Call
      	_cpp_init_internal_pragmas.
      	(cpp_cleanup): Don't clear token_buffer.
      	(cpp_start_read): Don't worry about output from -D processing.
      	Don't call cpp_output_tokens.
      	(cpp_finish): Don't dump macros here.  Don't call
      	cpp_output_tokens.
      	* cppmacro.c (_cpp_dump_definition): Rename
      	cpp_dump_definition.  Write directly to a FILE *.
      	(dump_funlike_macro): Delete.
      	(dump_macro_args): New.
      
      	* cpplex.c (TOKEN_LEN): Convert to inline function.
      	(_cpp_grow_token_buffer, safe_fwrite, cpp_output_tokens,
      	cpp_scan_line, _cpp_dump_list): Delete.
      	(cpp_printf, cpp_output_list): New.
      	(output_line_command): Don't worry about entering or leaving files.
      	(cpp_scan_buffer): Just output each token as we hit it.
      	(process_directive): Don't call cpp_output_tokens.
      	(_cpp_glue_header_name): Don't use token_buffer.
      	(output_token, dump_param_spelling): Write directly to a FILE *.
      
      	* cpplib.c (pass_thru_directive, dump_macro_name,
      	pragma_dispatch, do_pragma_gcc): Delete.
      	(do_define, do_undef, parse_include, do_line, do_ident, do_pragma,
      	do_pragma_poison, cpp_pop_buffer): Call the appropriate hook
      	functions.
      	(do_error, do_warning, pragma_dependency): Call
      	_cpp_begin_message, then cpp_output_list.
      	(cpp_register_pragma, cpp_register_pragma_space,
      	_cpp_init_internal_pragmas): New.
      	(do_pragma): Walk the pragmas table here.
      	(do_pragma_once, do_pragma_poison, do_pragma_system_header,
      	do_pragma_dependency): Return void.
      	(do_pragma_implementation): Moved to cppmain.c.
      
      	* cpplib.h: Update prototypes.
      	 (struct cpp_reader): Remove printer, token_buffer,
      	token_buffer_size, and limit.  Add struct cb, and pragmas.
      	(struct cpp_printer): Remove last_id and written.
      	(CPP_WRITTEN, CPP_PWRITTEN, CPP_SET_WRITTEN,
      	CPP_ADJUST_WRITTEN): Delete.
      	* cpphash.h: Update prototypes.
      	(ufputs): New wrapper.
      
      	* cppmain.c (cb_define, cb_undef, cb_include, cb_ident,
      	cb_enter_file, cb_leave_file, cb_def_pragma): New functions.
      	(main): Set up callbacks.  Register #pragma implementation.
      	Dump macros from here.
      
      From-SVN: r35415
      Zack Weinberg committed
  22. 04 Jul, 2000 1 commit
    • top level: · 041c3194
      2000-07-03  Zack Weinberg  <zack@wolery.cumb.org>
      
      	* fix-header.c (struct partial_proto): Remove unnecessary fields.
      	(recognized_extern, recognized_function, read_scan_file):
      	Update for new scheme.
      	(check_protection): It's still a multiple include guard even
      	if it doesn't always trigger.
      	* scan-decls.c (skip_to_closing_brace, scan_decls): Update for
      	new scheme.
      	* scan.h: Declare struct cpp_token.  Update prototypes.
      
      2000-07-03  Neil Booth  <neilb@earthling.net>
      	    Zack Weinberg  <zack@wolery.cumb.org>
      
      	Complete overhaul of the lexer and macro expander.
      
      	* cpphash.c (object_defn, funct_defn, push_macro_expansion,
      	arg, arglist, argdata, reflist, collect_objlike_expansion,
      	collect_funlike_expansion, collect_params,
      	warn_trad_stringify, trad_stringify, duplicate_arg_p, add_pat,
      	unsafe_chars, macarg, compare_defs, special_symbol,
      	scan_arguments, stringify, funlike_macroexpand,
      	_cpp_quote_string, monthnames): Delete.
      	(cpp_lookup, _cpp_free_definition, dump_funlike_macro,
      	_cpp_create_definition, _cpp_dump_definition,
      	dump_hash_helper): Adjust.
      	(find_param, count_params, parse_define, var_args_str,
      	check_macro_redefinition, save_expansion): New.
      
      	* cpplex.c (skip_block_comment, skip_line_comment, parse_name,
              parse_string, output_line_command, trigraph_replace,
              lex_line, cpp_push_buffer, cpp_pop_buffer, cpp_output_tokens,
              cpp_scan_buffer_nooutput, cpp_scan_buffer, cpp_free_toklist,
              cpp_idcmp, _cpp_get_directive_token, _cpp_init_input_buffer,
      	_cpp_skip_rest_of_line): Modify.
      
              (maybe_macroexpand, skip_comment, copy_comment, skip_string,
      	find_position, null_warning, bump_column, expand_name_space,
      	pedantic_whitespace, _cpp_output_list, _cpp_slice_toklist,
      	_cpp_squeeze_toklist, _cpp_scan_until, _cpp_skip_hspace,
      	_cpp_parse_name, _cpp_lex_token, cpp_get_non_space_token,
      	_cpp_prescan): Delete.
      
      	(dump_param_spelling, process_directive, lex_next,
              is_macro_disabled, stringify_arg, expand_context_stack,
              output_token, make_string_token, alloc_number_token,
              special_symbol, duplicate_token, maybe_paste_with_next,
              can_paste, prevent_macro_expansion, restore_macro_expansion,
              get_temp_token, release_temp_tokens, quote_string,
              token_names, token_spellings, _cpp_expand_name_space,
              _cpp_glue_header_name, _cpp_reserve_name_space,
              digraph_spellings, trigraph_ok, skip_whitespace, save_comment,
              placemarker_token, eof_token, cpp_context, macro_args,
              get_raw_token, parse_arg, parse_args, save_token,
              push_arg_context, push_macro_context, pop_context,
              do_pop_context, free_macro_args, _cpp_get_line,
              _cpp_run_directive): New.
      
      	* cpplib.c (validate_else, parse_include, push_conditional,
      	pass_thru_directive, read_line_number, parse_ifdef,
      	detect_if_not_defined, _cpp_check_directive, do_define,
      	do_undef, do_include, do_import, do_include_next, do_error,
      	do_warning, do_ident, do_pragma, pragma_dispatch, gcc_pragmas,
      	top_pragmas, do_pragma_gcc, do_pragma_implementation,
      	do_pragma_poison, do_pragma_system_header,
      	do_pragma_dependency, do_sccs, do_ifdef, do_ifndef, do_else,
      	dl_elif, do_endif, _cpp_unwind_if_stack, do_assert,
      	do_unassert, cpp_define, cpp_undef, cpp_assert, cpp_unassert,
      	cpp_defined): Update for new scheme.
      	(strtoul_for_line, get_define_node, dump_macro_name,
      	_cpp_check_linemarker, _cpp_parse_assertion): New.
      	(_cpp_handle_directive, do_pragma_default): Delete.
      
      	* cpphash.h (struct predicate): Now struct answer.
      	(enum spell_type, struct token_spelling, struct directive,
      	directive_handler): New.
      	Update prototypes.  Remove unused macros.
      	* cpplib.h: Update prototypes.  Remove unused macros,
      	structure definitions, and fields.
      
      	* cpperror.c (print_containing_files, v_message): Adjust.
      	* cppexp.c (parse_assertion, lex, parse_escape,
      	_cpp_parse_expr): Adjust.
      	* cppfiles.c (open_include_file, _cpp_execute_include,
      	_cpp_compare_file_date, cpp_read_file, read_include_file):
      	Adjust.
      	* cppinit.c (dump_special_to_buffer): Delete.
      	(append_include_chain, merge_include_chains, cpp_reader_init,
      	cpp_cleanup, initialize_builtins, builtin_array, cpp_start_read,
      	cpp_finish, handle_option, print_help): Adjust.
      	* cppmain.c (main): Adjust.
      
      testsuite:
      2000-07-03  Zack Weinberg  <zack@wolery.cumb.org>
      
      	* testsuite/gcc.dg/cpp/19951025-1.c: Adjust regexps.
      	* testsuite/gcc.dg/cpp/19990703-1.c: Likewise.
      	* testsuite/gcc.dg/cpp/20000625-1.c: Likewise.
      	* testsuite/gcc.dg/cpp/20000625-2.c: Likewise.
      
      	* testsuite/gcc.dg/cpp/macro1.c,
      	testsuite/gcc.dg/cpp/paste1.c, testsuite/gcc.dg/cpp/paste2.c,
      	testsuite/gcc.dg/cpp/paste3.c, testsuite/gcc.dg/cpp/paste4.c,
      	testsuite/gcc.dg/cpp/strify1.c,
      	testsuite/gcc.dg/cpp/strify2.c: New tests.
      
      From-SVN: r34859
      Zack Weinberg committed
  23. 01 May, 2000 1 commit
    • cpphash.c (_cpp_make_hashnode): Rename make_HASHNODE, now static. · a7abcbbf
      	* cpphash.c (_cpp_make_hashnode): Rename make_HASHNODE, now
      	static.  Allocate the hashnode and its string in the same
      	block of memory.
      	(del_HASHNODE): Don't free h->name.
      	(_cpp_lookup): If there is no entry for this string, create
      	one, of type T_VOID.
      	(_cpp_lookup_slot): Delete.
      	* cpphash.h: Update prototypes.
      
      	* cpplex.c (maybe_macroexpand): Check for hp->type == T_VOID,
      	not hp == NULL.
      	* cpplib.c (do_define, do_undef, do_pragma_poison, do_assert,
      	do_unassert, cpp_defined): Use _cpp_lookup.  Don't create a
      	node here, just fill in the value field properly.  "Delete"
      	entries by setting the value field to T_VOID.  Check for
      	hp->type == T_VOID, not hp == NULL.
      
      	* Makefile.in (cpplib.o): Don't depend on $(HASHTAB_H).
      	* cpperror.c, cppexp.c, cpplex.c, cpplib.c:  Don't include
      	hashtab.h.
      
      From-SVN: r33581
      Zack Weinberg committed
  24. 18 Apr, 2000 1 commit
    • conflict.c (conflict_graph_add): Pass enum type to htab_find_slot. · e38992e8
      	* gcc/conflict.c (conflict_graph_add): Pass enum type to
      	htab_find_slot.
      	* gcc/cpperror.c (hashtab.h): Now include.
      	* gcc/cppexp.c (hashtab.h): Likewise.
      	* gcc/cpplex.c (hashtab.h): Likewise.
      	* gcc/cppfiles.c (hashtab.h): Likewise.
      	(find_include_file, _cpp_calc_hash, cpp_read_file): Pass enum type
      	to htab_find_slot_with_hash.
      	* gcc/cpphash.c (hashtab.h): Now include.
      	(_cpp_lookup_slot): INSERT is now enum insert_option.
      	* gcc/cpphash.h (_cpp_lookup_slot): Likewise.
      	* gcc/cppinit.c (hashtab.h): Include earlier.
      	(initialize_builtins): Pass enum to htab_find_slot.
      	* gcc/cpplib.c (hashtab.h): Now include.
      	(do_define, do_undef): Pass enum type to _cpp_lookup_slot.
      	(do_pragma_poison, do_assert): Likewise.
      	* gcc/emit-rtl.c (gen_rtx_CONST_INT): Pass enum to
      	htab_find_slot_with_hash.
      	* gcc/simplify-rtx.c (cselib_lookup_mem, cselib_lookup): Likewise.
      	* gcc/tree.c (type_hash_add): Likewise.
      	(build1): Minor cleanup.
      	* include/hashtab.h (enum insert_option): New type.
      	(htab_find_slot, htab_find_slot_with_hash): Use it.
      	* libiberty/hashtab.c: Various minor cleanups.
      	(htab_find_slot_with_hash): INSERT is now enum insert_option.
      	(htab_find_slot): Likewise.
      
      From-SVN: r33236
      Richard Kenner committed
  25. 14 Apr, 2000 1 commit
    • cpplex.c (cpp_output_tokens, [...]): New public interfaces. · f2d5f0cc
      	* cpplex.c (cpp_output_tokens, cpp_scan_buffer_nooutput): New public
      	interfaces.
      	(safe_fwrite, output_line_command): New static functions.
      	(cpp_expand_to_buffer): Now private to cpplib.
      	(cpp_scan_buffer): Take a printer.
      
      	* cpphash.h: Update prototypes.
      	* cpplib.h: Update prototypes.
      	(cpp_printer): New.
      	(cpp_buffer): Remove last_nominal_fname.
      	(cpp_reader): Remove lineno.
      
      	* cppmain.c: Use a cpp_printer.
      	* fix-header.c: No need to inhibit line commands.  Call
      	cpp_start_read with no printer.
      
      	* cpperror.c (cpp_notice_from_errno): Provide default name.
      	* cppfiles.c (make_IHASH, _cpp_fake_ihash): New functions.
      	(find_include_file, cpp_read_file): Use make_IHASH.
      	(file_cleanup): Set control_macro and clear
      	input_stack_listing_current here.
      	(_cpp_execute_include): Don't output entering-file marker.
      	* cpphash.c (special_symbol): Look for the line number in the
      	buffer, not the reader.
      	(_cpp_macroexpand): No need to disable line commands.
      	(_cpp_dump_definition): No need to generate line commands.
      	(dump_hash_helper): Remove excess newline from output.
      	* cppinit.c (dump_special_to_buffer): No need to generate line
      	commands.
      	(cpp_printer_init): New.
      	(cpp_start_read): Take a printer, and start it up if it's not
      	NULL.  No need to generate line commands.
      	(cpp_finish): Expect no buffers stacked at all.  Take a
      	printer argument, and flush the output buffer if it's not
      	NULL.
      	* cpplex.c (_cpp_lex_token): Return EOF if there's no buffer.
      	Don't put two hashes at the beginning of an assertion.
      	(cpp_get_token): Don't increment pfile->lineno or emit line
      	commands here.  Return EOF if there's no buffer when we get
      	EOF.
      	* cpplib.c (do_define, skip_if_group):
      	No need to disable line commands.
      	(_cpp_output_line_command): Delete function.
      	(do_line): Don't emit line commands here, but set things up so
      	they will be emitted if necessary.  Use _cpp_fake_ihash to
      	make unique nominal_fnames if necessary.
      	(do_elif, do_else, _cpp_handle_eof): Call cpp_error_with_line
      	with 0 for column, not -1.
      	(_cpp_handle_eof): Don't set the control macro here.  Don't
      	clear input_stack_listing_current here.  Don't emit line
      	commands.
      
      From-SVN: r33159
      Zack Weinberg committed
  26. 11 Apr, 2000 1 commit
    • cppexp.c, [...]: Replace cpp_token with cpp_ttype everywhere. · 3a2b2c7a
      	* cppexp.c, cpphash.c, cpphash.h, cpplex.c, cpplib.c,
      	cpplib.h, cppmain.c, fix-header.c, scan-decls.c: Replace
      	cpp_token with cpp_ttype everywhere.
      	* cpperror.c, cpphash.c, cpplex.c, cpplib.c, scan-decls.c:
      	Replace cpp_buf_line_and_col with CPP_BUF_LINE and/or
      	CPP_BUF_COL.  Line and column numbers are unsigned int, not
      	long.
      	* cpplex.c (cpp_buf_line_and_col): Delete.
      	* cpplib.h (struct cpp_buffer, struct cpp_reader): Change
      	'long lineno' to 'unsigned int lineno'.
      	(CPP_BUF_LINE, CPP_BUF_COL): New macros.
      
      From-SVN: r33076
      Zack Weinberg committed
  27. 31 Mar, 2000 1 commit
    • cpplib.h: Merge struct cpp_options into struct cpp_reader. · ae79697b
      	* cpplib.h: Merge struct cpp_options into struct cpp_reader.
      	Reorder struct cpp_options and struct cpp_reader for better
      	packing.  Replace CPP_OPTIONS macro with CPP_OPTION which
      	takes two args.  Change all 'char' flags to 'unsigned char'.
      	Move show_column flag into struct cpp_options.  Don't
      	prototype cpp_options_init.
      	* cpphash.h, cpperror.c, cppexp.c, cppfiles.c, cpphash.c,
      	cppinit.c, cpplex.c, cpplib.c:
      	Replace CPP_OPTIONS (pfile)->whatever with
      	CPP_OPTION (pfile, whatever), and likewise for
      	opts = CPP_OPTIONS (pfile); ... opts->whatever;
      
      	* cppinit.c (merge_include_chains): Take a cpp_reader *.
      	Extract CPP_OPTION (pfile, pending) and work with that
      	directly.
      	(cpp_options_init): Delete.
      	(cpp_reader_init): Turn on on-by-default options here.
      	Allocate the pending structure here.
      	(cl_options, enum opt_code): Define these from the same table,
      	kept in a large macro.  Add -fshow-column and -fno-show-column
      	options.
      
      	* cpperror.c (v_message): If show_column is off, don't print
      	the column number.
      
      	* cppmain.c: Update for new interface.
      	* fix-header.c: Likewise.
      
      From-SVN: r32850
      Zack Weinberg committed
  28. 08 Mar, 2000 2 commits
    • Makefile.in (LIBCPP_DEPS): New macro. · 88ae23e7
      	* Makefile.in (LIBCPP_DEPS): New macro.
      	(cpplib.o, cpphash.o, cpperror.o, cppexp.o, cppfiles.o): Use
      	it to declare deps.
      	* cpperror.c: Include cpphash.h.
      	* cppexp.c: Include cpphash.h.  Remove MULTIBYTE_CHARS
      	dingleberry.
      	(lex): Don't use CPP_WARN_UNDEF.
      	(_cpp_parse_expr): Return an int, the truth value.
      	* cppfiles.c: Include cpphash.h.
      	(_cpp_merge_include_chains): Move to cppinit.c and make static.
      	* cppinit.c (include_defaults_array): Disentangle.
      	(cpp_cleanup): Don't free the if stack here.
      	(cpp_finish): Pop off all buffers, not just one.
      	* cpplib.c (eval_if_expr): Return int.
      	(do_xifdef): Rename do_ifdef.
      	(handle_directive): Don't use CPP_PREPROCESSED.
      	(cpp_get_token): Don't use CPP_C89.
      	* fix-header.c: Don't use CPP_OPTIONS.
      
      	* cpplib.h: Move U_CHAR, enum node_type, struct
      	file_name_list, struct ihash, is_idchar, is_idstart,
      	is_numchar, is_numstart, is_hspace, is_space, CPP_BUF_PEEK,
      	CPP_BUF_GET, CPP_FORWARD, CPP_PUTS, CPP_PUTS_Q, CPP_PUTC,
      	CPP_PUTC_Q, CPP_NUL_TERMINATE, CPP_NUL_TERMINATE_Q,
      	CPP_BUMP_BUFFER_LINE, CPP_BUMP_LINE, CPP_PREV_BUFFER,
      	CPP_PRINT_DEPS, CPP_TRADITIONAL, CPP_PEDANTIC, and prototypes
      	of _cpp_simplify_pathname, _cpp_find_include_file,
      	_cpp_read_include_file, and _cpp_parse_expr to cpphash.h.
      	Move struct if_stack to cpplib.c.  Move struct cpp_pending to
      	cppinit.c.
      	Change all uses of U_CHAR to be unsigned char instead.
      	Delete CPP_WARN_UNDEF, CPP_C89, and CPP_PREPROCESSED.
      
      From-SVN: r32435
      Zack Weinberg committed
    • cpplib.h (parse_underflow_t, [...]): Delete. · 38b24ee2
      	* cpplib.h (parse_underflow_t, CPP_NULL_BUFFER): Delete.
      	(struct cpp_buffer): Remove fname and underflow fields.
      	(struct cpp_reader): Remove get_token field.
      	(struct include_hash): Rename to struct ihash.  Add typedef to
      	IHASH.
      	(struct if_stack): Remove fname field.
      	(IF_STACK_FRAME): Rename to IF_STACK.
      
      	* cpperror.c (print_containing_files): Trust that there are no
      	macro buffers below the top file buffer.
      	* cppfiles.c: Replace all references to 'struct include_hash'
      	with 'IHASH'.  Rename initialize_input_buffer to
      	init_input_buffer.  Don't set or reference cpp_buffer->fname,
      	use buffer->ihash->name instead.
      	* cpphash.c (special_symbol): Use cpp_file_buffer.  Use NULL
      	not CPP_NULL_BUFFER.
      	* cppinit.c: Use NULL not CPP_NULL_BUFFER, IF_STACK not
      	IF_STACK_FRAME, IHASH not struct include_hash.
      	* cpplib.c: Rename eval_if_expression to eval_if_expr.  Remove
      	null_underflow.  Use IF_STACK not IF_STACK_FRAME, IHASH not
      	struct include_hash, NULL not CPP_NULL_BUFFER.  Remove all
      	references to cpp_buffer->fname (delete entirely, or use
      	->ihash->name instead) and IF_STACK->fname.
      	(cpp_push_buffer): Don't set new->underflow.
      	(do_include): Use cpp_file_buffer.
      
      	* cpphash.c (collect_formal_parameters): Remove duplicate
      	increment of argslen.  Pedwarn in C99 mode if __VA_ARGS__ is
      	used as a macro argument name.  Don't append "..." to namebuf
      	for varargs macros.  After we're done scanning, go through
      	namebuf and make it NUL separated, not comma separated.
      	(_cpp_compare_defs): Remove register tag from variables.
      	Expect defn->argnames to be NUL separated.
      	(_cpp_dump_definition): Expect defn->argnames to be NUL
      	separated and in forward order.
      	* cpphash.h: Update documentation of argnames field.
      
      From-SVN: r32430
      Zack Weinberg committed
  29. 07 Mar, 2000 1 commit
    • cppfiles.c (_cpp_find_include_file): Make sure ih->name is initialized. · b0699dad
      	* cppfiles.c (_cpp_find_include_file): Make sure ih->name is
      	initialized.
      	* cppinit.c (cpp_cleanup): Free imp->nshort also.
      
      	* cpperror.c (cpp_print_containing_files,
      	cpp_print_file_and_line, v_cpp_message): Rename to
      	print_containing_files, print_file_and_line, and v_message.
      	* cppexp.c (cpp_parse_expr, cpp_parse_escape, cpp_lex): Rename
      	to _cpp_parse_expr, parse_escape, and lex.
      	(parse_charconst): Remove broken multibyte support.
      	* cppfiles.c (include_hash): Make static.
      	(cpp_included): New function.
      	(merge_include_chains, find_include_file, finclude,
      	simplify_pathname): Rename to _cpp_merge_include_chains,
      	_cpp_find_include_file, _cpp_read_include_file, and
      	_cpp_simplify_pathname.
      	* cpphash.c (cpp_lookup, free_definition, delete_macro,
      	cpp_install, create_definition, macroexpand, compare_defs,
      	dump_definition): Rename to _cpp_lookup, _cpp_free_definition,
      	_cpp_delete_macro, _cpp_install, _cpp_create_definition,
      	_cpp_macroexpand, _cpp_compare_defs, and _cpp_dump_definition.
      	* cppinit.c (cpp_handle_option): Rename to handle_option, make
      	static.
      	* cpplib.c: Remove extern prototype of cpp_parse_expr.
      
      	* cpphash.h: Update prototypes.
      	* cpplib.h: Likewise.  Prototype _cpp_parse_expr here.
      
      From-SVN: r32390
      Zack Weinberg committed
  30. 27 Feb, 2000 1 commit
    • Makefile.in (STMP_FIXINC): New toggle. · f95e46b9
      	* Makefile.in (STMP_FIXINC): New toggle.
      	(LIBGCC2_DEPS): Delete all references.
      	(stmp-headers): Delete target.  All references either deleted
      	or changed to stmp-int-headers.
      	(all.cross): Don't depend on stmp-headers or STMP_FIXPROTO.
      	(LIBCPP_OBJS): Take out cppalloc.o.
      	(cppalloc.o): Delete target.
      	(stmp-int-hdrs): Depend on $(STMP_FIXINC).
      	(gen-protos, fix-header): Link with libiberty.a.
      	* build-make: Don't change FIXINCLUDES.  Override STMP_FIXINC
      	to empty.
      	* cp/Make-lang.in: Delete refs to LIBGCC2_DEPS.
      
      	* configure.in: Remove refs to strerror.
      	* acconfig.h: Take out NEED_DECLARATION_STRERROR.
      	* system.h: Take out strerror stanza.
      
      	* cpperror.c (my_strerror): Delete function.
      	(cpp_error_from_errno, cpp_notice_from_errno): Use xstrerror.
      	* cppmain.c (main): Call xmalloc_set_program_name first thing.
      	* cppalloc.c: Delete file.
      	* gen-protos.c: Don't provide xrealloc.
      
      	* fixinc/fixincl.c, fixinc/fixlib.c, fixinc/procopen.c: Use
      	xstrerror throughout.
      
      From-SVN: r32200
      Zack Weinberg committed
  31. 26 Feb, 2000 1 commit
  32. 06 Feb, 2000 2 commits
    • cpplib.c (my_strerror, [...]): Move to cpperror.c. · c1212d2f
      	* cpplib.c (my_strerror, cpp_error, cpp_error_with_line,
      	cpp_error_from_errno, cpp_warning, cpp_warning_with_line,
      	cpp_pedwarn, cpp_pedwarn_with_line,
      	cpp_pedwarn_with_file_and_line): Move to cpperror.c.
      	(cpp_print_file_and_line, v_cpp_error, v_cpp_warning,
      	v_cpp_error_with_line, v_cpp_warning_with_line,
      	cpp_message_from_errno, cpp_perror_with_name): Delete.
      
      	* cpperror.c (cpp_print_containing_files): Take starting
      	buffer as argument.
      	(cpp_file_line_for_message): Rename to cpp_print_file_and_line.
      	(v_cpp_message): Now called directly by all entry points.
      	Remove -1 case.
      	(cpp_pfatal_with_name, cpp_message): Delete.
      	(cpp_notice_from_errno, cpp_ice): New functions.
      	(cpp_notice): Is now for reporting error conditions, just
      	without an associated file.
      	(cpp_error, cpp_error_with_line): Don't do anything if
      	opts->inhibit_errors is on.
      	(cpp_pedwarn_with_file_and_line): Take column argument also.
      
      	* cpplib.h: Update prototypes of exported functions.
      	(struct cpp_options): Add inhibit_errors.
      
      	* cppalloc.c, cppfiles.c: Use fprintf not cpp_notice for
      	non-error messages.  Include intl.h.
      
      	* cppinit.c, cppmain.c: Likewise.  Also, use
      	cpp_notice_from_errno instead of cpp_perror_with_name or
      	cpp_pfatal_with_name, and cpp_notice instead of cpp_message.
      
      	* cppexp.c, cpphash.c, cppinit.c, cpplib.c: Use cpp_ice to
      	report internal errors.
      
      	* cpplib.c (do_define): Switch bcopy to memcpy.
      	Give cpp_pedwarn_with_file_and_line a dummy column argument.
      
      From-SVN: r31829
      Zack Weinberg committed
    • cpperror.c: Remove #ifdef EMACS block. · 40ea76de
      	* cpperror.c: Remove #ifdef EMACS block.
      	* cppmain.c: Likewise.
      	* cpphash.c: Remove #if 0 blocks.
      	* cppinit.c: Remove #if 0 blocks, and the -lint option.
      	* cpplib.c: Remove #if 0 blocks and code referencing
      	pcp_inside_if or for_lint.  Remove duplicate error message.
      	Fix error messages for #else after #else or #elif.  Reformat.
      	Remove archaic TODO list.
      	* cpplib.h: Remove pcp_inside_if and for_lint flags.
      
      From-SVN: r31817
      Zack Weinberg committed
  33. 30 Jan, 2000 1 commit
  34. 19 Jan, 2000 2 commits
  35. 11 Sep, 1999 1 commit
    • cppalloc.c (xstrdup): Use memcpy. · 6ee2c979
      1999-09-10 22:37 -0700  Zack Weinberg  <zack@bitmover.com>
      
      	* cppalloc.c (xstrdup): Use memcpy.
      	* cpperror.c (cpp_print_containing_files): Don't use
      	cpp_notice.
      	* cpplib.c (conditional_skip): Set temp->lineno.
      	(do_endif): Make error message less obscure.
      	(if_directive_name): New function.
      	(cpp_get_token [case EOF]): Unwind the if stack and generate
      	error messages for each unterminated conditional in this file.
      	(parse_string):  Do not behave differently if -traditional.
      
      From-SVN: r29279
      Zack Weinberg committed
  36. 07 Sep, 1999 1 commit
    • cpperror.c (cpp_file_line_for_message): Constify a char*. · bcc5cac9
      	* cpperror.c (cpp_file_line_for_message): Constify a char*.
      
      	* cppexp.c (parse_number, parse_charconst, cpp_lex,
      	cpp_parse_expr): Add static prototypes.
      	(parse_charconst): Don't cast away const-ness.
      	(token): Constify a char*.
      
      	* cppfiles.c (file_name_list, include_hash, find_include_file,
      	finclude, initialize_input_buffer): Constify a char*.
      	(file_cleanup, find_position): Add static prototypes.
      
      	* cpphash.c (macro_cleanup, macarg, timestamp, special_symbol,
      	collect_expansion): Add static prototypes.
      	(cpp_install, create_definition, monthnames): Constify a char*.
      
      	* cpphash.h (cpp_install): Likewise.
      
      	* cppinit.c (known_suffixes, default_include,
      	dump_special_to_buffer, NAME, cpp_start_read, cpp_finish): Likewise.
      	(base_name, dump_special_to_buffer, initialize_dependency_output):
      	Add static prototypes.
      
      	* cpplib.c (my_strerror): Constify a char*.
      	(null_underflow, null_cleanup, skip_comment, copy_comment,
      	copy_rest_of_line, handle_directive, pass_thru_directive,
      	get_directive_token, read_line_number, cpp_print_file_and_line,
      	v_cpp_error, v_cpp_warning, v_cpp_error_with_line,
      	v_cpp_warning_with_line, detect_if_not_defined,
      	consider_directive_while_skipping): Add static prototypes.
      	(pass_thru_directive, check_macro_name, cpp_expand_to_buffer,
      	cpp_pedwarn_with_file_and_line): Constify a char*.
      
      	* cpplib.h (cpp_options, include_hash, progname, definition,
      	cpp_pedwarn_with_file_and_line, cpp_expand_to_buffer,
      	check_macro_name, cpp_pfatal_with_name, cpp_file_line_for_message,
      	find_include_file, deps_output, include_hash): Constify a char*.
      
      	* cppmain.c (progname): Constify.
      	(main): Add prototype.  Use return, not exit.
      
      	* fix-header.c (fatal, add_symbols, lookup_std_proto, write_lbrac,
      	recognized_macro, check_macro_names, read_scan_file, write_rbrac,
      	inf_skip_spaces, inf_read_upto, inf_scan_ident, inf_scan_ident,
      	check_protection): Add static prototype.
      	(xfree): Remove.
      	(progname, recognized_macrom, recognized_extern): Constify a char*.
      	(main): Add prototype.
      
      	* gen-protos.c (progname): Constify a char*.
      
      From-SVN: r29171
      Kaveh R. Ghazi committed