Skip to content
Snippets Groups Projects
  1. Jun 24, 2013
  2. Mar 06, 2013
    • Jakub Jelinek's avatar
      re PR middle-end/56461 (GCC is leaking lots of memory) · 28937f11
      Jakub Jelinek authored
      	PR middle-end/56461
      	* internal.h (struct cpp_buffer): Add to_free field.
      	(_cpp_pop_file_buffer): Add third argument.
      	* files.c (_cpp_stack_file): Set buffer->to_free.
      	(_cpp_pop_file_buffer): Add to_free argument.  Free to_free
      	if non-NULL, and if equal to file->buffer_start, also clear
      	file->buffer{,_start,_valid}.
      	* directives.c (_cpp_pop_buffer): Pass buffer->to_free
      	to _cpp_pop_file_buffer.
      
      From-SVN: r196497
      28937f11
  3. Mar 01, 2013
    • Jakub Jelinek's avatar
      re PR middle-end/56461 (GCC is leaking lots of memory) · 3b8af25b
      Jakub Jelinek authored
      	PR middle-end/56461
      	* files.c (_cpp_save_file_entries): Free result at the end.
      	* pch.c (cpp_string_free): New function.
      	(cpp_save_state): Use it in htab_create call.
      	(cpp_write_pch_deps): Free ss->defs.  Destroy ss->definedhash.
      
      From-SVN: r196394
      3b8af25b
  4. Feb 28, 2013
    • Jakub Jelinek's avatar
      files.c (_cpp_find_file): If returning early... · 15fd8332
      Jakub Jelinek authored
      	* files.c (_cpp_find_file): If returning early, before storing
      	something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
      	on it.  Access *hash_slot using void * type rather than
      	struct file_hash_entry * to avoid aliasing issues.
      
      From-SVN: r196356
      15fd8332
  5. Jan 14, 2013
  6. Dec 03, 2012
    • Jakub Jelinek's avatar
      re PR bootstrap/55380 (All search_line_fast implementations read beyond buffer) · f41e5bd1
      Jakub Jelinek authored
      	PR bootstrap/55380
      	PR other/54691
      	* files.c (read_file_guts): Allocate extra 16 bytes instead of
      	1 byte at the end of buf.  Pass size + 16 instead of size
      	to _cpp_convert_input.
      	* charset.c (_cpp_convert_input): Reallocate if there aren't
      	at least 16 bytes beyond to.len in the buffer.  Clear 16 bytes
      	at to.text + to.len.
      
      From-SVN: r194102
      f41e5bd1
  7. Nov 21, 2012
  8. Nov 16, 2012
    • Simon Baldwin's avatar
      cpplib.h (struct cpp_options): Add canonical_system_headers. · 5dc99c46
      Simon Baldwin authored
          * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
          * files.c (find_file_in_dir): Call maybe_shorter_path() only if
          canonical_system_headers is set.
          * init.c (cpp_create_reader): Initialize canonical_system_headers.
          * configure.ac: Add new --enable-canonical-system-headers.
          * configure: Regenerate.
          * config.in: Regenerate.
      
          * doc/cppopts.texi: Document -f[no-]canonical-system-headers.
          * doc/install.texi: Document --enable-canonical-system-headers.
      
          * c.opt: Add f[no-]canonical-system-headers.
          * c-opts.c (c_common_handle_option): Handle
          OPT_fcanonical_system_headers.
      
      From-SVN: r193569
      5dc99c46
  9. Oct 23, 2012
    • Joseph Myers's avatar
      gcc: · 1efcb8c6
      Joseph Myers authored
      	* config.gcc (*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu |
      	*-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu): Use
      	glibc-c.o in c_target_objs and cxx_target_objs.  Use t-glibc in
      	tmake_file.  Set target_has_targetcm.
      	(tilegx-*-linux*, tilepro-*-linux*): Append to c_target_objs and
      	cxx_target_objs rather than overriding previous value.
      	* config/glibc-c.c, config/t-glibc: New.
      	* doc/tm.texi.in (TARGET_C_PREINCLUDE): New @hook.
      	* doc/tm.texi: Regenerate.
      	* hooks.c (hook_constcharptr_void_null): New.
      	* hooks.h (hook_constcharptr_void_null): Declare.
      
      gcc/c-family:
      	* c-common.h (pch_cpp_save_state): Declare.
      	* c-target.def (c_preinclude): New hook.
      	* c-opts.c (done_preinclude): New.
      	(push_command_line_include): Handle default preincluded header.
      	(cb_file_change): Call pch_cpp_save_state when calling
      	push_command_line_include.
      	* c-pch.c (pch_ready_to_save_cpp_state, pch_cpp_state_saved)
      	(pch_cpp_save_state): New.
      	(pch_init): Call pch_cpp_save_state conditionally, instead of
      	calling cpp_save_state.
      
      gcc/testsuite:
      	* gcc.dg/c99-predef-1.c: New test.
      	* gcc.dg/cpp/cmdlne-dU-1.c, gcc.dg/cpp/cmdlne-dU-2.c,
      	gcc.dg/cpp/cmdlne-dU-3.c, gcc.dg/cpp/cmdlne-dU-4.c,
      	gcc.dg/cpp/cmdlne-dU-5.c, gcc.dg/cpp/cmdlne-dU-6.c,
      	gcc.dg/cpp/cmdlne-dU-7.c, gcc.dg/cpp/cmdlne-dU-8.c,
      	gcc.dg/cpp/cmdlne-dU-9.c, gcc.dg/cpp/cmdlne-dU-10.c,
      	gcc.dg/cpp/cmdlne-dU-11.c, gcc.dg/cpp/cmdlne-dU-12.c,
      	gcc.dg/cpp/cmdlne-dU-13.c, gcc.dg/cpp/cmdlne-dU-14.c,
      	gcc.dg/cpp/cmdlne-dU-15.c, gcc.dg/cpp/cmdlne-dU-16.c,
      	gcc.dg/cpp/cmdlne-dU-17.c, gcc.dg/cpp/cmdlne-dU-18.c,
      	gcc.dg/cpp/cmdlne-dU-19.c, gcc.dg/cpp/cmdlne-dU-20.c,
      	gcc.dg/cpp/cmdlne-dU-21.c, gcc.dg/cpp/cmdlne-dU-22.c,
      	gcc.dg/cpp/mi5.c, gcc.dg/cpp/multiline.c: Add -nostdinc to
      	dg-options.
      
      libcpp:
      	* files.c (struct _cpp_file): Add implicit_preinclude.
      	(pch_open_file): Allow a previously opened implicitly included
      	file.
      	(_cpp_find_file): Add implicit_preinclude argument.  Free file and
      	do not call open_file_failed if implicit_preinclude.  Store
      	implicit_preinclude value.
      	(_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
      	Update calls to _cpp_find_file.
      	(_cpp_stack_include): Handle IT_DEFAULT.
      	(cpp_push_default_include): New.
      	* include/cpplib.h (cpp_push_default_include): Declare.
      	* init.c (cpp_read_main_file): Update call to _cpp_find_file.
      	* internal.h (enum include_type): Add IT_DEFAULT.
      	(_cpp_find_file): Update prototype.
      
      From-SVN: r192715
      1efcb8c6
  10. Oct 15, 2012
  11. Apr 30, 2012
  12. Jan 09, 2012
    • Gary Funck's avatar
      re PR preprocessor/33919 (__BASE_FILE__ does not expand correctly when... · b492b686
      Gary Funck authored
      re PR preprocessor/33919 (__BASE_FILE__ does not expand correctly when included from the command line)
      
      libcpp/
      	PR preprocessor/33919
      	* files.c (_cpp_get_file_name): New. Implement file name
      	access function.
      	* internal.h (_cpp_get_file_name): New prototype.
      	* macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
      	to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
      
      gcc/testsuite/
      	PR preprocessor/33919
      	* gcc.dg/pr33919.c: New test.
      	* gcc.dg/pr33919-0.h: New test header file.
      	* gcc.dg/pr33919-1.h: Ditto.
      	* gcc.dg/pr33919-2.h: Ditto.
      
      From-SVN: r183003
      b492b686
  13. Oct 17, 2011
    • Tom Tromey's avatar
      Linemap infrastructure for virtual locations · 46427374
      Tom Tromey authored
      This is the first instalment of a set which goal is to track locations
      of tokens across macro expansions.  Tom Tromey did the original work
      and attached the patch to PR preprocessor/7263.  This opus is a
      derivative of that original work.
      
      This patch modifies the linemap module of libcpp to add virtual
      locations support.
      
      A virtual location is a mapped location that can resolve to several
      different physical locations.  It can always resolve to the spelling
      location of a token.  For tokens resulting from macro expansion it can
      resolve to:
        - either the location of the expansion point of the macro.
        - or the location of the token in the definition of the
        macro
        - or, if the token is an argument of a function-like macro,
        the location of the use of the matching macro parameter in
        the definition of the macro
      
      The patch creates a new type of line map called a macro map.  For every
      single macro expansion, there is a macro map that generates a virtual
      location for every single resulting token of the expansion.
      
      The good old type of line map we all know is now called an ordinary
      map.  That one still encodes spelling locations as it has always had.
      
      As a result linemap_lookup as been extended to return a macro map when
      given a virtual location resulting from a macro expansion.  The layout
      of structs line_map has changed to support this new type of map.  So
      did the layout of struct line_maps.  Accessor macros have been
      introduced to avoid messing with the implementation details of these
      datastructures directly.  This helped already as we have been testing
      different ways of arranging these datastructure.  Having to constantly
      adjust client code that is too tied with the internals of line_map and
      line_maps would have been even more painful.
      
      Of course, many new public functions have been added to the linemap
      module to handle the resolution of virtual locations.
      
      This patch introduces the infrastructure but no part of the compiler
      uses virtual locations yet.
      
      However the client code of the linemap data structures has been
      adjusted as per the changes.  E.g, it's not anymore reliable for a
      client code to manipulate struct line_map directly if it just wants to
      deal with spelling locations, because struct line_map can now
      represent a macro map as well.  In that case, it's better to use the
      convenient API to resolve the initial (possibly virtual) location to a
      spelling location (or to an ordinary map) and use that.
      
      This is the reason why the patch adjusts the Java, Ada and Fortran
      front ends.
      
      Also, note that virtual locations are not supposed to be ordered for
      relations '<' and '>' anymore.  To test if a virtual location appears
      "before" another one, one has to use a new operator exposed by the
      line map interface.  The patch updates the only spot (in the
      diagnostics module) I have found that was making the assumption that
      locations were ordered for these relations.  This is the only change
      that introduces a use of the new line map API in this patch, so I am
      adding a regression test for it only.
      
      From-SVN: r180081
      46427374
  14. Jun 02, 2011
  15. Apr 20, 2011
    • Jim Meyering's avatar
      remove useless if-before-free tests · 04695783
      Jim Meyering authored
      Change "if (E) free (E);" to "free (E);" everywhere except in the
      libgo/, intl/, zlib/ and classpath/ directories.
      Also transform equivalent variants like
      "if (E != NULL) free (E);" and allow an extra cast on the
      argument to free.  Otherwise, the tested and freed "E"
      expressions must be identical, modulo white space.
      
      From-SVN: r172785
      04695783
  16. Mar 25, 2011
    • Kai Tietz's avatar
      files.c (file_hash_eq): Use filename_cmp instead of strcmp. · 4489800d
      Kai Tietz authored
      2011-03-25  Kai Tietz  <ktietz@redhat.com>
      
      	* files.c (file_hash_eq): Use filename_cmp
      	instead of strcmp.
      	(nonexistent_file_hash_eq): Likewise.
      	(remap_filename): Likewise.
      	Handle absolute DOS-path,
      	(append_file_to_dir): Check for IS_DIR_SEPARATOR
      	instead of slash.
      	(read_name_map): Likewise.
      	* linemap.c (linemap_add): Use filename_cmp
      	instead of strcmp.
      	* mkdeps.c (apply_vpath): Use filename_ncmp
      	instead of strncmp.
      	(deps_restore): Use filename_cmp instead of
      	strcmp.
      	* init.c (read_original_directory): Use
      	IS_DIR_SEPARATOR instead of checking for slash.
      
      From-SVN: r171521
      4489800d
  17. Jan 03, 2011
  18. Apr 09, 2010
  19. Sep 22, 2009
  20. Sep 19, 2009
    • Chris Demetriou's avatar
      re PR preprocessor/28435 (-MMD vs not found system header (included from a system header)) · 74dc6a11
      Chris Demetriou authored
      [libcpp/ChangeLog]
      2009-09-18  Chris Demetriou  <cgd@google.com>
      
      	PR preprocessor/28435:
      	* include/cpplib.h (struct cpp_options): Add new member
      	deps.need_preprocessor_output.
      	* files.c (open_file_failed): If preprocessor output is needed
      	always report an error.
      
      [gcc/ChangeLog]
      2009-09-19  Chris Demetriou  <cgd@google.com>
      
      	PR preprocessor/28435:
      	* c-opts.c (c_common_handle_option): For -MD and -MMD, indicate
      	to cpplib that the preprocessor output is needed.
      
      [gcc/testsuite/ChangeLog]
      2009-09-19  Chris Demetriou  <cgd@google.com>
      
      	PR preprocessor/28435:
      	* gcc.dg/cpp/missing-header-MD.c: New test.
      	* gcc.dg/cpp/missing-header-MMD.c: New test.
      	* gcc.dg/cpp/missing-sysheader-MD.c: New test.
      	* gcc.dg/cpp/missing-sysheader-MMD.c: New test.
      
      From-SVN: r151879
      74dc6a11
  21. Jul 18, 2009
    • Jerry Quinn's avatar
      directives.c (do_linemarker, do_line): Use CPP_STRING for ignored enum value. · f1bf410c
      Jerry Quinn authored
      2009-07-17  Jerry Quinn  <jlquinn@optonline.net>
      
      	* directives.c (do_linemarker, do_line): Use CPP_STRING for
      	ignored enum value.
      	* files.c (find_file_in_dir): Add cast from void* to char*.
      	* symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
      	* Makefile.in: (WARN_CFLAGS): Use general and C-specific
      	warnings.
      	(CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
      	ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
      	COMPILER_FLAGS): New.
      	(DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
      	(COMPILE.base): Use COMPILER instead of CC.  Use COMPILER_FLAGS
      	instead of ALL_CFLAGS.
      	* configure.ac: Invoke AC_PROG_CXX.  Separate C-specific warnings
      	from other warnings.  Add -Wc++-compat to C-specific warnings.
      	Check for --enable-build-with-cxx.  Set and substitute
      	ENABLE_BUILD_WITH_CXX.  Invoke ZW_PROG_COMPILER_DEPENDENCIES
      	according to ENABLE_BUILD_WITH_CXX.  Invoke AC_LANG before
      	AC_CHECK_HEADERS.
      	* configure: Rebuild.
      	* include/cpp-id-data.h: Remove extern "C".
      	* include/line-map.h: Likewise.
      	* include/mkdeps.h: Likewise.
      	* include/symtab.h: Likewise.
      	* internal.h: Likewise.
      
      From-SVN: r149763
      f1bf410c
  22. May 13, 2009
  23. Apr 09, 2009
  24. Mar 31, 2009
    • Joseph Myers's avatar
      re PR preprocessor/15638 (gcc should have option to treat missing headers as fatal) · 47580d22
      Joseph Myers authored
      	PR preprocessor/15638
      gcc:
      	* c-common.c (c_cpp_error): Handle CPP_DL_FATAL.
      
      gcc/fortran:
      	* cpp.c (cb_cpp_error): Handle CPP_DL_FATAL.
      
      gcc/testsuite:
      	* gcc.dg/cpp/missing-header-1.c: New test.
      	* gcc.dg/cpp/include2.c: Only test #include <>.  Expect
      	"compilation terminated" message.
      	* gcc.dg/cpp/include2a.c: New test.  Copy of include2.c but only
      	test #include "".
      	* gcc.dg/pch/counter-2.c, gcc.dg/pch/valid-1.c,
      	gcc.dg/pch/valid-2.c, gcc.dg/pch/warn-1.c: Expect "compilation
      	terminated" message.
      
      libcpp:
      	* files.c (_cpp_find_file): Call open_file_failed after diagnosing
      	invalid PCH.
      	(open_file_failed): Make error for missing file fatal.
      	* include/cpplib.h (CPP_DL_FATAL): Define.
      
      From-SVN: r145341
      47580d22
  25. 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
  26. 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
  27. 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
  28. 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
  29. Nov 16, 2007
  30. 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
  31. 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
  32. Jun 17, 2007
  33. Jun 16, 2007
  34. Jun 09, 2007
  35. 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
  36. 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
  37. Nov 04, 2005
  38. 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
  39. 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
  40. Jun 29, 2005
Loading