summaryrefslogtreecommitdiff
path: root/gcc/fix-header.c
Commit message (Collapse)AuthorAgeFilesLines
* Add framework support for darwin.mrs2004-03-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * c-incpath.c: Include target.h and machmode.h. (add_path): Use a consistent style for cpp_dir. Initialize p->construct to 0. (add_cpp_dir_path): New. (register_include_chains): Add use of extra_includes callback. (hook_void_int): Add. (target_c_incpath): Add. * c-incpath.h (add_cpp_dir_path): New. (target_c_incpath_s): Add. (target_c_incpath): Add. (C_INCPATH_INIT): Add. * c-opts.c (c_common_missing_argument, c_common_handle_option): Add -F argument processing. * c.opt: Add -F argument processing. * gcc.c (trad_capable_cpp): Add -F argument processing. * cppfiles.c (find_file_in_dir): Update to use construct callback. (search_path_exhausted, cpp_get_path, cpp_get_buffer, cpp_get_prev): New. (_cpp_find_file): Use search_path_exhausted. (make_cpp_dir): Initialize construct to 0. * cpplib.h (missing_header_cb cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New. (cpp_callbacks): Add missing_header (cpp_dir): Add construct. * target-def.h: (TARGET_OPTF): New. * hooks.c (hook_void_int, hook_void_charptr): Add. * hooks.h (hook_void_int, hook_void_charptr): Add. * Makefile.in (c-incpath.o) : Add $(TARGET_H) and $(MACHMODE_H) dependencies. * doc/invoke.texi (Darwin Options): Document -F. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Add. (TARGET_OPTF): Add. * fix-header.c (target_c_incpath): Add. * config/darwin-c.c: Add c-incpath.h include. (using_frameworks, find_subframework_file, find_subframework_header, add_system_framework_path, frameworks_in_use, num_frameworks, max_frameworks, add_framework, find_framework, struct framework_header, framework_header_dirs, framework_construct_pathname, find_subframework_file, add_system_framework_path, add_framework_path, framework_defaults, darwin_register_frameworks, find_subframework_header): Add. * config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New. (TARGET_OPTION_TRANSLATE_TABLE): Add -framework support. (CPP_SPEC): Add __APPLE_CC__ support. * t-darwin (darwin-c.o): Add c-incpath.h dependency. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78875 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (line_table): Move local variable in main to global.bothner2004-02-141-1/+2
| | | | | | | | | * scan.h (line_table): Use it. * scan-decls.c (scan_decls): Need to call linemap_lookup on token's line (recently renamed to src_loc) before calling recognized_function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77808 138bc75d-0d04-0410-961f-82ee72b054a4
* Partially revert/redo 2003-10-01 change; fix -fworking-directory.bothner2004-02-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * c-ppoutput.c (pp_dir_change): New function. * c-common.h (pp_dir_change): New declaration. * cpplib.h (struct cpp_options): Remove working_directory field. * cppinit.c (cpp_find_main_file, cpp_push_main_file): Merge back to (cpp_read_main_file): as before 10-01. Call _cpp_stack_file. Don't handle -fworking_directory here, but in c_common_post_options. (read_original_directory): Don't back up when done. Don't clear no-longer used working_directory flag. * cpplib.h: Update declarations to match. * c-lex.c (cb_dir_change): Move to c-opts.c. (init_c_lex): Don't set dir_change callback here, since we want to set it even if flag_preprocess_only. * c-opts.c (cb_dir_change): Function moved from c-lex.c. (c_common_post_options): Set dir_change callback. Call pp_dir_change if approporiate. (finish_options): Don't call cpp_find_main_file here. Hence remove unneeded parameter and result. Do LC_RENAME for <built-in>. (c_common_post_options): Call cpp_read_main_file here instead. (c_common_init): Update accordingly. (push_command_line_include): Don't cpp_push_main_file. Do LC_RENAME rather than LC_LEASE to get back to main file. Compared to pre-10-01 version, inline cpp_rename_to_main_file. (c_common_parse_file): Call cpp_read_main_file for subsequent main files, but call finish_options for all files. * c-opts.c (sanitize_cpp_opts): Don't set cpp_opts->working_directory. * fix-header.c (read_scan_file): Call cpp_read_main_file instead of cpp_find_main_file + cpp_push_main_file. * c-lex.c (fe_file_change): Don't set main_input_filename here. * opts.c (handle_options): Only set main_input_filename first time. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77303 138bc75d-0d04-0410-961f-82ee72b054a4
* * alias.c, basic-block.h, c-common.c, c-common.h,kazu2004-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | c-cppbuiltin.c, c-opts.c, c-pragma.c, c-pretty-print.c, calls.c, cfg.c, cfgcleanup.c, cfgrtl.c, cgraph.h, collect2.c, combine.c, cppcharset.c, cpphash.h, cppinit.c, cpplib.c, cpplib.h, cppmacro.c, crtstuff.c, cselib.c, cselib.h, defaults.h, df.c, dominance.c, et-forest.c, expmed.c, expr.c, expr.h, fix-header.c, function.h, gcc.c, gcse.c, genattrtab.c, genautomata.c, genconditions.c, genemit.c, genflags.c, gengtype.c, gengtype.h, genopinit.c, genrecog.c, gensupport.c, ggc-zone.c, graph.c, haifa-sched.c, input.h, integrate.c, langhooks-def.h, langhooks.c, langhooks.h, line-map.c, line-map.h, local-alloc.c, optabs.c, optabs.h, postreload.c, ra.h, recog.c, reg-stack.c, regmove.c, reload.c, reorg.c, rtl.c, sched-deps.c, sched-ebb.c, sdbout.c, system.h, target.h, targhooks.c, toplev.h, tree-inline.c, unwind-pe.h, unwind.h, varray.c, varray.h: Update copyright. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76302 138bc75d-0d04-0410-961f-82ee72b054a4
* Move cpp_reader's line_maps field to a shared global.bothner2004-01-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | * cpphash.h (cpp_reader): Rename line_maps field to line_table and change the type to a pointer rather than a struct. * cppinit.c (cpp_push_main_field): Adjust accordingly. * cpplib.c (do_include_common, _cpp_do_file_change, cpp_get_callbacks): Likewise. * cppfiles.c (validate_pch): Likewise. * cppmacro.c (_cpp_warn_if_unused_macro, _cpp_builtin_macro_text): Likewise. * cpperror.c (print_location): Likewise. * cpplib.h (cpp_create_reader): New line_maps pointer parameter. * cppinit.c (cpp_create_reader): Handle new parameter. (cpp_destroy): Don't free line_maps - that's no longer our job. * input.h (line_table): New variable. * toplev.c (line_table): Declare variable. (general_init): Initialize line_table. * c-opts.c (c_common_init_options): Pass line_table to cpp_create_reader. * fix-header.c (read_scan_file): New local variable line_table. Initialize, and pass it to cpp_create_reader. * Makefile.in (LIBS, LIBDEPS): Add libcpp.a. (C_AND_OBJC_OBJS, fix-header): Remove redundant libcpp.a. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76198 138bc75d-0d04-0410-961f-82ee72b054a4
* PR preprocessor/12847danglin2003-11-011-1/+1
| | | | | | | | | | | * cppfiles.c, cppexp.c, cpperror.c, cpplib.h, cpplib.c, cpplex.c, cppinit.c, cpptrad.c, cppmacro.c, fix-header.c, cpppch.c, c-pch.c, c-incpath.c, cppcharset.c (DL_WARNING, DL_WARNING_SYSHDR, DL_PEDWARN, DL_ERROR, DL_ICE, DL_EXTRACT, DL_WARNING_P): Prefix macro names with "CPP_". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73183 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppinit.c (cpp_read_main_file): Split into two functions:bothner2003-10-021-2/+3
| | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72014 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-lex.c (fe_file_change): Handle a NULL new_map.bothner2003-10-021-1/+1
| | | | | | | | * fix-header.c (cb_file_change): Likewise. * c-ppoutput.c (pp_file_change): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72011 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppinit.c (cpp_read_main_file): Split out source-independentbothner2003-08-091-0/+1
| | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70279 138bc75d-0d04-0410-961f-82ee72b054a4
* * alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.cghazi2003-07-191-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c gcse.c genattr.c genattrtab.c genautomata.c genconditions.c genemit.c genextract.c genoutput.c genrecog.c gensupport.c ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c postreload.c prefix.c print-tree.c protoize.c ra-build.c ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c regmove.c regrename.c reload.c reload1.c reorg.c resource.c sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary casts. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69587 138bc75d-0d04-0410-961f-82ee72b054a4
* * fp-test.c (main): Use ISO C90 prototype.aj2003-07-121-58/+34
| | | | | | | | | | | | | * version.c: Remove unneded include of ansidecl.h. * cgraph.h: Convert prototypes to ISO C90. * cgraph.c: Likewise. * fix-header.c: Likewise. * ra.h: Likewise. * protoize.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69265 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c: Remove ADD_MISSING_EXTERN_C dependend variables.aj2003-06-041-29/+1
| | | | | | | | | (write_lbrac): Remove ADD_MISSING_EXTERN_C dependend code. (recognized_function): Likewise. (read_scan_file): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67421 138bc75d-0d04-0410-961f-82ee72b054a4
* * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p)kraai2003-05-201-1/+0
| | | | | | | | | | | | | | | (nonlocal_set_p): Remove initial blank line. * dwarf2out.c (simple_type_size_in_bits): Likewise. * et-forest.c (et_forest_create): Likewise. * explow.c (stabilize): Likewise. * fix-header.c (write_lbrac): Likewise. * graph.c (start_fct, node_data): Likewise. * jump.c (only_sets_cc0_p, sets_cc0_p): Likewise. * rtlanal.c (global_reg_mentioned_p): Likewise. * tree.c (bit_position): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66984 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc:ghazi2003-05-171-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-semantics.c (build_stmt): Likewise. * calls.c (emit_library_call, emit_library_call_value): Likewise. * collect2.c (notice, fatal_perror, fatal, error): Likewise. * cpperror.c (cpp_error, cpp_error_with_line): Likewise. * diagnostic.c (build_message_string, output_printf, output_verbatim, verbatim, inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl, fnotice): Likewise. * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_nstring, dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, dw2_asm_output_encoded_addr_rtx): Likewise. * emit-rtl.c (gen_rtx, gen_rtvec): Likewise. * errors.c (warning, error, fatal, internal_error): Likewise. * final.c (output_operand_lossage, asm_fprintf): Likewise. * fix-header.c (fatal): Likewise. * gcc.c (fatal, error, notice): Likewise. * gcov.c (fnotice): Likewise. * genattrtab.c (attr_rtx, attr_printf): Likewise. * gengtype.c (error_at_line, xasprintf, oprintf): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c (fatal, error): Likewise. * protoize.c (notice): Likewise. * ra-debug.c (ra_debug_msg): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c (error_for_asm, warning_for_asm): Likewise. * tree.c (build, build_nt, build_function_type_list): Likewise. cp: * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate libiberty VA_ macros, always use stdarg. * rtti.c (create_pseudo_type_info): Likewise. * tree.c (build_min_nt, build_min): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66919 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ intoneil2003-05-111-1/+1
| | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66688 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppfiles.c (ENABLE_VALGRIND_CHECKING, VALGRIND_DISCARD,neil2003-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MMAP_THRESHOLD, TEST_THRESHOLD, SHOULD_MMAP): Remove. (struct include_file): Remove fefcnt, mapped members. (open_file, stack_include_file, _cpp_pop_file_buffer): Disable caching. (read_include_file): Don't use mmap, terminate buffers in '\r'. (purge_cache): Don't use munmap. * cpphash.h (CPP_BUF_COLUMN): Update. (lexer_state): Remove lexing_comment. (struct _cpp_line_note): New. (struct cpp_buffer): New members cur_note, notes_used, notes_cap, next_line and need_line. Remove col_adjust and saved_flags. (_cpp_process_line_notes, _cpp_clean_line, _cpp_get_fresh_line, _cpp_skip_block_comment, scan_out_logical_line): New. (_cpp_init_mbchar): Remove. * cppinit.c (init_library): Remove call to _cpp_init_mbchar. (cpp_read_main_file): Set line to 1 earlier. (post_options): -traditional-cpp doesn't want trigraphs. * cpplex.c (MULTIBYTE_CHARS): Remove code predicated on this. (add_line_note, _cpp_clean_line, _cpp_process_line_notes, _cpp_get_fresh_line): New. (handle_newline, skip_escaped_newlines, trigraph_p, continue_after_nul, _cpp_init_mbchar): Remove. (get_effective_char): Update. (_cpp_skip_block_comment): Rename from skip_block_comment, simplify. (skip_line_comment): Simplify. (skip_whitespace, parse_identifier, parse_slow, parse_number, parse_string): Update. (cpp_lex_direct): Use clean lines and process line notes. Update. (cpp_interpret_charconst): No MULTIBYTE_CHARS. * cpplib.c (prepare_directive_trad): Call scan_out_logical_line directly. (_cpp_handle_directive): Don't set saved_flags. (run_directive, destringize_and_run, cpp_define, cpp_define_builtin, cpp_undef, handle_assertion, cpp_push_buffer): Update. (_cpp_pop_buffer): Free notes. * cppmacro.c (builtin_macro, paste_tokens): \n terminate buffer. * cpppch.c (cpp_read_state): \n terminate buffer. * cpptrad.c (skip_escaped_newlines, handle_newline): Remove. (copy_comment): Use _cpp_skip_block_comment. (skip_whitespace, lex_identifier, _cpp_read_logical_line_trad): Simplify. (_cpp_overlay_buffer, _cpp_remove_overlay, push_replacement_text, save_replacement_text): Update. (scan_out_logical_line): Update to use clean lines and process line notes. * fix-header.c (read_scan_file): Update. testsuite: * gcc.dg/cpp/_Pragma4.c: Remove stray space. * gcc.dg/cpp/trad/escaped-eof.c: Correct line number. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65808 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (read_scan_file): Defer switch processing.neil2003-04-031-4/+5
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65216 138bc75d-0d04-0410-961f-82ee72b054a4
* Various cleanups to help compile server.bothner2003-03-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64617 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (read_scan_file): Need to malloc arguments to add_path.neil2003-03-171-8/+10
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64470 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (read_scan_file): Read main file before handling -D.neil2003-03-151-2/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64404 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (read_scan_file): Fix thinko.neil2003-03-151-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64401 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in: Update.neil2003-03-151-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64398 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (read_scan_file): Don't reference simplify_path.geoffk2003-03-021-1/+0
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63684 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,neil2003-03-011-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63612 138bc75d-0d04-0410-961f-82ee72b054a4
* Merge basic-improvements-branch to trunkzack2002-12-161-1/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60174 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,neil2002-08-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56239 138bc75d-0d04-0410-961f-82ee72b054a4
* * defaults.h (obstack_chunk_alloc, obstack_chunk_free):neil2002-07-231-2/+0
| | | | | | | | | | | | | | | Default definition. * gcse.c: Don't define obstack_chunk_free. * collect2.c, conflict.c, df.c, diagnostic.c, fix-header.c, flow.c, gcc.c, genattrtab.c, genautomata.c, genflags.c, gensupport.c, integrate.c, loop.c, ra.c, read-rtl.c, regrename.c, reload1.c, reorg.c, tlink.c, tree.c, config/arm/arm.c, objc/objc-act.c: Don't define obstack macros. cp: * class.c, method.c, pt.c, search.c: Similarly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55665 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpperror.c (_cpp_begin_message): No special casingneil2002-05-231-3/+3
| | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53765 138bc75d-0d04-0410-961f-82ee72b054a4
* * final.c: Fix formatting.kazu2002-05-171-10/+10
| | | | | | | | | | * fix-header.c: Likewise. * flow.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53563 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpperror.c (print_location): Don't print include chainneil2002-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * collect2.c (is_ctor_dtor): Const-ify.ghazi2001-12-271-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | * m88k-protos.c (output_file_start): Likewise. * m88k.c (m88k_lang_independent_options, output_options, output_file_start): Likewise. * fix-header.c (files_to_ignore, std_include_entry, include_entry, std_include_table, main): Likewise. * protoize.c (longopts): Likewise. * regclass.c (int_reg_class_contents): Likewise. * toplev.c (dump_file, f_options, W_options): Make static. (lang_independent_options, f_options, W_options): Const-ify. * tree-dump.c (dump_file_info): Likewise. * unroll.c (_factor): Make static. java: * chartables.h: Const-ify. * gjavah.c (options): Likewise. * jcf-dump.c (options): Likewise. * jv-scan.c (options): Likewise. * lex.c (java_start_char_p, java_part_char_p): Likewise. * parse.y (binop_lookup): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48322 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (main): Move inf_buffer termination and inf_limitkenner2001-11-241-3/+5
| | | | | | | calculation to after read. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47307 138bc75d-0d04-0410-961f-82ee72b054a4
* White-space changekenner2001-11-151-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47069 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (read_scan_file): Update.neil2001-11-151-2/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47055 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-format.c (maybe_read_dollar_number): Use safe-ctype macrosghazi2001-10-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and/or fold extra calls into fewer ones. * collect2.c (dump_file): Likewise. * cppexp.c (parse_number): Likewise. * cpplex.c (_cpp_lex_direct): Likewise. * final.c (output_asm_insn, asm_fprintf): Likewise. * fix-header.c (inf_scan_ident, main): Likewise. * fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix): Likewise. * fold-const.c (real_hex_to_f): Likewise. * gen-protos.c (parse_fn_proto): Likewise. * genattrtab.c (check_attr_test, check_attr_value): Likewise. * genrecog.c (change_state, write_action): Likewise. * gensupport.c (shift_output_template): Likewise. * local-alloc.c (requires_inout): Likewise. * mips-tfile.c (IS_ASM_IDENT): Likewise. * protoize.c (is_id_char, main): Likewise. * real.c (asctoeg): Likewise. * recog.c (asm_operand_ok): Likewise. * reload.c (find_reloads): Likewise. * scan.c (scan_identget_token): Likewise. * sched-vis.c (print_value): Likewise. * stringpool.c (ggc_alloc_string): Likewise. * toplev.c (read_integral_parameter, decode_g_option): Likewise. * tradcif.y (parse_number, yylex, parse_escape): Likewise. * tradcpp.c (rescan): Likewise. * tree.c (clean_symbol_name): Likewise. * varasm.c (decode_reg_name): Likewise. * alpha.h (ASM_OUTPUT_ASCII): Likewise. * darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise. * dsp16xx.h (ASM_OUTPUT_ASCII): Likewise. * m88k.c (output_ascii): Likewise. * m88k.h (OVERRIDE_OPTIONS): Likewise. * mcore.h (REG_CLASS_FROM_LETTER): Likewise. * ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise. * sh.h (REG_CLASS_FROM_LETTER): Likewise. cp: * xref.c (GNU_xref_member): Use safe-ctype macros and/or fold extra calls into fewer ones. f: * bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra calls into fewer ones. * implic.c (ffeimplic_lookup_): Likewise. * intdoc.c (dumpimp): Likewise. * intrin.c (ffeintrin_init_0): Likewise. * lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_): Likewise. * lex.h (ffelex_is_firstnamechar): Likewise. * target.c (ffetarget_integerhex): Likewise. java: * gjavah.c (jni_print_char, decode_signature_piece): Use safe-ctype macros and/or fold extra calls into fewer ones. * lex.c (java_read_unicode, java_lex): Likewise. * lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT, JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise. * mangle_name.c (append_unicode_mangled_name, unicode_mangling_length): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46397 138bc75d-0d04-0410-961f-82ee72b054a4
* 2001-10-10 Stan Shebs <shebs@apple.com>shebs2001-10-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46173 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-lex.c (cb_def_pragma): Update.neil2001-09-241-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (c_lex): Update, and skip padding. * cppexp.c (lex, parse_defined): Update, remove unused variable. * cpphash.h (struct toklist): Delete. (union utoken): New. (struct cpp_context): Update. (struct cpp_reader): New members eof, avoid_paste. (_cpp_temp_token): New. * cppinit.c (cpp_create_reader): Update. * cpplex.c (_cpp_temp_token): New. (_cpp_lex_direct): Add PREV_WHITE when parsing args. (cpp_output_token): Don't print leading whitespace. (cpp_output_line): Update. * cpplib.c (glue_header_name, parse_include, get__Pragma_string, do_include_common, do_line, do_ident, do_pragma, do_pragma_dependency, _cpp_do__Pragma, parse_answer, parse_assertion): Update. (get_token_no_padding): New. * cpplib.h (CPP_PADDING): New. (AVOID_LPASTE): Delete. (struct cpp_token): New union member source. (cpp_get_token): Update. * cppmacro.c (macro_arg): Convert to use pointers to const tokens. (builtin_macro, paste_all_tokens, paste_tokens, funlike_invocation_p, replace_args, quote_string, stringify_arg, parse_arg, next_context, enter_macro_context, expand_arg, _cpp_pop_context, cpp_scan_nooutput, _cpp_backup_tokens, _cpp_create_definition): Update. (push_arg_context): Delete. (padding_token, push_token_context, push_ptoken_context): New. (make_string_token, make_number_token): Update, rename. (cpp_get_token): Update to handle tokens as pointers to const, and insert padding appropriately. * cppmain.c (struct printer): New member prev. (check_multiline_token): Constify. (do_preprocessing, cb_line_change): Update. (scan_translation_unit): Update to handle spacing. * scan-decls.c (get_a_token): New. (skip_to_closing_brace, scan_decls): Update. * fix-header.c (read_scan_file): Update. * doc/cpp.texi: Update. * gcc.dg/cpp/macro10.c: New test. * gcc.dg/cpp/strify3.c: New test. * gcc.dg/cpp/spacing1.c: Add tests. * gcc.dg/cpp/19990703-1.c: Remove bogus test. * gcc.dg/cpp/20000625-2.c: Fudge to pass. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45793 138bc75d-0d04-0410-961f-82ee72b054a4
* * emit-rtl.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.aj2001-08-271-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * errors.c: Likewise. * final.c: Likewise. * dwarf2asm.c: Likewise. * doprint.c (checkit): Likewise. * diagnostic.c: Likewise. * collect2.c: Likewise. * calls.c: Likewise. * c-semantics.c (build_stmt): Likewise. * c-format.c (status_warning): Likewise. * c-errors.c (pedwarn_c99): Likewise. * builtins.c (validate_arglist): Likewise. * config/pj/pj.c (pj_printf): Likewise. * fix-header.c: Likewise. * gcc.c: Likewise. * gcov.c (fnotice): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c: Likewise. * protoize.c (notice): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c: Likewise. * tradcpp.c: Likewise. * tree.c: Likewise. * cp/tree.c (build_min_nt): Likewise. (build_min): Likewise. * cp/lex.c: Likewise. * cp/errfn.c: Likewise. * cp/rtti.c (create_pseudo_type_info): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45185 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpperror.c (print_location): Don't show _Pragma.neil2001-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45112 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpperror.c (print_location): Don't take a file name; use theneil2001-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44986 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (cb_file_change): Update prototype.neil2001-08-121-4/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44824 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in (CPPLIB_H): New, so that dependencies on cpplib.hneil2001-08-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are also on line-map.h. * cppfiles.c (stack_include_file): Update. * cpphash.h (struct cpp_buffer): New member return_at_eof. (_cpp_pop_buffer): New. * cppinit.c (cpp_destroy, cpp_finish): Update. (do_includes): Mark each buffer to return at EOF. * cpplex.c (_cpp_lex_token): Pop buffers at EOF. Continue or return as requested. * cpplib.c (run_directive, do_line, cpp_push_buffer): Update. (cpp_pop_buffer): Rename _cpp_pop_buffer. Stop skipping. * cpplib.h (cpp_pop_buffer): Remove. (cpp_scan_buffer_nooutput): Rename cpp_scan_nooutput. * cppmacro.c (cpp_scan_buffer_nooutput): Similarly. No need to pop buffers. * cppmain.c (scan_buffer): Rename scan_translation_unit. No need to pop buffers. (do_preprocessing): Update. * fix-header.c (read_scan_file): Update. No need to pop buffers. * c-parse.in (_yylex): Similarly. * scan-decls.c (scan_decls): Similarly. * line-map.h: Update comments. * cp/spew.c (read_token): No need to pop buffers. * objc/Make-lang.in (objc-act.o): Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44634 138bc75d-0d04-0410-961f-82ee72b054a4
* * line-map.c: New.neil2001-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44584 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in (OBJS, LIBCPP_OBJS, LIBCPP_DEPS,neil2001-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cpplib.o, cpphash.o, fix-header): Update. (hashtable.o): New target. * c-common.h: Include cpplib.h. Define C_RID_CODE and struct c_common_identifier here. * c-lang.c (c_init_options): Update. Call set_identifier_size. * c-lex.c (c_lex): Update. * c-pragma.h: Update. * c-tree.h (struct lang_identifier): Contain c_common_identifier. Delete rid_code. (C_RID_CODE): Delete. * cpphash.c: Rewrite to use hashtable.c. * cpphash.h: Update include guards. (struct cpp_reader): Remove hashtab. hash_ob and buffer_ob are no longer pointers. Add hash_table and our_hashtable. (HASHSTEP, _cpp_init_hashtable, _cpp_lookup_with_hash): Delete. (_cpp_cleanup_hashtable): Rename _cpp_destroy_hashtable. (_cpp_cleanup_stacks): Rename _cpp_init_directives. * cppinit.c (cpp_create_reader): Update. * cpplex.c (cpp_ideq, parse_identifier, cpp_output_token): Update. (cpp_interpret_charconst): Eliminate warning. * cpplib.c (do_pragma, do_endif, push_conditional, cpp_push_buffer, cpp_pop_buffer): Update. (_cpp_init_stacks): Rename cpp_init_directives. (_cpp_cleanup_stacks): Remove. * cpplib.h: Update include guards. Include tree-core.h and c-rid.h. (cpp_hashnode, cpp_token, NODE_LEN, NODE_NAME, cpp_forall_identifiers, cpp_create_reader): Update. (C_RID_CODE, cpp_make_node): New. (c_common_identifier): New identifier node for C front ends. * cppmain.c (main): Update. * fix-header.c (read_scan_file): Update. * flags.h (id_clash_len): Make unsigned. * ggc.h (ggc_mark_nonnull_tree): New. * hashtable.c: New. * hashtable.h: New. * stringpool.c: Update comments and copyright. Update to use hashtable.c. * toplev.c (approx_sqrt): Move to hashtable.c. (id_clash_len): Make unsigned. * toplev.h (ident_hash): New. * tree.c (gcc_obstack_init): Move to hashtable.c. * tree.h: Include hashtable.h. (IDENTIFIER_POINTER, IDENTIFIER_LENGTH): Update. (GCC_IDENT_TO_HT_IDENT, HT_IDENT_TO_GCC_IDENT): New. (struct tree_identifier): Update. (make_identifier): New. cp: * cp-tree.h (struct lang_identifier, C_RID_YYCODE): Update. (C_RID_CODE): Remove. * lex.c (cxx_init_options): Call set_identifier_size. Update. (init_parse): Don't do it here. objc: * objc-act.c (objc_init_options): Call set_identifier_size. Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42334 138bc75d-0d04-0410-961f-82ee72b054a4
* * cppexp.c (lex): Use NODE_NAME and NODE_LEN.neil2001-05-161-2/+2
| | | | | | | | | | | | | | | | | | | * cpphash.c (_cpp_lookup_with_hash): Similarly. * cpplex.c (cpp_ideq, parse_identifier, cpp_token_len, cpp_spell_token, cpp_output_token): Similarly. * cpplib.c (lex_macro_node, do_undef, do_pragma, do_pragma_poison, parse_assertion, do_assert): Similarly. * cppmacro.c (builtin_macro, parse_args, funlike_invocation_p, save_parameter, _cpp_create_definition, check_trad_stringification, cpp_macro_definition): Similarly. * cppmain.c (cb_define, cb_undef, dump_macro): Similarly. * c-lex.c (cb_undef, c_lex): Similarly. * fix-header.c (recognized_function): Similarly. * cpplib.h (NODE_LEN, NODE_NAME): New. (cpp_hashnode): Rename length len. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42174 138bc75d-0d04-0410-961f-82ee72b054a4
* Add missing blankskenner2001-02-031-3/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39431 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (read_scan_file): s/pfile/scan_in/. Sorry!neil2001-01-131-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38973 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (read_scan_file): Use cpp_get_callbacks andneil2001-01-131-3/+8
| | | | | | | | | | cpp_get_options rather than dereferencing pfile and using CPP_OPTION. * scan-decls.c (scan_decls): Use return value of cpp_pop_buffer rather than CPP_BUFFER. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38972 138bc75d-0d04-0410-961f-82ee72b054a4
* * fix-header.c (read_scan_file): s/pfile/scan_in/.neil2001-01-071-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38778 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-lang.c (c_post_options): Call cpp_post_options.neil2001-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * cppmain.c (main): Similarly. * fix-header.c (read_scan_file): Similarly. * cp/decl2.c (cxx_post_options): Similarly. * objc/objc-act.c (objc_post_options): Similarly. * cppinit.c (cpp_start_read): Move option consistency checks to cpp_post_options. Don't call init_dependency_output. If needed, add default target and main file dependency. (OPT_MD, OPT_MMD): Remove. (OPT_MF): New. (cpp_handle_option): Update for OPT_* changes. (cpp_post_options): New. (init_dependency_output): Command line -MF overrides environment variables. Don't set default target etc. Suppress output if dependencies are going to stdout. (print_help): Update. * cpplib.h (cpp_post_options): New. * gcc.c (cpp_options): Update for -MD, -MMD, -MF. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38777 138bc75d-0d04-0410-961f-82ee72b054a4