Skip to content
Snippets Groups Projects
  1. 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
  2. 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
  3. Jun 02, 2011
  4. 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
  5. 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
  6. Jan 03, 2011
  7. Apr 09, 2010
  8. Sep 22, 2009
  9. 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
  10. 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
  11. May 13, 2009
  12. Apr 09, 2009
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. Nov 16, 2007
  19. 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
  20. 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
  21. Jun 17, 2007
  22. Jun 16, 2007
  23. Jun 09, 2007
  24. 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
  25. 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
  26. Nov 04, 2005
  27. 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
  28. 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
  29. Jun 29, 2005
  30. 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
  31. Apr 28, 2005
  32. Feb 14, 2005
  33. 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
  34. 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
  35. Dec 15, 2004
  36. Jul 16, 2004
  37. 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
  38. 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
  39. 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
  40. 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
Loading