summaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
Commit message (Collapse)AuthorAgeFilesLines
* * cppmacro.c (paste_tokens): Only allow / to paste with =.neil2002-10-091-2/+1
| | | | | | | | testsuite: * gcc.dg/cpp/paste13.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57978 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-09-27 Alexander N. Kabaev <ak03@gte.com>zack2002-09-281-0/+6
| | | | | | | | | | | PR preprocessor/8055 * cppmacro.c (stringify_arg): Do not overflow the buffer with the terminating NUL when the argument to be stringified has no tokens. * testsuite/gcc.dg/cpp/20020927-1.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57599 138bc75d-0d04-0410-961f-82ee72b054a4
* * ChangeLog: Follow spelling conventions.kazu2002-09-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57398 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c: Don't warn about function-like macros withoutneil2002-09-201-0/+7
| | | | | | | | | '(' during pre-expandion. testsuite: * gcc.dg/cpp/tr-warn2.c: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57366 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (_cpp_builtin_macro_text): Remove unused variable.neil2002-08-071-1/+0
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56109 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppinit.c (struct lang_flags): Rename trigraphs std.neil2002-08-061-8/+18
| | | | | | | | | | | | | | | (set_lang): Update. * cpplib.h (struct cpp_options): New member std. * cppmacro.c (_cpp_builtin_macro_text): Use std. (collect_args): Flag whether to swallow a possible future comma pasted with varargs. (replace_args): Use this flag. * doc/cpp.texi: Update varargs extension documentation. testsuite: * gcc.dg/cpp/vararg3.c, gcc.dg/cpp/vararg4.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56077 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-common.c (c_common_init): -Wtraditional also implies -Wlong-long.zack2002-08-021-11/+31
| | | | | | | | | | | | | | | | | | * cppinit.c (cpp_post_options): Likewise. * cppexp.c (cpp_classify_number): Suppress -Wtraditional warning about 'LL' suffix (but not 'ULL' etc) when -Wno-long-long is in effect. * cppmacro.c (_cpp_builtin_macro_text) [BT_TIME, BT_DATE]: Check for failing time()/localtime(), issue a warning, and make __TIME__ and __DATE__ expand to fallback strings. * doc/cpp.texi, doc/extend.texi: Document behavior of __DATE__ and __TIME__ when the date and time cannot be determined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55969 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (_cpp_create_definition): Don't attempt redefinitionneil2002-07-261-2/+4
| | | | | | | warnings on assertions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55778 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppexp.c (parse_defined): Mark macro used.neil2002-07-231-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55692 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppexp.c (cpp_interpret_integer, append_digit, parse_defined,neil2002-07-171-12/+13
| | | | | | | | | | eval_token): Clarify and correct use of "bool" variables. * cpplib.h (struct cpp_options): Similarly. * cppmacro.c (parse_params, _cpp_save_parameter): Ditto. * cpptrad.c (recursive_macro): Similarly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55536 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c: Forgotten commit.neil2002-07-011-2/+6
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55134 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h (struct cpp_reader): Make date and time strings.neil2002-06-191-64/+87
| | | | | | | | | | | | | | | | | | | | | | | | (_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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54771 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpplib.c (end_directive): Handle line skipping. Only removeneil2002-06-131-0/+1
| | | | | | | | | | | | | | | the rest of the line if the directive was valid. * cppmacro.c (_cpp_push_text_context): Set NODE_DISABLED when expanding a traditional macro. * cpptrad.c (recursive_macro): New. (read_logical_line_trad): Handle skipping. (scan_out_logical_line): Continue after a successful directive. Don't expand macros whilst skipping, or if recursing. (_cpp_create_trad_definition): scan_out_logical_line now sets the output current position. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54573 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h (struct cpp_macro): Put comments on their own lines.neil2002-06-101-7/+8
| | | | | | | | | | | | (_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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54432 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h (_cpp_push_text_context): Update.neil2002-06-091-41/+57
| | | | | | | | | | | | | | | | | | | | (_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 '('. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54412 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpptrad.c (struct block, BLOCK_HEADER_LEN, BLOCK_LEN,neil2002-06-071-5/+5
| | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54331 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h (_cpp_create_definition): Update prototype.neil2002-06-051-59/+93
| | | | | | | | | | | | | | | | | | | | | | | (_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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54293 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h (FIRST, LAST, CUR, RLIMIT): New.neil2002-06-041-11/+11
| | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54242 138bc75d-0d04-0410-961f-82ee72b054a4
* PR preprocessor/6844neil2002-05-291-1/+1
| | | | | | | | * cppmacro.c (cpp_macro_definition): Reserve space for terminating NUL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54014 138bc75d-0d04-0410-961f-82ee72b054a4
* PR preprocessor/6780neil2002-05-241-0/+2
| | | | | | | | | * cppmacro.c (enter_macro_context): Clear state.angled_headers. testsuite: * gcc.dg/cpp/paste12.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53851 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpperror.c: Fix formatting.kazu2002-05-221-6/+6
| | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53751 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-common.c (c_common_init): Set options->unsigned_char fromzack2002-05-211-3/+6
| | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53703 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-common.c (STDC_0_IN_SYSTEM_HEADERS, REGISTER_PREFIX):zack2002-05-161-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default-define here. (builtin_define_with_value): Can now wrap the expansion in quotation marks if such is wanted. (cb_register_builtins): Update calls to builtin_define_with_value. Define __REGISTER_PREFIX__, __USER_LABEL_PREFIX__, and __VERSION__ here. (c_common_init): Set options->stdc_0_in_system_headers. * c-lex.h: Update prototype of builtin_define_with_value. * cppdefault.h: Remove default definitions of USER_LABEL_PREFIX and REGISTER_PREFIX. * cppinit.c (VERS, ULP, C, X): Kill. (builtin_array): Remove entries for __VERSION__, __USER_LABEL_PREFIX__, __REGISTER_PREFIX__, and __HAVE_BUILTIN_SETJMP__. Make __STDC__ always a builtin, not a constant. (init_builtins): Kill off a bunch of now-dead code. (COMMAND_LINE_OPTIONS): Remove -fleading-underscore and -fno-leading-underscore. (cpp_handle_option): Remove code to set user_label_prefix. (cpp_post_options): Likewise. * cpplib.h (struct cpp_options): Remove user_label_prefix. (stdc_0_in_system_headers): New. * cppmacro.c (builtin_macro): Check CPP_OPTION (pfile, stdc_0_in_system_headers) too to decide the value of __STDC__. * tradcpp.c (user_label_prefix): Kill. (main): Remove code handling -f(no-)leading-underscore. (initialize_builtins): Don't define __REGISTER_PREFIX__ or __USER_LABEL_PREFIX__. (install_value): Wrap compound statement in dummy loop so the macro works properly in an if statement. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53525 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h (cpp_macro): Move here, and make expansion a union.neil2002-05-161-27/+15
| | | | | | | | | * cppmacro.c (cpp_macro): Remove. (enter_macro_context, replace_args, warn_of_redefinition, _cpp_create_definition, cpp_macro_definition): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53509 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpplib.c (cpp_init_internal_pragmas): Remove #pragma poison.neil2002-05-091-2/+2
| | | | | | | | | | | | | * cppmacro.c (paste_all_tokens): Bad pastes are a hard error. doc: * cpp.texi: Update for removal of obsolete features. testsuite: * gcc.dg/cpp/poison.c: Update. * gcc.dg/cpp/20000625-2.c: Remove. * gcc.dg/cpp/direct2s.c: Remove final test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53333 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppfiles.c (_cpp_pop_file_buffer): Return void. Moveneil2002-04-221-2/+6
| | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52621 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppexp.c (struct op, parse_number): Replace U_CHAR with uchar.neil2002-04-211-10/+10
| | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52587 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (funlike_invocation_p): Don't step back over CPP_EOF.neil2002-04-211-6/+11
| | | | | | | | testsuite: * gcc.dg/cpp/endif.h, gcc.dg/cpp/endif.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52586 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpperror.c (print_location): Don't print include chainneil2002-04-141-28/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52302 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppinit.c (cpp_create_reader): Initializethorpej2002-04-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | discard_comments_in_macro_exp. (COMMAND_LINE_OPTIONS): Add "-CC" option. (cpp_handle_option): Handle "-CC" option. * cpplex.c (save_comment): If saving a C++ comment in a directive, convert it to a C comment. (_cpp_lex_direct): Pass second comment start character to save_comment to indicate comment type. * cpplib.c (_cpp_handle_directive): If processing a "#define" directive and discard_comments_in_macro_exp is false, re-enable saving of comments. (lex_macro_node): If discard_comments_in_macro_exp is false, discard any comments before the macro identifier. * cpplib.h (struct cpp_options): Add discard_comments_in_macro_exp member. * cppmacro.c (cpp_get_token): If expanding a macro while processing a directive, discard any comments we might encounter. (parse_params): If discard_comments_in_macro_exp is false, ignore comments in the macro parameter list. * gcc.c (cpp_unique_options): Add "-CC" option. (option_map): Map "--comments-in-macros" to "-CC". * doc/cppopts.texi: Document "-CC" option. * f/lang-specs.h: Add "-CC" option. * testsuite/gcc.dg/cpp/maccom1.c: New test. * testsuite/gcc.dg/cpp/maccom2.c: New test. * testsuite/gcc.dg/cpp/maccom3.c: New test. * testsuite/gcc.dg/cpp/maccom4.c: New test. * testsuite/gcc.dg/cpp/maccom5.c: New test. * testsuite/gcc.dg/cpp/maccom6.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51975 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (cpp_macro_definition): Do not emit spaces afterjimb2002-04-051-4/+7
| | | | | | | macro formal parameter names. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51890 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (cpp_macro_definition): Emit a space after the macrojimb2002-03-191-1/+4
| | | | | | | | name, even if the replacement list contains no tokens, as required by Dwarf. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51045 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h (struct lexer_state): Remove line_extension member.zack2002-03-141-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50779 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-common.c, c-common.h, c-decl.c, c-lex.c, c-parse.in,zack2002-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c-tree.h, c-typeck.c, cppexp.c, cpplex.c, cpplib.c, cpplib.h, cppmacro.c, objc/lang-specs.h, objc/objc-act.c, builtin-types.def, builtins.def, dwarf2out.c, dwarfout.c, gcc.c, toplev.c: Delete code implementing -traditional mode. * ada/misc.c, ch/ch-tree.h, ch/decl.c, cp/decl2.c, f/com.c, f/lex.c, f/top.c, java/builtins.c, java/decl.c: Delete traditional-mode-related code copied from the C front end but not used, or used only to permit the compiler to link. * doc/bugreport.texi, doc/cpp.texi, doc/extend.texi, doc/invoke.texi, doc/standards.texi, doc/trouble.texi: Document removal of -traditional mode for compilation, and remove documentation only relevant to that mode. * config/nextstep.h, config/ptx4.h, config/svr4.h, config/convex/convex.h, config/d30v/d30v.h, config/i386/dgux.h, config/i386/osf1elf.h, config/i386/osfelf.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/sol2.h, config/m68k/a-ux.h, config/m68k/hp310.h, config/m88k/dgux.h, config/m88k/dguxbcs.h, config/m88k/luna.h, config/m88k/m88k.c, config/m88k/m88k.h, config/m88k/openbsd.h, config/mips/abi64.h, config/mips/osfrose.h, config/mips/svr4-5.h, config/mips/svr4-t.h, config/sparc/sol2-sld-64.h, config/sparc/sol2.h, config/stormy16/stormy16.h: Remove all references to -traditional from target specs. Delete all mention of the no-longer-necessary TRADITIONAL_RETURN_FLOAT macro. Also delete a couple of commented-out definitions of DOLLARS_IN_IDENTIFIERS, with (incorrect) commentary referring to -traditional. * system.h: Poison TRADITIONAL_RETURN_FLOAT. * doc/tm.texi: Remove mention of TRADITIONAL_RETURN_FLOAT macro. * testsuite/gcc.c-torture/execute/920730-1t.c, testsuite/gcc.c-torture/execute/920730-1t.x, testsuite/gcc.dg/ext-glob.c: Delete test cases, only relevant to -traditional. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50110 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpplex.c (_cpp_lex_token): Handle directives in macroneil2002-02-271-28/+9
| | | | | | | | | | | | | | | | | | | arguments. * cpplib.c (_cpp_handle_directive): Save and restore state if parsing macro args when entering a directive. * cppmacro.c (collect_args): No need to handle directives in macro arguments. (enter_macro_context, replace_args): Use the original macro definition in case it was redefined whilst collecting arguments. doc: * cpp.texi: Update. testsuite: * gcc.dg/cpp/undef1.c: Remove. * gcc.dg/cpp/directiv.c: Update. * gcc.dg/cpp/mac-dir-1.c, mac-dir-2.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50091 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpperror.c: Update comments and copyright.neil2002-01-031-1/+1
| | | | | | | | * cppexp.c, cppfiles.c, cpphash.c, cpphash.h, cppinit.c, cpplex.c, cpplib.c, cpplib.h, cppmacro.c, cppmain.c: Similarly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48522 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c: Don't include intl.h. Update comments.neil2002-01-031-38/+54
| | | | | | | | | (new_number_token): Allocate enough buffer for 64-bit unsigned integers; update prototype. * cppmain.c: Update comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48518 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-typeck.c, config/i386/i386.h, config/mcore/mcore.h,jsm282001-12-151-1/+1
| | | | | | | | | | | | | config/ns32k/ns32k.h, config/rs6000/sysv4.h, fold-const.c, toplev.c, cppinit.c, cppmacro.c, gcc.c: Use "built-in" and "bit-field" spellings in messages. * po/gcc.pot: Regenerate. ch: * expr.c: Use "built-in" spelling in messages. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48048 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-decl.c (duplicate_decls, parmlist_tags_warning): Removeneil2001-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | trailing period from diagnostics. * c-lex.c (cb_file_change): Similarly. * cppmacro.c (check_trad_stringification): Similarly. * gcc.c (do_spec_1): Similarly. * genattr.c (main): Similarly. * genattrtab.c (main, operate_exp, make_length_attrs): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * mips-tfile.c (add_file, error): Similarly. * profile.c (init_branch_prob): Similarly. * reload1.c (spill_failure): Similarly. * stmt.c (parse_output_constraint): Similarly. * varasm.c (assemble_variable): Similarly. cp: * class.c (finish_struct): Similarly. * decl.c (check_tag_decl): Similarly. * lex.c (cxx_set_yydebug): Similarly. * typeck2.c (friendly_abort): Similarly. java: * expr.c (expand_byte_code): Similarly. * jcf-parse.c (load_class, jcf_parse): Similarly. * jcf-write.c (generate_classfile): Similarly. * lex.c (java_lex): Similarly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47517 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppfiles.c (stack_include_file): Don't optimize zero-lengthneil2001-11-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | files. (read_include_file): NUL-terminate read files. * cpplex.c (handle_newline, skip_escaped_newlines, get_effective_char, skip_whitespace, parse_identifier, parse_identifier_slow, parse_number, parse_string, _cpp_lex_direct): Optimize for the fact that buffers are guaranteed NUL-terminated. * cpplib.c (destringize_and_run, cpp_define, handle_assertion): Be sure buffers are NUL terminated. * cppmacro.c (warn_of_redefinition): Kill compile warning. * c-common.c: Include tree-inline.h. (c_language): Move separate definitions here. (c_common_init_options, c_common_post_options): New. (c_common_lang_init): Rename c_common_init. * c-common.h (c_common_lang_init): Similarly. (c_common_init_options, c_common_post_options): New. * c-lang.c (c_post_options): Move body to c_common_post_options. (c_init_options): Use c_common_init_options. (c_init): Update. * langhooks.def: Rearrange. * langhooks.h: Rearrange, and improve comments. * toplev.c (do_compile): New function. (toplev_main): Use it. (lang_independent_f_options, parse_options_and_default_flags, process_options): Remove trailing periods. * Makefile.in: Update. cp: * decl2.c (c_language): Move to c-common.c. * lex.c (cxx_post_options, cxx_init_options): Use c-common.c functions. (cxx_init): Update. objc: * objc-act.c (objc_post_options, objc_init_options): Use c-common.c functions. (ojbc_init): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47362 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (warn_of_redefinition): Warn regardless of -pedantic.neil2001-11-231-3/+0
| | | | | | | * gcc.dg/cpp/mi6.c, gcc.dg/cpp/redef2.c: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47282 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (_cpp_backup_tokens): Revert previous check-in.neil2001-11-191-2/+4
| | | | | | | | Don't fall off the base token run. * gcc.dg/cpp/fpreprocessed.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47182 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (_cpp_backup_tokens): Pop cur_run before decrementingjason2001-11-191-1/+1
| | | | | | | | | | | | | cur_token, not after. * config/clipper/clix.h, config/h8300/elf.h, config/mips/linux.h: Lose ASM_OUTPUT_CONSTRUCTOR. * system.h: Poison it and INT_ASM_OP. * c-lang.c (finish_file): Don't check for it. * libgcc2.c (L_ctors): Check TARGET_ASM_CONSTRUCTOR instead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47169 138bc75d-0d04-0410-961f-82ee72b054a4
* * ChangeLog.2, ChangeLog.4, ChangeLog.5, ChangeLog,jsm282001-11-041-1/+1
| | | | | | | | | | | | | | | | | FSFChangeLog.10, FSFChangeLog.11, alias.c, attribs.c, caller-save.c, calls.c, cfg.c, cfganal.c, cfgcleanup.c, cfgrtl.c, cppmacro.c, fold-const.c, ifcvt.c, local-alloc.c, profile.c, sched-int.h, toplev.c, config/alpha/alpha.c, config/alpha/alpha.md, config/c4x/c4x.h, config/cris/cris.h, config/cris/cris.md, config/i370/i370.md, config/i386/i386.c, config/i386/i386.h, config/i386/i386.md, config/i386/xm-djgpp.h, config/ia64/ia64.c, config/m68hc11/m68hc11.c, config/m68k/m68k.md, config/mcore/mcore.h, config/mmix/mmix.c, config/ns32k/ns32k.h, config/ns32k/ns32k.md, config/rs6000/rs6000.c, config/rs6000/sysv4.h, config/sh/sh.md: Fix spelling errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46760 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h (struct cpp_buffer): Delete read_ahead and extra_char.neil2001-10-211-2/+1
| | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46392 138bc75d-0d04-0410-961f-82ee72b054a4
* * calls.c: Fix formatting.kazu2001-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * c-decl.c: Likewise. * cfgcleanup.c: Likewise. * combine.c: Likewise. * cppfiles.c: Likewise. * cpplib.c: Likewise. * cppmacro.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * dwarf2out.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genattrtab.c: Likewise. * ggc-page.c: Likewise. * integrate.c: Likewise. * libgcc2.c: Likewise. * loop.c: Likewise. * optabs.c: Likewise. * profile.c: Likewise. * protoize.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reload1.c: Likewise. * reload.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * stmt.c: Likewise. * toplev.c: Likewise. * varasm.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46145 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (_cpp_create_definition): Leave comments off.neil2001-10-081-1/+0
| | | | | | | * doc/cpp.texi: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46089 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppmacro.c (funlike_invocation_p): Move some logic to callerneil2001-10-081-32/+51
| | | | | | | | | | | in enter_macro_context. Create a padding token in its own context if necessary when the search for '(' fails. (enter_macro_context): Update. * gcc.dg/cpp/spacing1.c: Update test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46070 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h: Update comments.neil2001-10-021-62/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45948 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpphash.h (POOL_ALIGN, POOL_FRONT, POOL_LIMIT, POOL_BASE,neil2001-09-301-43/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45899 138bc75d-0d04-0410-961f-82ee72b054a4