aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
AgeCommit message (Collapse)AuthorFilesLines
2003-10-02cppinit.c (cpp_read_main_file): Split into two functions: Distribute ↵Per Bothner1-7/+15
_cpp_stack_file call over the two functions. * cppinit.c (cpp_read_main_file): Split into two functions: Distribute _cpp_stack_file call over the two functions. (cpp_find_main_file): New function. Don't call _cpp_do_file_change even if working_directory flag set. (cpp_push_main_file): New function. * cppfiles.c (_cpp_find_failed): New helper function. (find_file): Made non-static and renamed to _cpp_find_file. (_cpp_stack_file): No longer needed. But note the following. (stack_file): Made non-static and renamed to _cpp_stack_file. * fix-header.c (cpp_read_main_file): Replace cpp_read_main_file call with calls to cpp_find_main_file and cpp_push_main_file. (search_path_head): If there is no current buffer, use main_file. * cpphash.h: Update function declarations. * cpplib.h: Update function declarations. From-SVN: r72014
2003-08-26Copy over from cs branch:Per Bothner1-3/+3
* cpplib.h (struct cpp_token): Change type of field line to fileline. (cpp_error_with_line): Use fileline for appropriate parameter. * cpphash.h (struct cpp_macro): Change type of field line to fileline. (struct cpp_reader): Likewise for fields line and directive_line. (_cpp_begin_message): Use fileline for appropriate parameter. * cpperror.c (print_location, _cpp_begin_message, cpp_error_with_line, cpp_error): Use fileline for appropriate parameters and variables. (print_location): New local lin, since it is not a fileline. From-SVN: r70826
2003-08-19c-common.c: Fix comment formatting.Kazu Hirata1-1/+1
* c-common.c: Fix comment formatting. * c-common.h: Likewise. * c-decl.c: Likewise. * cppinit.c: Likewise. * cpplib.h: Likewise. * emit-rtl.c: Likewise. * input.h: Likewise. * line-map.h: Likewise. * opts.c: Likewise. * opts.h: Likewise. * simplify-rtx.c: Likewise. From-SVN: r70577
2003-08-09cppinit.c (cpp_read_main_file): Split out source-independent initialization ↵Per Bothner1-4/+4
to separate function ... * cppinit.c (cpp_read_main_file): Split out source-independent initialization to separate function ... (cpp_post_options): New function. * cppfiles.c (cpp_stack_file): Rename public name to ... (_cpp_stack_file): New internal function name. * cpplib.h: Update accordingly. * cppinit.c: (cpp_create_reader): Initialize cpp_readers line here. (cpp_read_main_file): Don't initialize line here. * c-opts.c (c_common_post_options): Call cpp_post_options. (c_common_parse_file): Call cpp_read_main_file, not cpp_stack_file. * fix-header.c (read_scan_file): Call cpp_post_options. From-SVN: r70279
2003-08-05c.opt: Introduce -fworking-directory.Alexandre Oliva1-0/+6
* c.opt: Introduce -fworking-directory. * doc/cpp.texi, doc/invoke.texi, doc/cppopts.texi: Document it. * c-common.h (flag_working_directory): Declare. * c-common.c (flag_working_directory): Define. * c-opts.c (c_common_handle_options): Set it. (sanitize_cpp_opts): Set... * cpplib.h (struct cpp_options): ... working_directory option. (struct cpp_callbacks): Add dir_change. * cppinit.c (read_original_filename): Call... (read_original_directory): New. Look for # 1 "directory//" and process it. (cpp_read_main_file): Call dir_change callback if working_directory option is set. * gcc.c (cpp_unique_options): Pass -g*. * c-lex.c (cb_dir_change): New. (init_c_lex): Set dir_change callback. * toplev.c (src_pwd): New static variable. (set_src_pwd, get_src_pwd): New functions. * toplev.h (get_src_pwd, set_src_pwd): Declare. * dbxout.c (dbxout_init): Call get_src_pwd() instead of getpwd(). * dwarf2out.c (gen_compile_unit_die): Likewise. * dwarfout.c (output_compile_unit_die, dwarfout_init): Likewise. From-SVN: r70189
2003-08-01Makefile.in: Refine dependencies.Neil Booth1-4/+0
* Makefile.in: Refine dependencies. * c-opts.c (c_common_handle_option): Do nothing for -Wimport. * c.opt: Update help for -Wimport. * cppfiles.c: Include hashtab.h. Update comments. (stack_file): Read the file before updating dependencies. (once_only_file_p): Be smarter about marking once-only files. (_cpp_mark_file_once_only): Correct the check for existence on the list. (open_file_failed): Use name not path, which is NULL. * cpphash.h: Don't include hashtab.h. (struct _cpp_file): Remove. (struct cpp_reader): Update. * cppinit.c (cpp_create_reader): Don't initialize warn_import. * cpplib.h (struct cpp_options): Remove warn_import. (cpp_simplify_path): Remove. From-SVN: r70045
2003-07-29Makefile.in (LIBCPP_DEPS): Add HASHTAB_H.Neil Booth1-17/+12
* Makefile.in (LIBCPP_DEPS): Add HASHTAB_H. * cppfiles.c: Completely rewritten. * c-incpath.c (free_path, remove_duplicates, heads, tails, add_path): struct cpp_path is now struct cpp_dir. (remove_duplicates): Don't simplify path names. * c-opts.c (c_common_parse_file): cpp_read_next_file renamed cpp_stack_file. * cpphash.h: Include hashtab.h. (_cpp_file): Declare. (struct cpp_buffer): struct include_file is now struct _cpp_file, and struct cpp_path is now struct cpp_dir. Rename members. (struct cpp_reader): Similarly. New members once_only_files, file_hash, file_hash_entries, quote_ignores_source_dir, no_search_path, saw_pragma_once. Remove all_include_files and max_include_len. Make some members bool. (_cpp_mark_only_only): Renamed from _cpp_never_reread. (_cpp_stack_file): Renamed from _cpp_read_file. (_cpp_stack_include): Renamed from _cpp_execute_include. (_cpp_init_files): Renamed from _cpp_init_includes. (_cpp_cleanup_files): Renamed from _cpp_cleanup_includes. * cppinit.c (cpp_create_reader): Initialize no_search_path. Update. (cpp_read_next_file): Rename and move to cppfiles.c. (cpp_read_main_file): Update. * cpplib.c (run_directive): Update for renamed members. (do_include_common, _cpp_pop_buffer): Update. (do_import): Undeprecate #import. (do_pragma_once): Undeprecate. Use _cpp_mark_file_once_only. * cpplib.h: Remove file_name_map_list. (cpp_options): Remove map_list. (cpp_dir): Rename from cpp_path. New datatype for name_map. (cpp_set_include_chains, cpp_stack_file, cpp_included): Update. testsuite: * gcc.dg/cpp/include2.c: Only expect one message. From-SVN: r69942
2003-07-13Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H).Zack Weinberg1-10/+10
* Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H). (hashtable.o, line-map.o, mkdeps.o): Likewise, from dependency list. Move these all together down by cpplib. * cpplib.h: Don't refer to MAX_WCHAR_TYPE_SIZE when determining definition of CPPCHAR_SIGNED_T. * cppcharset.c, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, cppinit.c * cpplex.c, cpplib.c, cppmacro.c, cpppch.c, cpptrad.c, hashtable.c * line-map.c, mkdeps.c: Don't include coretypes.h or tm.h. * cpphash.c (_cpp_init_hashtable): Don't use gcc_obstack_init. * cppinit.c (cpp_create_reader): Likewise. * cpphash.h (scan_out_logical_line): Rename _cpp_scan_out_logical_line. * cpptrad.c: Likewise. All callers changed. * cpplib.c: All callers changed. * c-ppoutput.c: Replace 'uchar' with 'unsigned char' throughout. * hashtable.h: Define GTY(x) to nothing here too. From-SVN: r69298
2003-07-11Index: ChangeLogGeoffrey Keating1-0/+7
2003-07-10 Geoffrey Keating <geoffk@apple.com> * c-decl.c (finish_decl): Handle 'used' here... * cgraphunit.c (cgraph_finalize_function): ... and here ... * c-common.c: (handle_used_attribute): ... not here. * configure.in (onstep): Support --enable-intermodule. * Makefile.in (OBJS-common): New. (OBJS-md): New. (OBJS-archive): New. (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive. (OBJS-onestep): New. (libbackend.a): Support @onestep@. (libbackend.o): New. * configure: Regenerate. * c-common.h (c_reset_state): New prototype. (c_parse_file): New prototype. (finish_file): Move prototype from c-tree.h. * c-decl.c: Include <hashtab.h>. (builtin_decls): New. (current_file_decl): New. (duplicate_decls): Add extra parameter. Change all callers. Don't output duplicate common symbols. (link_hash_hash): New. (link_hash_eq): New. (poplevel): Handle popping of the top level. (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL. (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate. (pushdecl_top_level): Likewise. (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL. (c_init_decl_processing): Create TRANSLATION_UNIT_DECL. (finish_decl): Handle TRANSLATION_UNIT_DECL. (merge_translation_unit_decls): New. (c_write_global_declarations): New. (c_reset_state): New. (implicitly_declare): Handle TRANSLATION_UNIT_DECL. * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New. * c-objc-common.c (c_cannot_inline_tree_fn): Handle TRANSLATION_UNIT_DECL. (c_objc_common_finish_file): Call merge_translation_unit_decls. * c-opts.c (in_fnames): Rename from in_fname. (c_common_decode_option): Handle multiple input filenames. (c_common_post_options): Likewise. (c_common_parse_file): Likewise; also, call c_parse_file rather than yyparse. * c-parse.in: Move cleanup code to c_parse_file. (free_parser_stacks): Move contents to c_parse_file. (c_parse_file): New. * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT for integer types. (C_DECL_FILE_SCOPE): New. (finish_file): Move prototype to c-common.h. (merge_translation_unit_decls): New prototype. (comptypes): Add extra parameter to prototype. (c_write_global_declarations): New prototype. * c-typeck.c (tagged_types_tu_compatible_p): New. (function_types_compatible_p): Add extra parameter, change all callers. (type_lists_compatible_p): Likewise. (comptypes): Likewise. (struct tagged_tu_seen): New. (tagged_tu_seen_base): New. (build_unary_op): Handle TRANSLATION_UNIT_DECL. (c_mark_addressable): Remove #if 0 code. * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add comment explaining why it shouldn't have to. * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY options. * cppinit.c (cpp_read_next_file): New. (cpp_read_main_file): Use it. * cpplib.c (undefine_macros): New. (cpp_undef_all): New. * cpplib.h (cpp_read_next_file): Prototype. (cpp_undef_all): Prototype. * langhooks-def.h (write_global_declarations): Remove prototype. * toplev.h (write_global_declarations): Add prototype. * tree.c (decl_type_context): Use switch statement, handle TRANSLATION_UNIT_DECL. * tree.def: Update documentation for TRANSLATION_UNIT_DECL. (TRANSLATION_UNIT_DECL): New kind of tree. * tree.h: Update documentation for TRANSLATION_UNIT_DECL. * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies. * doc/invoke.texi: Make attempt to document new functionality. 2003-05-19 Per Bothner <bothner@apple.com> * gcc.c (combine_inputs): New. (process_command): Set combine_inputs. (do_spec_1): Handle combine_inputs. (main): Likewise. Index: cp/ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * decl.c (cp_finish_decl): Handle 'used' attribute. * cp-lang.c (c_reset_state): New dummy routine. * cp-tree.h (finish_file): Move prototype to c-common.h. * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. From-SVN: r69224
2003-07-05cpplib.h (CPP_AT_NAME, [...]): New token types.Zack Weinberg1-2/+18
* cpplib.h (CPP_AT_NAME, CPP_OBJC_STRING): New token types. (struct cpp_options): Add narrow_charset, wide_charset, bytes_big_endian fields. Remove EBCDIC field. (cpp_init_iconv, cpp_interpret_string): New external interfaces. * cpphash.h: Include <iconv.h> if we have it, otherwise provide a dummy definition of iconv_t. (struct cpp_reader): Add narrow_cset_desc and wide_cset_desc fields. (_cpp_valid_ucn): Update prototype. (_cpp_destroy_iconv): New prototype. * doc/cpp.texi: Document character set handling. * doc/cppopts.texi: Document -fexec-charset= and -fexec-wide-charset=. * doc/extend.texi: Delete entire section on multiline strings. Rewrite section on __FUNCTION__ etc now that these are variables in C. * cppucnid.tab, cppucnid.pl: New files. * cppucnid.h: New generated file. * cppcharset.c: Include cppucnid.h. Lots of commentary added. (iconv_open, iconv, iconv_close): Provide dummy definitions if !HAVE_ICONV. (SOURCE_CHARSET, struct strbuf, init_iconv_desc, cpp_init_iconv, _cpp_destroy_iconv, convert_cset, width_to_mask, convert_ucn, emit_numeric_escape, convert_hex, convert_oct, convert_escape, cpp_interpret_string, narrow_str_to_charconst, wide_str_to_charconst): New. (ucn_valid_in_identifier): Use a binary search through the ucnranges table defined in cppucnid.h, not a long chain of if statements. (_cpp_valid_ucn): Add a limit pointer. Downgrade "universal character names are only valid in C++ and C99" to a warning. Issue the "meaning of \[uU] is different in traditional C" warning here. Take care not to let iconv see an invalid UCS value if we get a malformed UCN. Issue an error if we don't have iconv. (cpp_interpret_charconst): Moved here from cpplex.c. Use cpp_interpret_string to do the heavy lifting. * cppinit.c (cpp_create_reader): Initialize bytes_big_endian, narrow_charset, wide_charset fields of options structure. (cpp_destroy): Call _cpp_destroy_iconv. * cpplex.c (forms_identifier_p): Adjust call to _cpp_valid_ucn. (maybe_read_ucn, hex_digit_value, cpp_parse_escape): Delete. (cpp_interpret_charconst): Moved to cppcharset.c. * cpplib.c (dequote_string): Delete. (interpret_string_notranslate): New. (do_line, do_linemarker): Use interpret_string_notranslate. * Makefile.in (cppcharset.o): Depend on cppucnid.h. * c-common.c (fname_string, combine_strings): Delete. * c-common.h (fname_string, combine_strings): Delete prototypes. * c-lex.c (ignore_escape_flag): Delete. (cb_ident): Use cpp_interpret_string, not lex_string. (get_nonpadding_token): New function. (c_lex): Handle Objective-C @-prefixed identifiers and strings here. Adjust calls to lex_string. Don't write *value twice. (lex_string): Now handles string constant concatenation. Most of the work handed off to cpp_interpret_string. Call fix_string_type here. * c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): Replace with FUNC_NAME, throughout. (OBJC_STRING): New token type. (primary:STRING): No need to call fix_string_type here. (primary:objc_string): Make that OBJC_STRING. (objc_string nonterminal): Delete. (yylexname): Delete code to handle fake string constants. (yylexstring): Delete entirely. (_yylex): Handle CPP_AT_NAME and CPP_OBJC_STRING. No need to handle CPP_ATSIGN. * c.opt (-fexec-charset=, -fwide-exec-charset=): New options. * c-opts.c (missing_arg, c_common_handle_option): Handle OPT_fexec_charset_ and OPT_fwide_exec_charset_. (c_common_init): Set cpp_opts->bytes_big_endian, not cpp_opts->EBCDIC. Call cpp_init_iconv. (print_help): Document -fexec-charset= and -fexec-wide-charset=. (TARGET_EBCDIC): Delete default definition. * objc/objc-act.c (build_objc_string_object): No need to handle string constant concatenation. cp: * parser.c (cp_lexer_read_token): No need to handle string constant concatenation. testsuite: * gcc.c-torture/execute/wchar_t-1.x: New file; XFAIL wchar_t-1.c everywhere. * gcc.dg/concat.c: Concatenation of string constants with __FUNCTION__ / __PRETTY_FUNCTION__ is now a hard error. * gcc.dg/wtr-strcat-1.c: Loosen dg-warning regexp. * gcc.dg/cpp/escape-2.c: Use wide character constants where necessary to avoid multi-character character constant warning. * gcc.dg/cpp/escape.c: Likewise. * gcc.dg/cpp/ucs.c: Likewise. Remove backslashes from dg-bogus comments, as they confuse Tcl. Fix a typo. libstdc++-v3: * testsuite/22_locale/collate/compare/wchar_t/2.cc * testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc * testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc * testsuite/22_locale/collate/hash/wchar_t/2.cc * testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc * testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc * testsuite/22_locale/collate/transform/wchar_t/2.cc * testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc * testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc: XFAIL on all targets. From-SVN: r68952
2003-06-25cppfiles.c: Clarify comments.Martin Schaffner1-1/+1
* cppfiles.c: Clarify comments. * cpphash.h: Likewise. * cpplib.h: Likewise. * cppmacro.c: Likewise. * mkdeps.h: Likewise. From-SVN: r68496
2003-06-23basic-block.h: Fix comment formatting.Kazu Hirata1-2/+2
* basic-block.h: Fix comment formatting. * bt-load.c: Likewise. * builtins.c: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-format.c: Likewise. * coverage.c: Likewise. * cpplib.h: Likewise. * cpppch.c: Likewise. * dbxout.c: Likewise. * diagnostic.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gcc.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * profile.c: Likewise. * real.h: Likewise. * sched-deps.c: Likewise. From-SVN: r68369
2003-06-17* cpplib.h, cpphash.h, cppcharset.c, cpperror.c, cppexp.cZack Weinberg1-95/+79
* cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c * cppmacro.c, cpppch.c, cpptrad.c, cppspec.c: Convert to ISO C: new-style function declarations, no need for PARAMS, no special punctuation on indirect function calls, use string constant concatenation where convenient. From-SVN: r68070
2003-06-12Don't warn on dollars in builtin macro definitions,Hans-Peter Nilsson1-0/+4
e.g. __REGISTER_PREFIX__. * cpphash.h (struct cpp_reader): Move member warn_dollars... * cpplib.h (struct cpp_options): ...to here. Change type to unsigned char. * cppinit.c (cpp_create_reader): Set it to 1 here. (post_options): Don't set it here. * c-opts.c (c_common_init_options): Reset it to 0 here. (finish_options): Set it here. * cpplex.c (forms_identifier_p): Tweak for new location of warn_dollars. From-SVN: r67824
2003-05-11c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ into cpplib as it's a ↵Neil Booth1-1/+1
Standard Predefined Macro. * c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ into cpplib as it's a Standard Predefined Macro. * c-opts.c (finish_options): Pass flag_hosted to cpp_init_builtins. * cppinit.c (_cpp_init_builtins): Take HOSTED. Define __STDC_HOSTED__ appropriately. * cpplib.h (_cpp_init_builtins): Update. * fix-header.c (read_scan_file): Update. * doc/cpp.texi, doc/cppopts.texi: Update documentation. * cppfiles.c (find_or_create_entry): Preserve errno. From-SVN: r66688
2003-04-23Makefile.in (c-lex.o, [...]): Update.Neil Booth1-9/+9
* Makefile.in (c-lex.o, LIBCPP_OBJS, cpplex.o): Update. * c-lex.c (MULTIBYTE_CHARS): Remove conditionals. (lex_string): Take cpp_string with full spelling. (cb_ident): Update. (c_lex): Update diagnostics. * cpplex.c (SPELL_NUMBER, SPELL_STRING): Combine into SPELL_LITERAL. (create_literal): New. (lex_string): Unterminated literals have type CPP_OTHER. (_cpp_lex_direct): Update calls to lex_string. Use create_literal for CPP_OTHER. (cpp_token_len, cpp_spell_token, cpp_output_token): Simplify. (_cpp_equiv_tokens, cpp_interpret_charconst): Update. * cpplib.c (parse_include, do_line, do_linemarker, destringize_and_run): Update for token storing full spelling. * cpplib.h: Update token spelling types. * cppmacro.c (stringify_arg, check_trad_stringification): Update for token storing full spelling. cp: * Make-lang.in (lex.o): Remove mbchar.h. * lex.c (MULTIBYTE_CHARS): Lose. * parser.c (cp_lexer_get_preprocessor_token): CPP_OTHER handled in c-lex.c. testsuite: * gcc.dg/cpp/include2.c: Update. * gcc.dg/cpp/multiline-2.c: New. * gcc.dg/cpp/multiline.c: Update. * gcc.dg/cpp/strify2.c: Update. * gcc.dg/cpp/trad/literals-2.c: Update. From-SVN: r66019
2003-04-22c-lex.c (c_lex): Handle CPP_OTHER differently.Neil Booth1-2/+1
* c-lex.c (c_lex): Handle CPP_OTHER differently. * cppexp.c (_cpp_parse_expr): Similarly. * cpplex.c (SPELL_CHAR): Remove. (_cpp_lex_direct): Stray chars are saved as byte strings. (cpp_spell_token, cpp_output_token, _cpp_equiv_token): Don't handle SPELL_CHAR. (cpp_avoid_paste): Update handling of CPP_OTHER. * cpplib.h: Spell CPP_OTHER like a number. (struct cpp_token): Remove member c. * cppmacro.c (stringify_arg): Update handling of CPP_OTHER. From-SVN: r65951
2003-04-21c-ppoutput.c (cb_include): Don't take a cpp_token.Neil Booth1-1/+1
* c-ppoutput.c (cb_include): Don't take a cpp_token. * cppfiles.c: Don't undef strcmp. (find_include_file): Don't take a cpp_token. Check for empty file names. (_cpp_execute_include, _cpp_compare_file_date): Don't take a cpp_token. (cpp_push_include): Simplify. * cpphash.h (_cpp_execute_include, _cpp_compare_file_date): Update. * cpplib.c (glue_header_name): Return the file name, not a cpp_token. (parse_include): Similary. Don't check for zero-length filenames. (do_include_common, do_pragma_dependency): Update accordingly. * cpplib.h (struct cpp_callbacks): Change prototype of include. From-SVN: r65894
2003-03-20Various cleanups to help compile server.Per Bothner1-11/+11
* cppinit.c (cpp_create_reader): Take extra hash_table* argument, and pass that to _cpp_init_hashtable. (cpp_read_main_file): Drop hash_table* argument; don't call _cpp_init_hashtable. * cpplib.h: Update declarations to match. * c-opts.c (c_common_init_options): Pass ident_hash to cpp_create_reader. (c_common_post_options): Don't pass ident_hash to cpp_read_main_file. * fix-header.c (read_scan_file): Likewise pass NULL table to cpp_create_reader rather than cpp_read_main_file. * cppfiles.c (cpp_rename_file): Generalized and renamed to cpp_change_file. * cpplib.h: Update declaration to match. * c-opts.c (push_command_line_line, finish_options): Change cpp_rename_file calls to cpp_change_file. From-SVN: r64617
2003-03-17c-opts.c: Default TARGET_EBCDIC to 0 if not defined.Neil Booth1-6/+9
* c-opts.c: Default TARGET_EBCDIC to 0 if not defined. (c_common_init): Set EBCDIC in cpp options. * cpplex.c (maybe_read_ucs, cpp_parse_escape): Use EBCDIC option, not conditional compilation. * cpplib.h (struct cpp_options): New entry EBCDIC. From-SVN: r64471
2003-03-15Makefile.in: Update.Neil Booth1-18/+3
* Makefile.in: Update. * c-common.h (cb_register_builtins): Rename c_cpp_builtins. * c-lex.c (init_c_lex): Register builtins hook is dead. * c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U. (c_common_decode_option): Don't call cpp_handle_option. Handle -A, -D and -U. (handle_deferred_opts): Simplify. (finish_options): Define builtins and command line macros. * c-ppoutput.c (init_pp_output): Register builtins hook is dead. * cppinit.c: Don't include intl.h. (init_builtins): Rename cpp_init_builtins. No hook to call. (init_library): Don't need to sort options. (cpp_create_reader): Don't set pending. (cpp_destroy): Don't free pending. (struct pending_option, cl_directive_handler, struct cpp_pending, APPEND, free_chain, new_pending_directive, parse_option, opt_comp, cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option, cl_options, cpp_handle_option): Remove. * cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option, cpp_finish_options): Remove. (cpp_init_builtins): New. * fix-header.c (read_scan_file): Update to handle -D. Fix handling of -I. Replace call to cpp_finish_options. cp: * Make-lang.in: Update. From-SVN: r64398
2003-03-12cppfiles.c (cpp_rename_file, [...]): New.Neil Booth1-0/+2
* cppfiles.c (cpp_rename_file, cpp_push_include): New. * cppinit.c (push_include): Move with changes to cppfiles.c. (cpp_read_main_file): Mark named operators here... (cpp_finish_options): ...not here. Update. (_cpp_maybe_push_include_file): Update. * cpplib.h (cpp_push_include, cpp_rename_file): New. From-SVN: r64266
2003-03-04Makefile.in: Update.Neil Booth1-25/+0
* Makefile.in: Update. * c-common.c (flag_no_line_commands, flag_no_output, flag_dump_macros, flag_dump_includes): New. * c-common.h (flag_no_line_commands, flag_no_output, flag_dump_macros, flag_dump_includes, preprocess_file): New. (init_c_lex): Update prototype. * c-lex.c (init_c_lex): Update prototype; move some code to c_common_init. * c-opts.c (preprocess_file): Subsume into c_common_init. (c_common_decode_option): Update flags. (c_common_init): Move code from preprocess_file and init_c_lex. (sanitize_cpp_opts): Update. * c-ppoutput.c: New, cppmain.c almost verbatim. * cpphash.h (struct printer): Remove. (struct cpp_reader): Remove print. * cpplib.h (dump_none, dump_only, dump_names, dump_definitions, cpp_preprocess_file): Remove. (struct cpp_options): Remove no_output, no_line_commands, dump_macros and dump_includes. * cppmain.c: Remove. * doc/passes.texi: Update. From-SVN: r63773
2003-03-02c-incpath.c (remove_component_p, [...]): Move back to cppfiles.c.Neil Booth1-1/+1
* c-incpath.c (remove_component_p, simplify_path): Move back to cppfiles.c. (remove_duplicates): Use cpp_simplify_path. * c-incpath.h (simplify_path): Remove. * c-lex.c: Don't include c-incpath.h. (init_c_lex): Remove simplify_path. * cppfiles.c (remove_component_p, cpp_simplify_path): Restore. (find_or_create_entry, validate_pch): Revert. From-SVN: r63669
2003-03-01Makefile.in (C_AND_OBJC_OBJS, [...]): Update.Neil Booth1-31/+32
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS, cppinit.o, cppdefault.o, fix-header): Update. * c-incpath.c: New file. * c-incpath.h: New file. * c-lex.c: Include c-incpath.h. (init_c_lex): Register path simplifier. * c-opts.c: Include cppdefault.h and c-incpath.h. (TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc, std_cxx_inc, quote_chain_split, add_prefixed_path): New. (COMMAND_LINE_OPTIONS): Add more options from cpplib. (missing_arg, c_common_decode_option): Handle them. (c_common_post_options): Register include chains. (print_help): Update. * cppdefault.h (struct default include): Update. Move some macros to ... * cppdefault.c: ... here. (cpp_include_defaults): Add extra field add_sysroot. * cppfiles.c (include_file, search_from, find_or_create_entry, cpp_included, find_include_file, remap_filename): Update for renaming of search_path to cpp_path, and of the chain headers. (remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c. * cpphash.h (struct search_path): Move to cpplib.h. (struct cpp_buffer, struct cpp_reader): Update. (_cpp_simplify_pathname): Remove. * cppinit.c: Don't include prefix.h and cppdefault.h. (INO_T_EQ, INO_T_COPY, path_include, append_include_chain, remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs, init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir, no_pth, cpp_handle_options): Remove. (struct pending_option): Remove chain members. (cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS, cpp_handle_option): Update. * cpplib.h (struct cpp_path, cpp_set_include_chains): New. (struct cpp_options): Remove quote_include, bracket_include, include_prefix, include_prefix_len, verbose, ignore_srcdir, no_standard_includes, no_standard_cplusplus_includes. (struct cpp_callbacks): Add simplify_path. (cpp_handle_options): Remove. * fix-header.c: Include c-incpath.h. (read_scan_file): Update to use c-incpath functionality. * doc/passes.texi: Update. cp: * Make-lang.in (CXX_C_OBJS): Update. From-SVN: r63612
2003-02-13Makefile.in (PREPROCESSOR_DEFINES): Add @TARGET_SYSTEM_ROOT_DEFINE@.Daniel Jacobowitz1-0/+4
* Makefile.in (PREPROCESSOR_DEFINES): Add @TARGET_SYSTEM_ROOT_DEFINE@. * configure.in (PREFIX_INCLUDE_DIR): Don't define if $with_sysroot is specified or if building a cross compiler. (TARGET_SYSTEM_ROOT_DEFINE): Add TARGET_SYSTEM_ROOT_RELOCATABLE if the sysroot is under $exec_prefix. * configure: Regenerated. * cppdefault.h: Use native include paths if TARGET_SYSTEM_ROOT is defined. (struct default_include): Add add_sysroot field. (cpp_SYSROOT): Declare. * cppdefault.c (cpp_include_defaults): Fill in add_sysroot field. (cpp_SYSROOT): New variable. * cppinit.c (cpp_create_reader): Initialize CPP_OPTION (pfile, sysroot). (init_standard_includes): Handle add_sysroot. Do not add unrelocated copies of relocated directories. (COMMAND_LINE_OPTIONS): Add -isysroot. (cpp_handle_option): Handle -isysroot. * cpplib.h (struct cpp_options): Add sysroot member. * gcc.c (The Specs Language): Update description of %I. (target_system_root_changed): New variable. (process_command): Conditionalize make_relative_prefix call on !VMS and TARGET_SYSTEM_ROOT_RELOCATABLE. Set target_system_root_changed. (do_spec_1): Add -isysroot to %I. * doc/invoke.texi (Spec Files): Update description of %I. * doc/install.texi (--with-sysroot): Update comment about relocation. From-SVN: r62853
2003-01-28cpplib.h (struct cpp_options): Add warn_deprecated field.Jason Merrill1-0/+3
* cpplib.h (struct cpp_options): Add warn_deprecated field. * cppinit.c (cpp_create_reader): Turn it on by default. * c-opts.c (c_common_decode_option): Set it. * cpplib.c (do_pragma_once): Only complain about #pragma once if warn_deprecated is set. From-SVN: r62005
2003-01-18alias.c: Fix comment typos.Kazu Hirata1-3/+3
* alias.c: Fix comment typos. * basic-block.h: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-decl.c: Likewise. * c-opts.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.h: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfglayout.c: Likewise. * cfgrtl.c: Likewise. * convert.c: Likewise. * cpphash.h: Likewise. * cpplex.c: Likewise. * cpplib.h: Likewise. * df.h: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dwarf2.h: Likewise. From-SVN: r61462
2003-01-10Merge from pch-branch.Geoffrey Keating1-6/+29
From-SVN: r61136
2003-01-01c-pragma.c (c_register_pragma): New.Neil Booth1-4/+1
* c-pragma.c (c_register_pragma): New. (init_pragma): Use it. * c-pragma.h (cpp_register_pragma): Don't declare. (c_register_pragma): New. * cpplib.h: Remove #ifdef GCC_C_PRAGMA_H. * config/darwin.h (REGISTER_TARGET_PRAGMAS): Update. * config/arm/arm.h (REGISTER_TARGET_PRAGMAS): Update. * config/c4x/c4x.h (REGISTER_TARGET_PRAGMAS): Update. * config/h8300/h8300.h (REGISTER_TARGET_PRAGMAS): Update. * config/i370/i370.h (REGISTER_TARGET_PRAGMAS): Update. * config/i960/i960.h (REGISTER_TARGET_PRAGMAS): Update. * config/ia64/hpux.h (REGISTER_TARGET_PRAGMAS): Update. * config/rs6000/rs6000.h (REGISTER_TARGET_PRAGMAS): Update. * config/sh/sh.h (REGISTER_TARGET_PRAGMAS): Update. * config/v850/v850.h (REGISTER_TARGET_PRAGMAS): Update. * doc/tm.texi (REGISTER_TARGET_PRAGMAS): Update cp: * lex.c: Remove superfluous include of cpplib.h. (CONSTRAINT): Define without conditions. (init_cp_pragma): Use c_register_pragma. From-SVN: r60740
2002-12-16Merge basic-improvements-branch to trunkZack Weinberg1-4/+7
From-SVN: r60174
2002-09-26c-common.h: Follow spelling conventions.Kazu Hirata1-1/+1
* c-common.h: Follow spelling conventions. * cpplex.c: Likewise. * cpplib.h: Likewise. * gthr-dce.h: Likewise. * gthr-posix.h: Likewise. * optabs.c: Likewise. * output.h: Likewise. * profile.c: Likewise. * protoize.c: Likewise. * ra-rewrite.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regclass.c: Likewise. * regmove.c: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. From-SVN: r57555
2002-09-22ChangeLog: Follow spelling conventions.Kazu Hirata1-1/+1
* ChangeLog: Follow spelling conventions. * ChangeLog.0: Likewise. * ChangeLog.1: Likewise. * ChangeLog.2: Likewise. * ChangeLog.3: Likewise. * ChangeLog.4: Likewise. * ChangeLog.5: Likewise. * ChangeLog.6: Likewise. * FSFChangeLog.10: Likewise. * FSFChangeLog.11: Likewise. * alias.c: Likewise. * basic-block.h: Likewise. * c-aux-info.c: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-semantics.c: Likewise. * c-typeck.c: Likewise. * calls.c: Likewise. * cfganal.c: Likewise. * cfgloop.c: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * conflict.c: Likewise. * cppexp.c: Likewise. * cppfiles.c: Likewise. * cpphash.h: Likewise. * cppinit.c: Likewise. * cpplex.c: Likewise. * cpplib.c: Likewise. * cpplib.h: Likewise. * cppmacro.c: Likewise. * cse.c: Likewise. From-SVN: r57398
2002-09-14ChangeLog: Follow spelling conventions.Kazu Hirata1-1/+1
* ChangeLog: Follow spelling conventions. * ChangeLog.0: Likewise. * ChangeLog.2: Likewise. * ChangeLog.3: Likewise. * ChangeLog.4: Likewise. * ChangeLog.5: Likewise. * ChangeLog.6: Likewise. * cppfiles.c: Likewise. * cppinit.c: Likewise. * cpplib.h: Likewise. * cse.c: Likewise. * debug.h: Likewise. * df.c: Likewise. * dominance.c: Likewise. * hashtable.c: Likewise. * hashtable.h: Likewise. * loop.c: Likewise. * config/arm/README-interworking: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm.h: Likewise. * config/arm/arm.md: Likewise. * config/dsp16xx/dsp16xx.h: Likewise. * config/frv/frv.c: Likewise. * config/frv/frv.h: Likewise. * config/ip2k/ip2k.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/stormy16/stormy-abi: Likewise. * config/stormy16/stormy16.h: Likewise. * config/v850/v850.c: Likewise. From-SVN: r57146
2002-08-14re PR preprocessor/7358 (Changes to Sun's make Dependencies)Neil Booth1-0/+3
PR preprocessor/7358 * c-opts.c (check_deps_environment_vars): Ignore main file for SUNPRO_DEPENDENCIES. * cppfiles.c (stack_include_file): Ignore main file if appropriate. * cpplib.h (struct cpp_options): New member in deps. * doc/cppenv.texi: Update. From-SVN: r56333
2002-08-12c-opts.c (deps_seen, [...]): New.Neil Booth1-26/+23
* 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
2002-08-12c-common.c (STDC_0_IN_SYSTEM_HEADERS, [...]): Move to c-copts.c.Neil Booth1-4/+1
* c-common.c (STDC_0_IN_SYSTEM_HEADERS, c_common_init): Move to c-copts.c. (warn_multichar): Die. (cb_register_builtins): Export. * c-common.h (warn_multichar, preprocess_file): Remove. (cb_register_builtins): New. * c-lang.c (c_init): Remove. (LANG_HOOKS_INIT): Use c_objc_common_init. * c-lex.c (init_c_lex): Don't canonicalize filename. * c-opts.c (in_fname, STDC_0_IN_SYSTEM_HEADERS): New. (preprocess_file): Make static. Update for cpplib. (c_common_decode_option): Remove warn_multichar. Use in_fname. (c_common_post_options): Set some cpp options here. (c_common_init): Move from c-common.c. * cppinit.c (cpp_post_options): Don't canonicalize in_fname. * cpplib.h (struct cpp_options): Remove in_fname. (cpp_preprocess_file): Update. * cppmain.c (cpp_preprocess_file): Update for new prototypes. From-SVN: r56223
2002-08-11c-common.c (c_common_init): Call preprocess_file instead.Neil Booth1-7/+11
* c-common.c (c_common_init): Call preprocess_file instead. (c_common_finish): Move to c-opts.c. * c-common.h (preprocess_file): new. * c-opts.c (out_fname, out_stream, deps_append, preprocess_file, check_deps_environment_vars, c_common_finish): New. (c_common_decode_option): Update for out_fname and dependencies. * cppinit.c (init_dependency_output, output_deps): Remove. (cpp_destroy): Update prototype. (cpp_add_dependency_target): New. (cpp_read_main_file): Don't overlay a buffer. (cpp_finish): Take a deps output stream and write deps to it. Return the error count. (cpp_post_options): Don't canonicalize out_fname, or do anything with dependencies. * cpplib.h (struct cpp_options): Remove out_fname and preprocess_only. (cpp_add_dependency_target): New. (cpp_destroy, cpp_finish, cpp_preprocess_file): Update. * cppmain.c (cpp_preprocess_file): Update prototype. Don't set preprocess_only. Don't handle the output stream directly. From-SVN: r56214
2002-08-10c-opts.c (set_std_cxx98, [...]): New.Neil Booth1-0/+4
* c-opts.c (set_std_cxx98, set_std_c89): New. (COMMAND_LINE_OPTIONS): Move more from cppinit.c. (c_common_decode_option): Handle new switches from cppinit.c. Add -std=gnu++98. * cppinit.c (set_lang): Rename cpp_set_lang. Export. (no_arg, no_num): Remove. (COMMAND_LINE_OPTIONS): Move more to c-opts.c. Drop all lang- switches apart from -lang-objc and lang-asm. (cpp_handle_option): Similarly. * cpplib.h (cpp_set_lang): New. * doc/cppopts.texi, doc/invoke.texi: Document -std=c++98, -std=gnu++98. * objc/lang-specs.h: Remove -ansi. cp: * lang-specs.h: Remove -ansi. From-SVN: r56185
2002-08-09Makefile.in (c-opts.o): UpdateNeil Booth1-5/+0
* Makefile.in (c-opts.o): Update * c-opts.c: Include intl.h. (print_help): Move from cppinit.c. Remove unused options. (COMMAND_LINE_OPTIONS): Move more from cppinit.c. (missing_arg): Complain for switches without an argument. (c_common_decode_option): Reject missing joined arguments. Handle new switches from cppinit.c. * cppinit.c (COMMAND_LINE_OPTIONS): Move some switches to c-opts.c. (cpp_handle_option): Similarly. (print_help): Moved to c-opts.c. * cpplib.h (struct cpp_options): Remove help_only. * gcc.c (cpp_unique_options): Remove -$. * doc/cppopts.texi: Undocument -h. From-SVN: r56155
2002-08-06cppinit.c (struct lang_flags): Rename trigraphs std.Neil Booth1-0/+3
* cppinit.c (struct lang_flags): Rename trigraphs std. (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. From-SVN: r56077
2002-07-23cppexp.c (parse_defined): Mark macro used.Neil Booth1-0/+3
* cppexp.c (parse_defined): Mark macro used. * cpphash.h (struct cpp_macro): New member "used". (_cpp_mark_macro_used, _cpp_warn_if_unused_macro): New. (struct cpp_reader): New member. * cppinit.c (cpp_finish_options): Set first_unused_line. (cpp_finish): Warn of unused macros if requested. (OPT_TABLE): New switches. (cpp_handle_option): Handle them. * cpplib.c (do_undef): Warn if macro unused. (do_ifdef, do_ifndef): Mark macro used. * cpplib.h (struct cpp_options): New member. * cppmacro.c (_cpp_warn_if_unused_macro): New. (enter_macro_context): Mark macro used. (_cpp_create_definition): Mark macro unused; warn if unused when redefined. * cpptrad.c (scan_out_logcial_line, push_replacement_text): Mark macros used. * doc/cppopts.texi: Update. testsuite: * gcc.dg/cpp/trad/Wunused.c, gcc.dg/cpp/trad/Wunused.h, gcc.dg/cpp/Wunused.c, gcc.dg/cpp/Wunused.h: New tests. From-SVN: r55692
2002-07-20cppexp.c (struct op): Add token pointer.Neil Booth1-0/+4
* cppexp.c (struct op): Add token pointer. (check_promotion, CHECK_PROMOTION): New. (optab): Update. (_cpp_parse_expr): Update, use token pointer of struct op. (reduce): Warn about change of sign owing to promotion. * cppinit.c (cpp_handle_option): New warning if -Wall. * cpplib.h (struct cpp_options): New member. testsuite: * gcc.dg/cpp/Wsignprom.c: New tests. From-SVN: r55611
2002-07-17cppexp.c (cpp_interpret_integer, [...]): Clarify and correct use of "bool" ↵Neil Booth1-2/+2
variables. * cppexp.c (cpp_interpret_integer, append_digit, parse_defined, 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. From-SVN: r55536
2002-06-11Makefile.in: Update cppmain.o.Neil Booth1-0/+3
* Makefile.in: Update cppmain.o. * cpphash.h (struct cpp_reader): Move some members to a nested structure. (trad_line): Rename saved_line. (_cpp_read_logical_line_trad): Update. (_cpp_remove_overlay): New. * cppinit.c (cpp_create_reader): No need to set saved_line. (cpp_destroy): Update. (cpp_read_main_file): Only overlay if compiling. * cpplex.c (continue_after_nul): Return false if in directive. * cpplib.c (EXPAND): New. (directive_table, SEEN_EOL): Update. (end_directive): Remove overlay if traditional; don't skip line in traditional #define. (prepare_directive_trad): New. (_cpp_handle_directive, run_directive): Update for traditional directives. (lex_macro_node): Simplify, don't use lex_identifier_trad. * cpplib.h (struct options): Add preprocess_only. * cppmain.c: Don't include intl.h. (cpp_preprocess_file): Set options->preprocess_only. (scan_translation_unit_trad): Fix, and print line numbers. * cpptrad.c (check_output_buffer, lex_identifier, scan_parameters, maybe_start_funlike, scan_out_logical_line, replace_args_and_push, save_replacement_text, _cpp_create_trad_definition): Update for variable renaming. (_cpp_overlay_buffer): Save line number. (_cpp_remove_overlay): Rename from restore_buff, restore line. (_cpp_read_logical_line_trad): Don't handle overlays here. (scan_out_logical_line): Process directives. From-SVN: r54485
2002-06-07cppinit.c (COMMAND_LINE_OPTIONS): Give all relevant -W options their own ↵Zack Weinberg1-1/+1
entries. * cppinit.c (COMMAND_LINE_OPTIONS): Give all relevant -W options their own entries. (parse_option): Clarify comment. (cpp_handle_option): Remove 'ignore' parameter and OPT_W special case. Replace if/strcmp chain for -W options with use of new OPT_* entries for them. (cpp_handle_options): Update to match. * cpplib.h: Remove last parameter to cpp_handle_option from prototype. * c-decl.c, cp/decl2.c: Update call to cpp_handle_option. From-SVN: r54352
2002-06-02c-common.c (c_common_init): Override cpplib's default warn_long_long setting.Neil Booth1-0/+4
* c-common.c (c_common_init): Override cpplib's default warn_long_long setting. * c-lex.c (lex_number): Replace with interpret_integer, interpret_float, narrowest_unsigned_type and narrowest_signed_type, taking advantage of the new cpplib functionality. * cpperror.c (_cpp_begin_message): If a warning is turned into an error, avoid printing "warning:". * cppexp.c (cpp_num_sign_extend): New. * cppinit.c: Update comment. * cpplib.h (cpp_num_sign_extend): New. * tree.h: Update comment. testsuite: * gcc.dg/wtr-int-type-1.c, gcc.dg/wtr-suffix-1.c, gcc.dg/cpp/paste4.c, gcc.dg/cpp/sysmac2.c: Update for mofified diagnostics. * gcc.dg/c99-intconst-1.c: No longer fail. From-SVN: r54180
2002-05-29cppexp.c (cpp_num): Move to cpplib.h.Neil Booth1-0/+48
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
2002-05-23cpperror.c (_cpp_begin_message): No special casing of CPP_FATAL_LIMIT.Neil Booth1-10/+2
* cpperror.c (_cpp_begin_message): No special casing of CPP_FATAL_LIMIT. * cppinit.c (sanity_checks): s/DL_FATAL/DL_ICE/. (output_deps, cpp_handle_option, cpp_post_options): Use DL_ERROR. * cpplib.c (do_include_common): Use DL_ERROR. * cpplib.h (CPP_FATAL_LIMIT, CPP_FATAL_ERRORS, DL_FATAL): Remove. (DL_ICE): Renumber. * fix-header.c (read_scan_file): Update. From-SVN: r53765
2002-05-17Makefile.in: Update for cpptrad.c.Neil Booth1-0/+3
* 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