Skip to content
Snippets Groups Projects
  1. Jul 31, 2008
    • Jakub Jelinek's avatar
      re PR preprocessor/36649 (-H option doesn't work as expected) · affa55c6
      Jakub Jelinek authored
      	PR preprocessor/36649
      	* files.c (struct report_missing_guard_data): New type.
      	(report_missing_guard): Put paths into an array instead of printing
      	them right away.  Return 1 rather than 0.
      	(report_missing_guard_cmp): New function.
      	(_cpp_report_missing_guards): Sort and print paths gathered by
      	report_missing_guard callback.
      
      	* gcc.dg/pch/cpp-3.hs: Add include guards.
      	* gcc.dg/pch/cpp-3a.h: Likewise.
      	* gcc.dg/pch/cpp-3b.h: Likewise.
      	* gcc.dg/cpp/mi8.c: New test.
      	* gcc.dg/cpp/mi8a.h: New file.
      	* gcc.dg/cpp/mi8b.h: New file.
      	* gcc.dg/cpp/mi8c.h: New file.
      	* gcc.dg/cpp/mi8d.h: New file.
      
      From-SVN: r138432
      affa55c6
  2. Apr 21, 2008
    • Tom Tromey's avatar
      re PR preprocessor/33415 (Can't compile .cpp file with UTF-8 BOM.) · 688e7a53
      Tom Tromey authored
      libcpp
      	PR libcpp/33415:
      	* charset.c (_cpp_convert_input): Add buffer_start argument.
      	Ignore UTF-8 BOM if seen.
      	* internal.h (_cpp_convert_input): Add argument.
      	* files.c (struct _cpp_file) <buffer_start>: New field.
      	(destroy_cpp_file): Free buffer_start, not buffer.
      	(_cpp_pop_file_buffer): Likewise.
      	(read_file_guts): Update.
      gcc/testsuite
      	PR libcpp/33415:
      	* gcc.dg/cpp/pr33415.c: New file.
      
      From-SVN: r134507
      688e7a53
  3. Apr 01, 2008
    • Jakub Jelinek's avatar
      re PR pch/13675 (#including a precompiled header more than once in the same unit fails) · d4c32e1d
      Jakub Jelinek authored
      	PR pch/13675
      	* files.c (struct _cpp_file): Remove pch field.
      	(pch_open_file): Don't set file->pch, just file->pchname.
      	(should_stack_file): After pfile->cb.read_pch call
      	free pchname and clear pchname, don't close file->fd.
      	Test file->pchname instead of file->pch.  Don't close fd after cb.
      	(_cpp_stack_include): Test file->pchname instead of file->pch.
      
      	* c-pch.c (c_common_read_pch): On error close (fd) resp. fclose (f).
      
      From-SVN: r133790
      d4c32e1d
  4. Dec 06, 2007
    • Tom Tromey's avatar
      re PR c/29172 (--combine can't handle #pragma once) · 97f6bd40
      Tom Tromey authored
      gcc
      	PR c/29172:
      	* c-opts.c (c_common_parse_file): Call cpp_clear_file_cache.
      libcpp
      	PR c/29172:
      	* internal.h (struct cpp_reader) <file_hash_entries>: Changed
      	type.
      	<file_hash_entries_allocated, file_hash_entries_used>: Removed.
      	* files.c (FILE_HASH_POOL_SIZE): New macro.
      	(struct file_hash_entry_pool): New.
      	(destroy_all_cpp_files): New function.
      	(allocate_file_hash_entries): Allocate a file_hash_entry_pool.
      	(new_file_hash_entry): Update.
      	(free_file_hash_entries): New function.
      	(_cpp_cleanup_files): Call free_file_hash_entries and
      	destroy_all_cpp_files.
      	(cpp_clear_file_cache): New function.
      	* include/cpplib.h (cpp_clear_file_cache): Declare.
      
      From-SVN: r130656
      97f6bd40
  5. Nov 16, 2007
  6. Nov 12, 2007
    • Tom Tromey's avatar
      re PR c++/17577 (#pragma implementation no longer diagnoses use after file to which it applies) · f1e20710
      Tom Tromey authored
      gcc/cp
      	PR c++/17577:
      	* lex.c (handle_pragma_implementation): Use cpp_included_before.
      gcc/testsuite
      	PR c++/17577:
      	* g++.dg/ext/pr17577.h: New file.
      	* g++.dg/ext/pr17577.C: New file.
      libcpp
      	PR c++/17557:
      	* include/cpplib.h (cpp_included_before): Declare.
      	* files.c (struct file_hash_entry) <location>: New field.
      	(_cpp_find_file): Initialize new field.
      	(make_cpp_dir): Likewise.
      	(cpp_included_before): New function.
      
      From-SVN: r130093
      f1e20710
  7. Jul 30, 2007
    • Ollie Wild's avatar
      directives-only.c: New file. · ccfc4c91
      Ollie Wild authored
      	libcpp/
      	* directives-only.c: New file.
      	* internal.h (struct _cpp_dir_only_callbacks): New.
      	(_cpp_preprocess_dir_only): New function.
      	* directives.c (_cpp_handle_directive): Check directives_only before
      	disabling execution of indented directives.
      	* files.c (_cpp_stack_file): Add directives_only check.
      	* include/cpplib.h (struct cpp_options): Add directives_only.
      	(cpp_init_special_builtins): New function.
      	* init.c (cpp_init_special_builtins): New function.
      	(cpp_init_builtins): Move builtin_array initialization to
      	cpp_init_special_builtins.
      	(post_options): Check directives_only before setting
      	pfile->state.prevent_expansion = 1.
      	* macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
      	is expanded inside a directive while -fdirectives-only is enabled.
      	* Makefile.in (libcpp_a_OBJS): Add directives-only.o.
      	(libcpp_a_SOURCES): Add directives-only.c.
      
      	gcc/
      	* c-ppoutput.c (print_lines_directives_only): New function.
      	(scan_translation_unit_directives_only): New function.
      	(preprocess_file): Add call to scan_translation_unit_directives_only.
      	* c-opts.c (c_common_handle_option): Add OPT_fdirectives_only.
      	(sanitize_cpp_opts): Add default flag_dump_macros setting for
      	-fdirectives-only.  Add errors for -fdirectives-only conflict with
      	-Wunused-macros and -traditional.
      	(finish_options): Add builtin macro initialization for
      	-fdirectives-only + -fpreprocessed.
      	* c.opt (fdirectives-only): New.
      	* doc/cppopts.texi (fdirectives-only): New.
      
      	gcc/testsuite/
      	* gcc.dg/cpp/counter-2.c: New test.
      	* gcc.dg/cpp/counter-3.c: New test.
      	* gcc.dg/cpp/dir-only-1.c: New test.
      	* gcc.dg/cpp/dir-only-1.h: New file.
      	* gcc.dg/cpp/dir-only-2.c: New test.
      	* gcc.dg/cpp/dir-only-3.c: New test.
      	* gcc.dg/cpp/dir-only-3a.h: New file.
      	* gcc.dg/cpp/dir-only-3b.h: New file.
      	* gcc.dg/cpp/dir-only-4.c: New test.
      	* gcc.dg/cpp/dir-only-5.c: New test.
      	* gcc.dg/cpp/dir-only-6.c: New test.
      
      From-SVN: r127066
      ccfc4c91
  8. Jun 17, 2007
  9. Jun 16, 2007
  10. Jun 09, 2007
  11. May 21, 2007
    • Ian Lance Taylor's avatar
      internal.h (struct cpp_reader): Add new fields: nonexistent_file_hash and nonexistent_file_ob. · 0b4cafec
      Ian Lance Taylor authored
      	* internal.h (struct cpp_reader): Add new fields:
      	nonexistent_file_hash and nonexistent_file_ob.
      	* files.c: Include "obstack.h".
      	(find_file_in_dir): Before trying to open the file, look up the
      	path name in the hash table of nonexistent files.  After failing
      	to open the file, add the path name to the hash table.
      	(_cpp_find_file): Cache the results of looking up the file name
      	starting with the quote and bracket chain heads, if we can.
      	(nonexistent_file_hash_eq): New static function.
      	(_cpp_init_files): Initialize pfile->nonexistent_file_hash and
      	pfile->nonexistent_file_ob.
      	(_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
      	pfile->nonexistent_file_ob.
      
      From-SVN: r124929
      0b4cafec
  12. Feb 18, 2006
    • Grigory Zagorodnev's avatar
      cpp.texi (__TIMESTAMP__): Document. · be8ac3e2
      Grigory Zagorodnev authored
      2006-02-17  Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
      
      gcc/ChangeLog:
           * doc/cpp.texi (__TIMESTAMP__): Document.
      
      libcpp/ChangeLog:
           * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
           * files.c (_cpp_get_file_stat): New function.
           * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
           * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
           * internal.h (_cpp_get_file_stat): Prototype.
           (struct cpp_buffer): Add timestamp.
      
      gcc/testsuite/ChangeLog:
           * gcc.dg/cpp/undef3.c: New test.
           * gcc.dg/cpp/trad/builtins2.c: New test.
      
      From-SVN: r111232
      be8ac3e2
  13. Nov 04, 2005
  14. Oct 21, 2005
    • James E Wilson's avatar
      Fix bug with -MM -MG. · 6568f34b
      James E Wilson authored
      PR preprocessor/15220
      * files.c (_cpp_find_file): New parameter angle_brackets.  Fix all
      callers.  Pass to open_file_failed.
      (open_file_failed): New parameter angle_brackets.  Fix all callers.
      Use in print_dep assignment.
      * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
      * internal.h (_cpp_find_file): Add new parm to declaration.
      
      From-SVN: r105757
      6568f34b
  15. Aug 30, 2005
    • Jakub Jelinek's avatar
      re PR preprocessor/20348 (File not included when file with same name is included before) · f5eab47e
      Jakub Jelinek authored
      	PR preprocessor/20348
      	PR preprocessor/20356
      	* files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
      	2004-06-05 changes.
      
      	* gcc.dg/cpp/pr20348.c: New test.
      	* gcc.dg/cpp/pr20348.h: New file.
      	* gcc.dg/cpp/inc/pr20348.h: New file.
      	* gcc.dg/cpp/inc/pr20348-aux.h: New file.
      	* gcc.dg/cpp/pr20356.c: New test.
      	* gcc.dg/cpp/pr20356.h: New file.
      	* gcc.dg/cpp/inc/pr20356.h: New file.
      	* gcc.dg/cpp/inc/pr20356-aux.h: New file.
      
      From-SVN: r103629
      f5eab47e
  16. Jun 29, 2005
  17. May 28, 2005
    • Gabriel Dos Reis's avatar
      configure.ac: Check declarations for asprintf and vasprintf. · c3f829c1
      Gabriel Dos Reis authored
      	* configure.ac: Check declarations for asprintf and vasprintf.
      	* config.in: Regenerate.
      	* configure: Likewise.
      
      	* charset.c (conversion_loop): Use XRESIZEVEC.
      	(convert_no_conversion): Likewise.
      	(convert_using_iconv): Likewise.
      	(init_iconv_desc): Cast return value of alloca.
      	(cpp_host_to_exec_charset): Use XNEWVEC.
      	(emit_numeric_escape): Use XRESIZEVEC.
      	(cpp_interpret_string): Use XNEWVEC.
      	(cpp_interpret_string): Use XRESIZEVEC.
      	(_cpp_interpret_identifier): Cast return value of alloca.
      	(_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
      	* directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
      	(parse_include): Use XNEWVEC.
      	(insert_pragma_entry): Rename local variable "new" to
      	"new_entry".
      	(save_registered_pragmas): Cast return value of xmemdup.
      	(destringize_and_run): Same for alloca.
      	(parse_assertion): Likewise.
      	(do_assert): Cast allocated storage to proper type.
      	(cpp_define): Likewise.
      	(_cpp_define_builtin): Likewise.
      	(cpp_undef): Likewise.
      	(handle_assertion): Likewise.
      	(cpp_push_buffer): Rename local variable "new" to "new_buffer".
      	* expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
      	(CPP_UMINUS): Likewise.
      	(struct cpp_operator): Rename from struct operator.
      	(_cpp_expand_op_stack): Use XRESIZEVEC.
      	* files.c (pch_open_file): Use XNEWVEC.
      	(pch_open_file): Use XRESIZEVEC.
      	(read_file_guts): Use XNEWVEC and XRESIZEVEC.
      	(dir_name_of_file): Use XNEWVEC.
      	(make_cpp_file): Use XCNEW.
      	(make_cpp_dir): Likewise.
      	(allocate_file_hash_entries): USE XNEWVEC.
      	(cpp_included): Cast return value of htab_find_with_hash.
      	(append_file_to_dir): Use XNEWVEC.
      	(read_filename_string): Likewise. Use XRESIZEVEC too.
      	(read_name_map): Cast return value of alloca.  Use XRESIZEVEC.
      	(remap_filename): Use XNEWVEC.
      	(struct pchf_entry): Move definition out of struct pchf_data.
      	(_cpp_save_file_entries): Use XCNEWVAR.
      	(_cpp_read_file_entries): Use XNEWVAR.
      	* identifiers.c (alloc_node): Use XOBNEW.
      	* init.c (cpp_create_reader): Use XCNEW.
      	(cpp_init_builtins): Cast of b->value to enum builtin_type.
      	(read_original_directory): Cast return value of alloca.
      	* lex.c (add_line_note): Use XRESIZEVEC.
      	(warn_about_normalization): Use XNEWVEC.
      	(_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
      	(new_buff): Use XNEWVEC.
      	* line-map.c (linemap_add): Use XRESIZEVEC.
      	* macro.c (builtin_macro): Cast return value of alloca.
      	(paste_tokens): Likewise.
      	(expand_arg): Use XNEWVEC and XRESIZEVEC.
      	(_cpp_save_parameter): Use XRESIZEVEC.
      	(create_iso_definition): Cast allocated storage to proper type.
      	(_cpp_create_definition): Likewise.
      	(cpp_macro_definition): Use XRESIZEVEC.
      	* makedepend.c (add_clm): Use XNEW.
      	(add_dir): Likewise.
      	* mkdeps.c (munge): Use XNEWVEC.
      	(deps_init): Use XCNEW.
      	(deps_add_target): Use XRESIZEVEC.
      	(deps_add_default_target): Cast return value of alloca.
      	(deps_add_dep): Use XRESIZEVEC.
      	(deps_add_vpath): Likewise.  Use XNEWVEC too.
      	(deps_restore): Likewise.
      	* pch.c (save_idents): Use XNEW and XNEWVEC.
      	(cpp_save_state): Use XNEW.
      	(count_defs): Cast return value of htab_find.
      	(write_defs): Likewise.
      	(cpp_write_pch_deps): Use XNEWVEC.
      	(collect_ht_nodes): Use XRESIZEVEC.
      	(cpp_valid_state): Use XNEWVEC.
      	(save_macros): Use XRESIZEVEC.  Cast return value of xmemdup.
      	* symtab.c (ht_create): Use XCNEW.
      	(ht_lookup_with_hash): Cast return value of obstack_copy0.
      	(ht_expand): Use XCNEWVEC.
      	* system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
      	(bool): Do not define if __cplusplus.
      
      From-SVN: r100295
      c3f829c1
  18. Apr 28, 2005
  19. Feb 14, 2005
  20. Feb 09, 2005
    • Mike Stump's avatar
      files.c (pchf_adder): Remove. · ecddfb39
      Mike Stump authored
              * files.c (pchf_adder): Remove.
              (struct pchf_adder_info): Likewise.
              (_cpp_save_file_entries): Write out all files so that #import works.
      
      From-SVN: r94755
      ecddfb39
  21. Jan 04, 2005
    • Geoffrey Keating's avatar
      Index: libcpp/ChangeLog · 942926ad
      Geoffrey Keating authored
      2005-01-03  Geoffrey Keating  <geoffk@apple.com>
      
      	* files.c (_cpp_find_file): Add files found by search_path_exhausted
      	to the list of all files.
      
      Index: gcc/testsuite/ChangeLog
      2005-01-03  Geoffrey Keating  <geoffk@apple.com>
      	    Robert Bowdidge <bowdidge@apple.com>
      
      	* gcc.dg/cpp/subframework1.c: New.
      	* gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/A.h: New.
      	* gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/B.h: New.
      	* gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/C.h: New.
      	* gcc.dg/cpp/frame/one.framework/Headers/one-includeSubs.h: New.
      
      Co-Authored-By: default avatarRobert Bowdidge <bowdidge@apple.com>
      
      From-SVN: r92883
      942926ad
  22. Dec 15, 2004
  23. Jul 16, 2004
  24. Jun 26, 2004
    • Zack Weinberg's avatar
      re PR preprocessor/15933 (Caching of include files breaks compilation) · e83d8d43
      Zack Weinberg authored
      	PR 15933
      	Partially revert patch of 2004-06-05.
      	* files.c (search_cache): Remove pfile argument.  Don't check
      	for file that would be found by "" or <> search here...
      	(_cpp_find_file): ...do it here, before calling find_file_in_dir.
      	Do not apply directory-of-current-file correction to files
      	found by this check.  Rearrange code slightly.
      
      From-SVN: r83714
      e83d8d43
  25. Jun 22, 2004
    • Geoffrey Keating's avatar
      c-opts.c (c_common_handle_option): Handle -fpch-preprocess. · c0d578e6
      Geoffrey Keating authored
      2004-06-21  Geoffrey Keating  <geoffk@apple.com>
      
      	* c-opts.c (c_common_handle_option): Handle -fpch-preprocess.
      	* c-common.h (flag_pch_preprocess): Declare.
      	(c_common_pch_pragma): Likewise.
      	* c-common.c (flag_pch_preprocess): New.
      	* c-pch.c (c_common_read_pch): Support -fpreprocess-only.
      	(c_common_pch_pragma): New.
      	* c-ppoutput.c (cb_read_pch): New.
      	(init_pp_output): Support -fpch-preprocess.
      	* c-pragma.c (init_pragma): Support #pragma GNUC pch_preprocess.
      	* c.opt (fpch-preprocess): New.
      	* gcc.c (cpp_options): When save-temps, pass -fpch-preprocess.
      	* doc/cppopts.texi: Document -fpch-preprocess.
      	* doc/invoke.texi (Precompiled Headers): Mention that
      	-fpreprocessed is safe for PCH.  Mention that if an option is
      	listed as safe that doesn't mean it does what you expect.
      
      Index: gcc/testsuite/ChangeLog
      2004-06-21  Geoffrey Keating  <geoffk@apple.com>
      
      	* gcc.dg/pch/save-temps-1.c: New file.
      	* gcc.dg/pch/save-temps-1.hs: New file.
      
      Index: libcpp/ChangeLog
      2004-06-21  Geoffrey Keating  <geoffk@apple.com>
      
      	* files.c (should_stack_file): Correct swapped parameters to call
      	to cb.read_pch.
      	* pch.c (cpp_valid_state): Handle -fpreprocessed.
      
      From-SVN: r83478
      c0d578e6
  26. Jun 05, 2004
    • Zack Weinberg's avatar
      Makefile.am: Add makedepend. · c6e83800
      Zack Weinberg authored
      libcpp:
      	* Makefile.am: Add makedepend.
      	* Makefile.in, aclocal.m4: Regenerate.
      	* charset.c: Insert a space to avoid a warning.
      	* directives.c: Include mkdeps.h.
      	(_cpp_handle_directive): Reenable macro expander if appropriate.
      	(undefine_macros): Inline body of _cpp_free_definition for speed.
      	Do not call undef callback or _cpp_warn_if_unused_macro.
      	(cpp_get_deps): New interface.
      	* files.c (search_cache): Add pfile argument.  Check for file
      	that would be found by "" or <> search here...
      	(_cpp_find_file): ...not here.  Correct recorded start_dir of
      	files found by directory-of-current-file search that would be
      	found by "" or <> search.
      	* init.c (cpp_add_dependency_target): Delete.
      	* internal.h (struct lexer_state): Add discarding_output flag.
      	* lex.c (lex_identifier): Compute hash function while scanning.
      	* macro.c (cpp_scan_nooutput): Disable macro expansion outside
      	directives.
      	* makedepend.c: New file.
      	* mkdeps.c (struct deps): Add vpath vector.
      	(apply_vpath, deps_add_vpath): New function.
      	(deps_free): Free vpath vector.
      	(deps_add_dep, deps_add_target): Use apply_vpath.
      	* symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
      	(ht_lookup_with_hash): New function.
      	* cpplib.h, mkdeps.h: Update prototypes.
      	* symtab.h: Update prototypes.
      	(HT_HASHSTEP, HT_FINISH): New macros.
      
      gcc:
      	* Makefile.in (MKDEPS_H): New shorthand.
      	(c-opts.o): Update dependencies.
      	* c-opts.c: Include mkdeps.h.
      	(handle_deferred_opts): Use cpp_get_deps and deps_add_target,
      	not cpp_add_dependency_target.
      
      From-SVN: r82654
      c6e83800
  27. May 24, 2004
    • Paolo Bonzini's avatar
      Makefile.def (host_modules): add libcpp. · 4f4e53dd
      Paolo Bonzini authored
      ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* Makefile.def (host_modules): add libcpp.
      	* Makefile.tpl: Add dependencies on and for libcpp.
      	* Makefile.in: Regenerate.
      	* configure.in: Add libcpp host module.
      	* configure: Regenerate.
      
      config/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* acx.m4 (ACX_HEADER_STDBOOL, ACX_HEADER_STRING):
      	From gcc.
      
      gcc/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	Move libcpp to the toplevel.
      	* Makefile.in: Remove references to libcpp files,
      	use CPPLIBS instead of libcpp.a.  Define SYMTAB_H
      	and change hashtable.h to that.
      	* aclocal.m4 (gcc_AC_HEADER_STDBOOL,
      	gcc_AC_HEADER_STRING, gcc_AC_C__BOOL): Remove.
      	* configure.ac (gcc_AC_C__BOOL, HAVE_UCHAR): Remove tests.
      	* configure: Regenerate.
      	* config.in: Regenerate.
      	* c-ppoutput.c: Include ../libcpp/internal.h instead of cpphash.h.
      	* cppcharset.c: Removed.
      	* cpperror.c: Removed.
      	* cppexp.c: Removed.
      	* cppfiles.c: Removed.
      	* cpphash.c: Removed.
      	* cpphash.h: Removed.
      	* cppinit.c: Removed.
      	* cpplex.c: Removed.
      	* cpplib.c: Removed.
      	* cpplib.h: Removed.
      	* cppmacro.c: Removed.
      	* cpppch.c: Removed.
      	* cpptrad.c: Removed.
      	* cppucnid.h: Removed.
      	* cppucnid.pl: Removed.
      	* cppucnid.tab: Removed.
      	* hashtable.c: Removed.
      	* hashtable.h: Removed.
      	* line-map.c: Removed.
      	* line-map.h: Removed.
      	* mkdeps.c: Removed.
      	* mkdeps.h: Removed.
      	* stringpool.h: Include symtab.h instead of hashtable.h.
      	* tree.h: Include symtab.h instead of hashtable.h.
      	* system.h (O_NONBLOCK, O_NOCTTY): Do not define.
      
      gcc/cp/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* Make-lang.in: No need to specify $(LIBCPP).
      
      gcc/java/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* Make-lang.in: Link in $(LIBCPP) instead of mkdeps.o.
      
      libcpp/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	Moved libcpp from the gcc subdirectory to the toplevel.
      	* Makefile.am: New file.
      	* Makefile.in: Regenerate.
      	* configure.ac: New file.
      	* configure: Regenerate.
      	* config.in: Regenerate.
      	* charset.c: Moved from gcc/cppcharset.c.  Add note about
      	brokenness of input charset detection.  Adjust for change
      	in name of cppucnid.h.
      	* errors.c: Moved from gcc/cpperror.c.  Do not include intl.h.
      	* expr.c: Moved from gcc/cppexp.c.
      	* files.c: Moved from gcc/cppfiles.c.  Do not include intl.h.
      	Remove #define of O_BINARY, it is in system.h.
      	* identifiers.c: Moved from gcc/cpphash.c.
      	* internal.h: Moved from gcc/cpphash.h.  Change header
      	guard name.  All other files adjusted to match name change.
      	* init.c: Moved from gcc/cppinit.c.
      	(init_library) [ENABLE_NLS]: Call bindtextdomain.
      	* lex.c: Moved from gcc/cpplex.c.
      	* directives.c: Moved from gcc/cpplib.c.
      	* macro.c: Moved from gcc/cppmacro.c.
      	* pch.c: Moved from gcc/cpppch.c.  Do not include intl.h.
      	* traditional.c: Moved from gcc/cpptrad.c.
      	* ucnid.h: Moved from gcc/cppucnid.h.  Change header
      	guard name.
      	* ucnid.pl: Moved from gcc/cppucnid.pl.
      	* ucnid.tab: Moved from gcc/cppucnid.tab.  Change header
      	guard name.
      	* symtab.c: Moved from gcc/hashtable.c.
      	* line-map.c: Moved from gcc.  Do not include intl.h.
      	* mkdeps.c: Moved from gcc.
      	* system.h: New file.
      
      libcpp/include/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* cpplib.h: Moved from gcc.  Change header guard name.
      	* line-map.h: Moved from gcc.  Change header guard name.
      	* mkdeps.h: Moved from gcc.  Change header guard name.
      	* symtab.h: Moved from gcc/hashtable.h.  Change header
      	guard name.
      
      libcpp/po/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* be.po: Extracted from gcc/po/be.po.
      	* ca.po: Extracted from gcc/po/ca.po.
      	* da.po: Extracted from gcc/po/da.po.
      	* de.po: Extracted from gcc/po/de.po.
      	* el.po: Extracted from gcc/po/el.po.
      	* es.po: Extracted from gcc/po/es.po.
      	* fr.po: Extracted from gcc/po/fr.po.
      	* ja.po: Extracted from gcc/po/ja.po.
      	* nl.po: Extracted from gcc/po/nl.po.
      	* sv.po: Extracted from gcc/po/sv.po.
      	* tr.po: Extracted from gcc/po/tr.po.
      
      From-SVN: r82199
      4f4e53dd
  28. May 05, 2004
    • Mike Stump's avatar
      darwin-c.c (add_framework): Copy the directory name as it can be freed later. · e3c287c9
      Mike Stump authored
      	* config/darwin-c.c (add_framework): Copy the directory name as it
      	can be freed later.  Also, ensure we always allocate enough room
      	for the cached framework information.
      	(find_subframework_header): Keep track of the directory where the
      	subframework header was found.
      	(framework_construct_pathname): Speed up by not trying to re-add a
      	framework.
      	* cppfiles.c (search_path_exhausted): Arrange for the missing
      	header callback to be able to set the directory where the header
      	was found.
      	(cpp_get_dir): Add.
      	* cpplib.h (missing_header_cb): Add a parameter.
      	(cpp_get_dir): Add.
      
      From-SVN: r81534
      e3c287c9
  29. May 03, 2004
  30. Apr 30, 2004
    • Kazu Hirata's avatar
      bb-reorder.c, [...]: Fix comment typos. · 1ae58c30
      Kazu Hirata authored
      	* bb-reorder.c, c-opts.c, cfglayout.c, cgraph.c, cgraphunit.c,
      	cppfiles.c, fold-const.c, ggc-zone.c, loop-doloop.c, optabs.c,
      	reg-stack.c, varasm.c, config/alpha/ev4.md,
      	config/alpha/ev5.md, config/alpha/ev6.md, config/arm/arm.c,
      	config/c4x/c4x.c, config/c4x/c4x.md, config/cris/cris.c,
      	config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.c,
      	config/frv/frv.h, config/frv/frv.md, config/h8300/h8300.c,
      	config/i386/i386.c, config/i386/i386.md, config/i386/winnt.c,
      	config/ia64/itanium2.md, config/ip2k/ip2k.c,
      	config/mips/mips.c, config/mips/mips.h, config/mips/sr71k.md,
      	config/pa/pa.c, config/s390/s390.c, config/sh/sh.c: Fix
      	comment typos.
      
      From-SVN: r81345
      1ae58c30
  31. Apr 23, 2004
    • Per Bothner's avatar
      line-map.h (struct line_maps): New field highest_line. · 500bee0a
      Per Bothner authored
      	* line-map.h (struct line_maps):  New field highest_line.
      	(linemap_position_for_column):  Make non-inline function.
      	(LINEMAP_POSITION_FOR_COLUMN):  New macro.
      	* line-map.c (linemap_init):  Clear highest_line field.
      	(linemap_add):  Set highest_line field.
      	(linemap_line_start):  Minor optimization - use highest_line field.
      	Reduce maximum column hint to 10000.  Update highest_line field.
      	(linemap_position_for_column):  Moved from line-map.h.  Optimize a bit.
      	* cpphash.h (struct cpp_reader):  Remove line field - instead use
      	line_table->highest_line.
      	(saved_line):  Remove unused field.
      	(CPP_INCREMENT_FILE):  Don't do linemap_lookup - just use newest map.
      	Use  line_table's highest_line field instead of cpp_reader's line.
      	* cpplib.c (start_directive):  Likewise use highest_line field.
      	(do_line, do_linemarker):  Likewise just use newest map.
      	(_cpp_do_file_change):  Don't need to set cpp_reader's line field.
      	* cpperror.c (cpp_error):  Likewise use highest_line field.
      	* cppfiles.c (open_file_failed:  Likewise.
      	(cpp_make_system_header):  Likewise use newest map and highest_line.
      	* cppinit.c (cpp_create_reader):  Don't initialize removed field.
      	* cpplex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
      	skip_line_comment, skip_whitespace, _cpp_get_fresh_line,
      	_cpp_lex_direct):  Likewise use highest_line.
      	(_cpp_lex_direct):  Use new LINEMAP_POSITION_FOR_COLUMN macro.
      	* cppmacro.c (_cpp_builtin_macro_text):  Likewise use highest_line,
      	and use newest map.
      	* cpppch.c (cpp_read_state):  Don't save+restore cpp_reader's line.
      	* cpptrad.c (_cpp_overlay_buffer):  Don't save cpp_reader's line.
      	(copy_comment, _cpp_scan_out_logical_line):  Likewise use highest_line.
      
      From-SVN: r81074
      500bee0a
  32. Mar 04, 2004
    • Mike Stump's avatar
      Add framework support for darwin. · 94d1613b
      Mike Stump authored
      	* 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.
      
      From-SVN: r78875
      94d1613b
  33. Feb 27, 2004
    • Kazu Hirata's avatar
      c-decl.c, [...]: Fix comment typos and formatting. · a1105617
      Kazu Hirata authored
      	* c-decl.c, c-ppoutput.c, combine.c, cppfiles.c, dwarf2out.c,
      	expr.c, fold-const.c, gcc.c, haifa-sched.c, loop-iv.c,
      	params.def, read-rtl.c, rtl.c, rtlanal.c, toplev.c: Fix
      	comment typos and formatting.  Follow spelling conventions.
      
      From-SVN: r78555
      a1105617
  34. Feb 18, 2004
    • Per Bothner's avatar
      re PR preprocessor/14103 (ICEs on "gcc -E -imacros foo.h baz.c") · 22234f56
      Per Bothner authored
      	* cpphash.h (struct cpp_buffer):  Restore return_at_eof field.  This
      	partly reverts my 2003-10-01 change, because we're back to logically
      	including <command line> inside the main line.
      	* cpplex.c (_cpp_get_fresh_line):  Check return_at_eof field.
      	* cppmacro.c (cpp_scan_nooutput):  Set return_at_eof of current buffer.
      	Fixes PR preprocessor/14103.
      
      	* cppfiles.c (_cpp_stack_include):  When appropriate decrement
      	line_table's highest_location, fixing LAST_SOURCE_LINE_LOCATION.
      	(cpp_push_include):  Don't need to increment pfile's line field.
      	* line-map.h (LAST_SOURCE_LINE_LOCATION):  Only decrement by 1.
      
      	* c-ppoutput.c (print struct):  New first_time field.
      	(init_pp_output):  Set print.first_time.
      	(pp_file_change):  Use print.first_time, rather than MAIN_FILE_P,
      	which is set also for (say) <command line>.  Clear print.first_time.
      
      	* cppfiles.c (struct _cpp_file):  Comment and type for pch field
      	does not match the code, so fix both.
      	(should_stack_file):  Inline include_pch_p function.
      	(include_pch_p):  Remove pointless function.
      
      	* cpphash.h (struct cpp_buffer):  Remove unused search_cached field.
      
      From-SVN: r78049
      22234f56
  35. Feb 11, 2004
    • Per Bothner's avatar
      Represent column numbers using line-map's source_location. · 12f9df4e
      Per Bothner authored
      	The "next available source_location" is now managed internally by
      	line-maps.c rather than by clients.
      	* line-map.h (struct line_map):  New field column_bits.
      	<from_line>:  Rename field to start_location.
      	(struct line_maps):  New fields highest_location and max_column_hint.
      	(linemap_check_files_exited):  New declaration.
      	(linemap_line_start):  New declaration.
      	(linemap_add):  Remove from_line parameter; use highest_location field.
      	(SOURCE_LINE, LAST_SOURCE_LINE):  Modify to use column_bits.
      	(SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION):  New macros.
      	(CURRENT_LINE_MAP):  Remove macro.
      	(linemap_position_for_column):  New inline function.
      	* line-map.c (linemap_init):  Clear new fields.
      	(linemap_check_files_exited):  New function, extracted from ...
      	(linemap_free):  Use linemap_check_files_exited.
      	(linemap_add):  Remove from_line parameter.  Various updates.
      	(linemap_line_start):  New function.
      	(linemap_lookeup):  Update for new field names.
      	* cpphash.h (struct cpp_reader) <map>:  Field removed.  Because
      	linemap_position_for_column may unpredictably change the current map,
      	it is cleaner and simpler for us to not cache it in cpp_reader.
      	(struct cpp_buffer):  New sysp field.
      	Changed warned_cplusplus_comments and from_stage3 to bitfields.
      	* cppinit.c (cpp_read_min_file):  pfile->map no longer exists.
      	* cpplib.c (do_line, do_linemarker, _cpp_do_file_change):  Get
      	current map using linemap_lookup.
      	(do_linemarker):  Also set buffer's sysp field.
      	(destringize_and_run):  No longer need to decrement current line.
      	* cppfiles.c (_cpp_stack_file):  Set sysp from and in buffer.
      	(search_path_head, open_file_failed):  Use buffer's sysp.
      	(cpp_make_system_header):  Get current map using linemap_lookup.
      	Also set buffer's sysp flag.
      	* cppmacro.c (_cpp_builtin_macro_text):  Likewise use linemap_lookup.
      	* cpphash.h (CPP_INCREMENT_LINE):  New macro.
      	(struct cpp_buffer):  Moved fields saved_cur, saved_rlimit to ...
      	(struct cpp_reader):  ... and adding saved_line_base field.
      	* cpptrad.c (_cpp_overlay_buffer, _cpp_remove_overlay):
      	Update accordingly.  Don't adjust line.
      	(_cpp_scan_out_logical_line):  Use CPP_INCREMENT_LINE.
      	* cpphash.c (CPP_IN_SYSTEM_HEADER):  Replaced macro by ...
      	(cpp_in_system_header):  ... new inline function, using buffer's sysp.
      	* cpperror.c (_cpp_begin_message):  Update to use cpp_in_system_header.
      	* cpplex.c (_cpp_lex_direct):  Likewise.
      	* cppmacro.c (_cpp_builtin_macro_text):  Likewise.
      	* cppmacro.c (_cpp_create_definition):  Use buffer's sysp field.
      	* cpplib.h (struct cpp_token):  Rename line field to src_loc.
      	Remove col field as it is now subsumed by src_loc.
      	* cpperror.c:  Update various field, parameter, and macro names.
      	(print_location):  If col==0, try SOURCE_COLUMN of line.
      	(cpp_error):  Use cur_token's src_loc field, rather than line+col.
      	* cpplib.c (do_diagnostic):  Token's src_loc fields replaces line+col.
      	* cpplex.c (_cpp_process_line_notes, _cpp_lex_direct,
      	_cpp_skip_block_comment):  Use CPP_INCREMENT_LINE.
      	(_cpp_temp_token):  Replace cpp_token's line+col fields by src_loc.
      	(_cpp_get_fresh_line):  Don't need to adjust line for missing newline.
      	(_cpp_lex_direct):  Use linemap_position_for_column.
      	* c-ppoutput.c (maybe_print_line, print_line):  Don't take map
      	parameter.  Instead get it from the line_table global.  Adjust callers.
      	(print):  Remove map field.  Replace line field to src_line.
      	(init_pp_output, account_for_newlines, maybe_print_line):  Adjust.
      	(cb_line_change):  Use SOURCE_COLUMN.  Minor optimizations.
      	(pp_file_change):  Use MAIN_FILE_P since we cannot checked print.map.
      	Use LAST_SOURCE_LINE_LOCATION to "catch up" after #include.
      	* cpptrad.c (copy_comment):  Rename variable.
      	* c-lex.c (map):  Remove static variable, for same reason we removed
      	cpp_reader's map field.
      	(cb_line_change, cb_def_pragma, cb_define, cb_undef):  Hence we need
      	to call linemap_lookup.
      	(cb_line_change):  Token's line field replaced by src_loc.
      	(fe_file_change):  Use MAINFILE_P and LAST_SOURCE_LINE macros.
      	Don't save new_map.
      
      	* cpphash.h, cpperror.c, cpplib.h:  Some renames of fileline to
      	source_location.
      
      From-SVN: r77663
      12f9df4e
  36. Feb 02, 2004
    • Eric Christopher's avatar
      [multiple changes] · 16dd5cfe
      Eric Christopher authored
      2004-02-02  Eric Christopher  <echristo@redhat.com>
                  Zack Weinberg  <zack@codesourcery.com>
      
              * c-opts.c (c_common_handle_option): Add -finput-charset.
              * c.opt: Ditto.
              * cppcharset.c (one_iso88591_to_utf8): Remove.
              (convert_iso88591_utf8): Ditto.
              (conversion_tab): Remove 8859-1 converter.
              (_cpp_input_to_utf8): Remove.
              (_cpp_init_iconv_buffer): Ditto.
              (_cpp_close_iconv_buffer): Ditto.
              (_cpp_convert_input): New function.
              (_cpp_default_encoding): Ditto.
              * cpphash.h: Add/remove prototypes for above.
              * cppfiles.c (read_file_guts): Use _cpp_convert_input.
              * cppinit.c (cpp_create_reader): Use _cpp_default_encoding
              for narrow execution and input character sets.
              * cpplib.c (cpp_push_buffer): Delete uses of removed functions.
              * doc/cppopts.texi: Document -finput-charset.
      
      2004-02-02 Eric Christopher  <echristo@redhat.com>
                 Zack Weinberg  <zack@codesourcery.com>
      
              * gcc.c-torture/execute/wchar_t-1.c: Add -finput-charset.
      
      2004-01-29  Eric Christopher  <echristo@redhat.com>
                  Zack Weinberg  <zack@codesourcery.com>
      
              * testsuite/22_locale/collate/compare/wchar_t/2.cc: Remove xfail. Use
              -finput-charset.
              * testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc: Ditto.
              * testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc: Ditto
              * testsuite/22_locale/collate/hash/wchar_t/2.cc: Ditto.
              * testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc: Ditto.
              * testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc: Ditto.
              * testsuite/22_locale/collate/transform/wchar_t/2.cc: Ditto.
              * testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc: Ditto.
              * testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc:
              Ditto.
      
      From-SVN: r77136
      16dd5cfe
  37. Jan 20, 2004
  38. Jan 17, 2004
    • Geoffrey Keating's avatar
      [multiple changes] · 73e61092
      Geoffrey Keating authored
      2004-01-15  Geoffrey Keating  <geoffk@apple.com>
      
      	* Makefile.in (MD5_H): New.
      	(fold-const.o): Depend on md5.h.
      	(dwarf2out.o): Likewise.
      	(cppfiles.o): Likewise.
      	* cppfiles.c: Include md5.h.
      	(should_stack_file): Check against list read from PCH file.
      	(struct pchf_data): New.
      	(pchf): New variable.
      	(struct pchf_adder_info): New.
      	(pchf_adder): New.
      	(pchf_save_compare): New.
      	(_cpp_save_file_entries): New.
      	(_cpp_read_file_entries): New.
      	(struct pchf_compare_data): New.
      	(pchf_compare): New.
      	(check_file_against_entries): New.
      	* cpphash.h (_cpp_save_file_entries): Prototype.
      	(_cpp_read_file_entries): Prototype.
      	* cpppch.c (cpp_write_pch_state): Write the list of headers.
      	(cpp_read_state): Read the list of headers.
      
      Index: testsuite/ChangeLog
      2004-01-16  Geoffrey Keating  <geoffk@apple.com>
      
      	* gcc.dg/pch/import-1.c: New.
      	* gcc.dg/pch/import-1.hs: New.
      	* gcc.dg/pch/import-1a.h: New.
      	* gcc.dg/pch/import-1b.h: New.
      	* gcc.dg/pch/import-1c.h: New.
      
      From-SVN: r76016
      73e61092
  39. Dec 31, 2003
  40. Dec 21, 2003
    • Kazu Hirata's avatar
      alias.c: Fix comment formatting. · 6614fd40
      Kazu Hirata authored
      	* alias.c: Fix comment formatting.
      	* alloc-pool.c: Likewise.
      	* bitmap.c: Likewise.
      	* bitmap.h: Likewise.
      	* bt-load.c: Likewise.
      	* c-common.c: Likewise.
      	* c-common.h: Likewise.
      	* c-decl.c: Likewise.
      	* c-opts.c: Likewise.
      	* c-pretty-print.c: Likewise.
      	* caller-save.c: Likewise.
      	* cfghooks.h: Likewise.
      	* cgraph.c: Likewise.
      	* collect2.c: Likewise.
      	* cppfiles.c: Likewise.
      	* cpplib.h: Likewise.
      	* dwarf2out.c: Likewise.
      	* dwarfout.c: Likewise.
      	* emit-rtl.c: Likewise.
      	* final.c: Likewise.
      	* function.c: Likewise.
      	* gcov.c: Likewise.
      	* gcse.c: Likewise.
      	* genemit.c: Likewise.
      	* ggc.h: Likewise.
      	* haifa-sched.c: Likewise.
      	* ifcvt.c: Likewise.
      	* libgcc2.h: Likewise.
      	* loop.c: Likewise.
      	* predict.h: Likewise.
      	* unwind-libunwind.c: Likewise.
      	* varasm.c: Likewise.
      
      From-SVN: r74907
      6614fd40
Loading