1. 09 Jan, 2012 1 commit
    • gfunck's avatar
      libcpp/ · 5e791406
      gfunck authored
      	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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183003 138bc75d-0d04-0410-961f-82ee72b054a4
      5e791406
  2. 07 Dec, 2011 1 commit
    • jakub's avatar
      PR bootstrap/50237 · b735cc56
      jakub authored
      	* internal.h (_cpp_init_lexer): New prototype.
      	* init.c (init_library): Call it.
      	* lex.c (init_vectorized_lexer): Remove constructor attribute,
      	add inline keyword.
      	(HAVE_init_vectorized_lexer): Define.
      	(_cpp_init_lexer): New function.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182090 138bc75d-0d04-0410-961f-82ee72b054a4
      b735cc56
  3. 02 Nov, 2011 1 commit
  4. 22 Oct, 2011 1 commit
  5. 17 Oct, 2011 2 commits
    • dodji's avatar
      Generate virtual locations for tokens · ce70f433
      dodji authored
      This second instalment uses the infrastructure of the previous patch
      to allocate a macro map for each macro expansion and assign a virtual
      location to each token resulting from the expansion.
      
      To date when cpp_get_token comes across a token that happens to be a
      macro, the macro expander kicks in, expands the macro, pushes the
      resulting tokens onto a "token context" and returns a dummy padding
      token. The next call to cpp_get_token goes look into the token context
      for the next token [which is going to result from the previous macro
      expansion] and returns it.  If the token is a macro, the macro expander
      kicks in and you know the story.
      
      This patch piggy-backs on that macro expansion process, so to speak.
      First it modifies the macro expander to make it create a macro map for
      each macro expansion. It then allocates a virtual location for each
      resulting token.  Virtual locations of tokens resulting from macro
      expansions are then stored on a special kind of context called an
      "expanded tokens context".  In other words, in an expanded tokens
      context, there are tokens resulting from macro expansion and their
      associated virtual locations.  cpp_get_token_with_location is modified
      to return the virtual location of tokens resulting from macro
      expansion.  Note that once all tokens from an expanded token context have
      been consumed and the context and is freed, the memory used to store the
      virtual locations of the tokens held in that context is freed as well.
      This helps reducing the overall peak memory consumption.
      
      The client code that was getting macro expansion point location from
      cpp_get_token_with_location now gets virtual location from it. Those
      virtual locations can in turn be resolved into the different
      interesting physical locations thanks to the linemap API exposed by
      the previous patch.
      
      Expensive progress. Possibly. So this whole virtual location
      allocation business is switched off by default. So by default no
      extended token is created. No extended token context is created
      either. One has to use -ftrack-macro-expansion to switch this on. This
      complicates the code but I believe it can be useful as some of our
      friends found out at http://llvm.org/bugs/show_bug.cgi?id=5610
      
      The patch tries to reduce the memory consumption by freeing some token
      context memory that was being reused before. I didn't notice any
      compilation slow down due to this immediate freeing on my GNU/Linux
      system.
      
      As no client code tries to resolve virtual locations to anything but
      what was being done before, no new test case has been added.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180082 138bc75d-0d04-0410-961f-82ee72b054a4
      ce70f433
    • dodji's avatar
      Linemap infrastructure for virtual locations · 97bfb9ef
      dodji 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.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180081 138bc75d-0d04-0410-961f-82ee72b054a4
      97bfb9ef
  6. 22 Aug, 2011 1 commit
    • gchare's avatar
      Add ability to force lexed tokens' source_locations. · 6ea2c7a3
      gchare authored
      Use it to force BUILTINS_LOCATION when declaring builtins instead of creating a <built-in> entry in the line_table which is wrong.
      
      	* c-opts.c (c_finish_options): Force BUILTINS_LOCATION for tokens
      	defined in cpp_init_builtins and c_cpp_builtins.
      
      	gcc/fortran/ChangeLog
      	* cpp.c (gfc_cpp_init): Force BUILTINS_LOCATION for tokens
      	defined in cpp_define_builtins.
      
      	libcpp/ChangeLog
      	* init.c (cpp_create_reader): Inititalize forced_token_location_p.
      	* internal.h (struct cpp_reader): Add field forced_token_location_p.
      	* lex.c (_cpp_lex_direct): Use forced_token_location_p.
      	(cpp_force_token_locations): New.
      	(cpp_stop_forcing_token_locations): New.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177973 138bc75d-0d04-0410-961f-82ee72b054a4
      6ea2c7a3
  7. 29 Sep, 2010 2 commits
    • ktietz's avatar
      2010-09-29 Kai Tietz <kai.tietz@onevision.com> · 0d601ff4
      ktietz authored
      	PR preprocessor/45362
      	* directives.c (cpp_pop_definition): Make static.
      	(do_pragma_push_macro): Reworked to store text
      	definition.
      	(do_pragma_pop_macro): Add free text definition.
      	(cpp_push_definition): Removed.
      	* include/cpplib.h (cpp_push_definition): Removed.
      	(cpp_pop_definition): Likewise.
      	* internal.h (def_pragma_macro): Remove member 'value'
      	and add new members 'definition', 'line',
      	'syshdr', 'sued' and 'is_undef'.
      	* pch.c (_cpp_restore_pushed_macros): Rework to work
      	on text definition and store additional macro flags.
      	(_cpp_save_pushed_macros): Likewise.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164729 138bc75d-0d04-0410-961f-82ee72b054a4
      0d601ff4
    • jsm28's avatar
      gcc: · 5ae82d58
      jsm28 authored
      	* optc-gen.awk: Generate global_options initializer instead of
      	individual variables.  Add x_ prefix to names of structure
      	members.
      	* opth-gen.awk: Generate gcc_options structure.  Add x_ prefix to
      	names of structure members.
      	* doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER,
      	HARD_FRAME_POINTER_IS_ARG_POINTER): Document.
      	* doc/tm.texi: Regenerate.
      	* alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
      	* builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
      	* c-parser.c (disable_extension_diagnostics,
      	restore_extension_diagnostics): Update names of cpp_options
      	members.
      	* combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
      	* common.opt (fcompare-debug-second): Don't use Var.
      	* config/alpha/alpha.h (target_flags): Remove.
      	* config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
      	HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
      	* config/bfin/bfin.h (target_flags): Remove.
      	* config/cris/cris.h (target_flags): Remove.
      	* config/i386/i386-c.c (ix86_pragma_target_parse): Update names of
      	cl_target_option members.
      	* config/i386/i386.c (ix86_force_align_arg_pointer): Remove.
      	(ix86_function_specific_print, ix86_valid_target_attribute_tree,
      	ix86_can_inline_p): Update names of cl_target_option members.
      	* config/i386/i386.h (ix86_isa_flags): Remove.
      	* config/lm32/lm32.h (target_flags): Remove.
      	* config/mcore/mcore.h (mcore_stack_increment): Remove.
      	* config/mcore/mcore.md (addsi3): Remove extern declaration of
      	flag_omit_frame_pointer.
      	* config/mep/mep.h (target_flags): Remove.
      	* config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
      	HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
      	* config/mmix/mmix.h (target_flags): Remove.
      	* config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic,
      	flag_expensive_optimizations): Remove.
      	* config/s390/s390.h (flag_pic): Remove.
      	* config/score/score-conv.h (target_flags): Remove.
      	* config/sh/sh.h (sh_fixed_range_str): Remove.
      	* config/spu/spu.h (target_flags, spu_fixed_range_string): Remove.
      	* dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
      	* df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
      	* diagnostic.c (diagnostic_initialize): Update names of
      	diagnostic_context members.
      	* diagnostic.h (diagnostic_context): Rename inhibit_warnings and
      	warn_system_headers.
      	(diagnostic_report_warnings_p): Update for new names.
      	* dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
      	* emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and
      	HARD_FRAME_POINTER_IS_ARG_POINTER.
      	* flags.h (flag_compare_debug): Declare.
      	* ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
      	* opts.c (flag_compare_debug): Define.
      	(common_handle_option): Update names of diagnostic_context
      	members.  Handle -fcompare-debug-second.
      	(fast_math_flags_struct_set_p): Update names of cl_optimization
      	members.
      	* reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
      	* regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
      	* reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
      	* reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
      	* resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
      	* rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
      	HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use.
      	* sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
      	* stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
      
      gcc/c-family:
      	* c-common.c (c_cpp_error): Update names of diagnostic_context
      	members.
      	* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of
      	cl_optimization members.
      	* c-opts.c (warning_as_error_callback, c_common_handle_option,
      	sanitize_cpp_opts, finish_options): Update names of cpp_options
      	members.
      
      gcc/fortran:
      	* cpp.c (cpp_define_builtins): Update names of gfc_option_t
      	members.
      	(gfc_cpp_post_options): Update names of cpp_options members.
      	(cb_cpp_error): Update names of diagnostic_context members.
      	* f95-lang.c (gfc_init_builtin_functions): Update names of
      	gfc_option_t members.
      	* gfortran.h (gfc_option_t): Rename warn_conversion and
      	flag_openmp.
      	* intrinsic.c (gfc_convert_type_warn): Update names of
      	gfc_option_t members.
      	* options.c (gfc_init_options, gfc_post_options, set_Wall,
      	gfc_handle_option): Update names of gfc_option_t members.
      	* parse.c (next_free, next_fixed): Update names of gfc_option_t
      	members.
      	* scanner.c (pedantic): Remove extern declaration.
      	(skip_free_comments, skip_fixed_comments, include_line): Update
      	names of gfc_option_t members.
      	* trans-decl.c (gfc_generate_function_code): Update names of
      	gfc_option_t members.
      
      gcc/java:
      	* java-tree.h (flag_filelist_file, flag_assert, flag_jni,
      	flag_force_classes_archive_check, flag_redundant, flag_newer,
      	flag_use_divide_subroutine, flag_use_atomic_builtins,
      	flag_use_boehm_gc, flag_hash_synchronization,
      	flag_check_references, flag_optimize_sci, flag_indirect_classes,
      	flag_indirect_dispatch, flag_store_check,
      	flag_reduced_reflection): Remove.
      	* jcf-dump.c (flag_newer): Remove.
      	* jcf.h (quiet_flag): Remove.
      	* parse.h (quiet_flag): Remove.
      
      libcpp:
      	* include/cpplib.h (cpp_options): Rename warn_deprecated,
      	warn_traditional, warn_long_long and pedantic.
      	* directives.c (directive_diagnostics, _cpp_handle_directive):
      	Update names of cpp_options members.
      	* expr.c (cpp_classify_number, eval_token): Update names of
      	cpp_options members.
      	* init.c (cpp_create_reader, post_options): Update names of
      	cpp_options members.
      	* internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
      	cpp_options members.
      	* macro.c (parse_params): Update names of cpp_options members.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164723 138bc75d-0d04-0410-961f-82ee72b054a4
      5ae82d58
  8. 29 Mar, 2010 1 commit
    • jason's avatar
      More N3077 raw string changes · 3a45011c
      jason authored
      	* charset.c (cpp_interpret_string): Don't transform UCNs in raw
      	strings.
      	* lex.c (bufring_append): Split out from...
      	(lex_raw_string): ...here.  Undo trigraph and line splicing
      	transformations.  Do process line notes in multi-line literals.
      	(_cpp_process_line_notes): Ignore notes that were already handled.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157804 138bc75d-0d04-0410-961f-82ee72b054a4
      3a45011c
  9. 11 Nov, 2009 1 commit
    • ktietz's avatar
      ChangeLog for libcpp · 038c21f1
      ktietz authored
      2009-11-11  Kai Tietz  <kai.tietz@onevision.com>
      
      	* directives.c (do_pragma_push_macro): New pragma handler.
      	(do_pragma_pop_macro): Likewise.
      	(_cpp_init_internal_pragmas): Add push_macro and
      	pop_macro handler to internal pragmas.
      	(lex_macro_node_from_str): Removed.
      	(cpp_push_definition): Replace lex_macro_node_from_str
      	by _cpp_lex_identifier.
      	(cpp_pop_definition): Likewise.
      	* internal.h (_cpp_lex_identifier): New prototype.
      	(def_pragma_macro): New structure.
      	(cpp_reader): New member pushed_macros.
      	* lex.c (_cpp_lex_identifier): New function.
      	(lex_identifier_intern): New function.
      	* init.c (cpp_create_reader): Initialize pushed_macros
      	member.
      	(cpp_destroy): Free elements in pushed_macros member.
      	* pch.c (_cpp_save_pushed_macros): New function.
      	(_cpp_restore_pushed_macros): Likewise.
      	(_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
      	(cpp_read_state): Use _cpp_restore_pushed_macros.
      
      ChangeLog for gcc
      
      2009-11-11  Kai Tietz  <kai.tietz@onevision.com>
      
      	* conf...
      038c21f1
  10. 19 Oct, 2009 1 commit
    • jakub's avatar
      * charset.c (cpp_init_iconv): Initialize utf8_cset_desc. · 538ba11a
      jakub authored
      	(_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
      	and char32_cset_desc.
      	(converter_for_type): Handle CPP_UTF8STRING.
      	(cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
      	* directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
      	(parse_include): Reject raw strings.
      	* include/cpplib.h (CPP_UTF8STRING): New token type.
      	* internal.h (struct cpp_reader): Add utf8_cset_desc field.
      	* lex.c (lex_raw_string): New function.
      	(lex_string): Handle u8 string literals, call lex_raw_string
      	for raw string literals.
      	(_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
      	sequences.
      	* macro.c (stringify_arg): Handle CPP_UTF8STRING.
      
      	* c-common.c (c_parse_error): Handle CPP_UTF8STRING.
      	* c-lex.c (c_lex_with_flags): Likewise.  Test C_LEX_STRING_NO_JOIN
      	instead of C_LEX_RAW_STRINGS.
      	(lex_string): Handle CPP_UTF8STRING.
      	* c-parser.c (c_parser_postfix_expression): Likewise.
      	* c-pragma.h (C_LEX_RAW_STRINGS): Rename to ....
      538ba11a
  11. 01 Jun, 2009 1 commit
  12. 22 Apr, 2009 1 commit
    • manu's avatar
      2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org> · ba99525e
      manu authored
      	PR c++/14875
      	* c-common.c (c_parse_error): Take a token_flags parameter.
      	Use token_type for the token type instead.
      	Pass token_flags to cpp_type2name.
      	* c-common.h (c_parse_error): Update declaration.
      	* c-parser.c (c_parser_error): Pass 0 as token flags.
      libcpp/
      	* lex.c (cpp_type2name): Take a flags parameter. Call
      	cpp_named_operator2name for named operators and cpp_digraph2name
      	for digraphs.
      	(cpp_digraph2name): New.
      	(cpp_spell_token): Use it.
      	(cpp_output_token): Likewise.
      	* include/cpplib.h (cpp_type2name): Update declaration.
      	* init.c (cpp_named_operator2name): New.
      	* internal.h (cpp_named_operator2name): Declare.
      cp/	
      	* parser.c (cp_parser_error): Pass token->flags to c_parse_error.
      testsuite/
      	* g++.dg/parse/parser-pr14875.C: New.
      	* g++.dg/parse/parser-pr14875-2.C: New.
      	* g++.dg/parse/error6.C: Update match string.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146589 138bc75d-0d04-0410-961f-82ee72b054a4
      ba99525e
  13. 09 Apr, 2009 1 commit
  14. 30 Mar, 2009 1 commit
  15. 29 Mar, 2009 1 commit
    • jsm28's avatar
      PR preprocessor/34695 · 7f5f3953
      jsm28 authored
      gcc:
      	* Makefile.in (c-opts.o): Depend on c-tree.h.
      	* c-common.c: Move down include of diagnostic.h.
      	(done_lexing, c_cpp_error): New.
      	* c-common.h (done_lexing): Declare.
      	* c-decl.c (c_write_global_declarations): Don't check cpp_errors
      	(parse_in).
      	* c-opts.c: Include c-tree.h.
      	(c_common_init_options): Set preprocessor error callback.
      	(c_common_handle_option): Do not set preprocessor
      	inhibit_warnings, warnings_are_errors, warn_system_headers,
      	pedantic_errors or inhibit_warnings flags.
      	(c_common_post_options): Do not check cpp_errors (parse_in).
      	(c_common_finish): Do not output dependencies if there were
      	errors.  Do not check return value of cpp_finish.
      	* c-ppoutput.c (pp_file_change): Set input_location.
      	* c-tree.h (c_cpp_error): Declare.
      	* diagnostic.c (diagnostic_set_info_translated): Also initialize
      	override_column.
      	(diagnostic_build_prefix): Check override_column.
      	* diagnostic.h (diagnostic_info): Add override_column field.
      	(diagnostic_override_column): Define.
      
      gcc/cp:
      	* cp-tree.h (cp_cpp_error): Remove.
      	* error.c (cp_cpp_error): Remove.
      	* parser.c (cp_lexer_new_main): Set done_lexing instead of
      	client_diagnostic and error callback.
      
      gcc/fortran:
      	* cpp.c (cb_cpp_error): New.
      	(gfc_cpp_post_options): Don't set cpp_option->inhibit_warnings.
      	Don't check cpp_errors (cpp_in).
      	(gfc_cpp_init_0): Set cb->error.
      
      gcc/testsuite:
      	* gcc.dg/builtin-redefine.c, gcc.dg/cpp/redef2.c,
      	gcc.dg/cpp/redef3.c, gcc.dg/cpp/trad/redef2.c: Use dg-message
      	instead of dg-warning for "previous definition" messages.
      	* gcc.dg/cpp/Wvariadic-1.c, gcc.dg/cpp/Wvariadic-3.c: Expect
      	"warnings being treated as errors" message.
      	* gcc.dg/fltconst-1.c: Use -fshow-column.
      
      libcpp:
      	* makedepend.c: Remove.
      	* Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
      	(all, clean, TAGS_SOURCES, include): Remove makedepend handling.
      	* directives.c (cpp_errors): Remove.
      	* errors.c (print_location, _cpp_begin_message, v_message):
      	Remove.
      	(cpp_error, cpp_error_with_line): Always use error callback.
      	(cpp_error, cpp_error_with_line, cpp_errno): Return bool.
      	* include/cpplib.h (cpp_options): Remove pedantic_errors,
      	inhibit_warnings, warn_system_headers, inhibit_errors,
      	warnings_are_errors, client_diagnostic.
      	(cpp_callbacks): Add extra arguments to error callback; make it
      	return bool.
      	(cpp_finish): Return void.
      	(cpp_destroy): Remove inaccurate comment about return value.
      	(cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
      	(CPP_DL_NOTE): Define.
      	* include/line-map.h (linemap_print_containing_files): Remove.
      	* init.c (cpp_finish): Do not check for or return number of
      	errors.
      	* internal.h (cpp_reader): Remove errors field.
      	* line-map.c (linemap_print_containing_files): Remove.
      	* macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
      	about previous definition.  Only emit it if previous diagnostic
      	was emitted.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145263 138bc75d-0d04-0410-961f-82ee72b054a4
      7f5f3953
  16. 05 Oct, 2008 1 commit
    • charlet's avatar
      2008-10-05 Matthew Gingell <gingell@adacore.com> · 956c6108
      charlet authored
      	    Arnaud Charlet  <charlet@adacore.com>
      
      	* include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
      	(cpp_get_comments): New function.
      	* internal.h (struct cpp_reader): Add comments field.
      	* init.c (cpp_destroy): Free comments.
      	* lex.c (store_comment, cpp_get_comments): New functions.
      	(comments): New struct.
      	(save_comment): Store comments in comments struct.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140883 138bc75d-0d04-0410-961f-82ee72b054a4
      956c6108
  17. 21 Jul, 2008 1 commit
    • manu's avatar
      2008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> · 4999c35b
      manu authored
      	* include/line-map.h (linenum_type): New typedef.
      	(struct line_map): Use it.
      	(SOURCE_LINE): Second arguments is a LOCATION not a LINE.
      	(SOURCE_COLUMN): Likewise.
      	* macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
      	source_location values in a variable of type linenum_type.
      	* directives.c (struct if_stack): Use linenum_type.
      	(strtoul_for_line): Rename as strtolinenum.
      	(do_line): Use linenum_type.
      	(do_linemarker): Use linenum_type and strtolinenum.
      	(_cpp_do_file_change): Use linenum_t.
      	* line-map.c (linemap_add): Likewise.
      	(linemap_line_start): Likewise.
      	* traditional.c (struct fun_macro): 'line' is a source_location.
      	* errors.c (print_location): Use linenum_type.
      	* directives-only.c (_cpp_preprocess_dir_only): Likewise.
      	* internal.h (CPP_INCREMENT_LINE): Likewise.
      	* lex.c (_cpp_skip_block_comment): Use source_location.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138026 138bc75d-0d04-0410-961f-82ee72b054a4
      4999c35b
  18. 14 Jul, 2008 1 commit
    • bje's avatar
      libcpp/ · 89768577
      bje authored
      	* include/cpplib.h (NODE_CONDITIONAL): New.
      	(struct cpp_callbacks): New macro_to_expand field.
      	(struct cpp_hashnode): Adjust size of flags and type fields.
      	(cpp_peek_token): Prototype.
      	* lex.c (cpp_peek_token): New function.
      	(_cpp_temp_token): Protect pre-existing lookaheads.
      	* macro.c (cpp_get_token): Expand any conditional macros.
      	(_cpp_backup_tokens_direct): New.
      	(_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
      	(warn_of_redefinition): Silently allow redefined conditional
      	macros.
      	(_cpp_create_definition): Remove the conditional flag when a user
      	defines one of the conditional macros.
      	* internal.h (_cpp_backup_tokens_direct): New prototype.
      
      gcc/
      	* c-common.h (C_CPP_HASHNODE): New macro.
      	* coretypes.h (struct cpp_token): Forward declare.
      	* doc/extend.texi (PowerPC AltiVec Built-in Functions): Document
      	the context-sensitive keyword method.
      	* config/rs6000/rs6000-c.c (__vector_keyword, vector_keyword,
      	__pixel_keyword, pixel_keyword, __bool_keyword, bool_keyword,
      	expand_bool_pixel): New.
      	(altivec_categorize_keyword): New function.
      	(init_vector_keywords): New function.
      	(rs6000_macro_to_expand): Likewise.
      	(rs6000_cpu_cpp_builtins): Enable context-sensitive macros if not
      	compiling an ISO C dialect.
      
      gcc/testsuite/
      	* gcc.target/powerpc/altivec-macros.c: New test.
      	* gcc.target/powerpc/altviec-26.c: Likewise.
      	* gcc.dg/vmx/1b-06.c: Remove bool variable.
      	* gcc.dg/vmx/1b-07.c: Likewise.
      	* gcc.dg/vmx/1b-06-ansi.c: New test for the pre-define method.
      	* gcc.dg/vmx/1b-07-ansi.c: Likewise.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137775 138bc75d-0d04-0410-961f-82ee72b054a4
      89768577
  19. 30 May, 2008 1 commit
    • tromey's avatar
      gcc/testsuite · 536a48ee
      tromey authored
      	PR preprocessor/36320:
      	* gcc.dg/cpp/pr36320.c: New file.
      libcpp
      	PR preprocessor/36320:
      	* internal.h (_cpp_parse_expr): Update.
      	* expr.c (_cpp_parse_expr): Add 'is_if' argument.  Update error
      	messages.
      	* directives.c (do_if): Update.
      	(do_elif): Require expression if processing group.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136209 138bc75d-0d04-0410-961f-82ee72b054a4
      536a48ee
  20. 21 May, 2008 1 commit
    • tromey's avatar
      gcc/testsuite · c0770282
      tromey authored
      	PR preprocessor/27777:
      	* gcc.dg/cpp/pr27777.c: New file.
      libcpp
      	PR preprocessor/27777:
      	* lex.c (cpp_output_line_to_string): New function.
      	* internal.h (_cpp_begin_message): Don't declare.
      	* errors.c (_cpp_begin_message): Now static.
      	* include/cpplib.h (cpp_output_line_to_string): Declare.
      	* directives.c (do_diagnostic): Rewrote.  Use
      	cpp_output_line_to_string.  Don't use _cpp_begin_message.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135740 138bc75d-0d04-0410-961f-82ee72b054a4
      c0770282
  21. 21 Apr, 2008 1 commit
    • tromey's avatar
      libcpp · d656d07a
      tromey authored
      	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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134507 138bc75d-0d04-0410-961f-82ee72b054a4
      d656d07a
  22. 18 Apr, 2008 1 commit
    • jason's avatar
      libcpp/ChangeLog: · 924bbf02
      jason authored
      2008-04-14  Kris Van Hees <kris.van.hees@oracle.com>
      
      * include/cpp-id-data.h (UC): Was U, conflicts with U... literal.
      * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
      (struct cpp_options): Added uliterals.
      (cpp_interpret_string): Update prototype.
      (cpp_interpret_string_notranslate): Idem.
      * charset.c (init_iconv_desc): New width member in cset_converter.
      (cpp_init_iconv): Add support for char{16,32}_cset_desc.
      (convert_ucn): Idem.
      (emit_numeric_escape): Idem.
      (convert_hex): Idem.
      (convert_oct): Idem.
      (convert_escape): Idem.
      (converter_for_type): New function.
      (cpp_interpret_string): Use converter_for_type, support u and U prefix.
      (cpp_interpret_string_notranslate): Match changed prototype.
      (wide_str_to_charconst): Use converter_for_type.
      (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
      * directives.c (linemarker_dir): Macro U changed to UC.
      (parse_include): Idem.
      (register_pragma_1): Idem.
      (restore_registered_pragmas): Idem.
      (get__Pragma_string): Support CPP_STRING{16,32}.
      * expr.c (eval_token): Support CPP_CHAR{16,32}.
      * init.c (struct lang_flags): Added uliterals.
      (lang_defaults): Idem.
      * internal.h (struct cset_converter) <width>: New field.
      (struct cpp_reader) <char16_cset_desc>: Idem.
      (struct cpp_reader) <char32_cset_desc>: Idem.
      * lex.c (digraph_spellings): Macro U changed to UC.
      (OP, TK): Idem.
      (lex_string): Add support for u'...', U'...', u... and U....
      (_cpp_lex_direct): Idem.
      * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
      (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
      
      gcc/ChangeLog:
      2008-04-14  Kris Van Hees <kris.van.hees@oracle.com>
        
      * c-common.c (CHAR16_TYPE, CHAR32_TYPE): New macros.
      (fname_as_string): Match updated cpp_interpret_string prototype.
      (fix_string_type): Support char16_t* and char32_t*.
      (c_common_nodes_and_builtins): Add char16_t and char32_t (and
      derivative) nodes.  Register as builtin if C++0x.
      (c_parse_error): Support CPP_CHAR{16,32}.
      * c-common.h (RID_CHAR16, RID_CHAR32): New elements. 
      (enum c_tree_index) <CTI_CHAR16_TYPE, CTI_SIGNED_CHAR16_TYPE,
      CTI_UNSIGNED_CHAR16_TYPE, CTI_CHAR32_TYPE, CTI_SIGNED_CHAR32_TYPE,
      CTI_UNSIGNED_CHAR32_TYPE, CTI_CHAR16_ARRAY_TYPE,
      CTI_CHAR32_ARRAY_TYPE>: New elements.
      (char16_type_node, signed_char16_type_node, unsigned_char16_type_node,
      char32_type_node, signed_char32_type_node, char16_array_type_node,
      char32_array_type_node): New defines.
      * c-lex.c (cb_ident): Match updated cpp_interpret_string prototype.
      (c_lex_with_flags): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
      (lex_string): Support CPP_STRING{16,32}, match updated
      cpp_interpret_string and cpp_interpret_string_notranslate prototypes.
      (lex_charconst): Support CPP_CHAR{16,32}.
      * c-parser.c (c_parser_postfix_expression): Support CPP_CHAR{16,32}
      and CPP_STRING{16,32}.
      
      gcc/cp/ChangeLog:
      2008-04-14  Kris Van Hees <kris.van.hees@oracle.com>
      
      * cvt.c (type_promotes_to): Support char16_t and char32_t.
      * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
      char16_t and char32_t.
      * lex.c (reswords): Add char16_t and char32_t (for c++0x).
      * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
      extended builtin type u8char32_t.
      * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
      RID_CHAR{16,32}.
      (cp_lexer_print_token): Support CPP_STRING{16,32}.
      (cp_parser_is_string_literal): Idem.
      (cp_parser_string_literal): Idem.
      (cp_parser_primary_expression): Support CPP_CHAR{16,32} and
      CPP_STRING{16,32}.
      (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}. 
      * tree.c (char_type_p): Support char16_t and char32_t as char types.
      * typeck.c (string_conv_p): Support char16_t and char32_t.
      
      gcc/testsuite/ChangeLog:
      2008-04-14  Kris Van Hees <kris.van.hees@oracle.com>
      
      Tests for char16_t and char32_t support.
      * g++.dg/ext/utf-cvt.C: New
      * g++.dg/ext/utf-cxx0x.C: New
      * g++.dg/ext/utf-cxx98.C: New
      * g++.dg/ext/utf-dflt.C: New
      * g++.dg/ext/utf-gnuxx0x.C: New
      * g++.dg/ext/utf-gnuxx98.C: New
      * g++.dg/ext/utf-mangle.C: New
      * g++.dg/ext/utf-typedef-cxx0x.C: New
      * g++.dg/ext/utf-typedef-
      * g++.dg/ext/utf-typespec.C: New
      * g++.dg/ext/utf16-1.C: New
      * g++.dg/ext/utf16-2.C: New
      * g++.dg/ext/utf16-3.C: New
      * g++.dg/ext/utf16-4.C: New
      * g++.dg/ext/utf32-1.C: New
      * g++.dg/ext/utf32-2.C: New
      * g++.dg/ext/utf32-3.C: New
      * g++.dg/ext/utf32-4.C: New
      * gcc.dg/utf-cvt.c: New
      * gcc.dg/utf-dflt.c: New
      * gcc.dg/utf16-1.c: New
      * gcc.dg/utf16-2.c: New
      * gcc.dg/utf16-3.c: New
      * gcc.dg/utf16-4.c: New
      * gcc.dg/utf32-1.c: New
      * gcc.dg/utf32-2.c: New
      * gcc.dg/utf32-3.c: New
      * gcc.dg/utf32-4.c: New
      
      libiberty/ChangeLog:
      2008-04-14  Kris Van Hees <kris.van.hees@oracle.com>
      
      * testsuite/demangle-expected: Added tests for char16_t and char32_t.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134438 138bc75d-0d04-0410-961f-82ee72b054a4
      924bbf02
  23. 06 Dec, 2007 1 commit
    • tromey's avatar
      gcc · 64cb8c90
      tromey authored
      	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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130656 138bc75d-0d04-0410-961f-82ee72b054a4
      64cb8c90
  24. 31 Oct, 2007 1 commit
    • tromey's avatar
      gcc/testsuite · 2d507e67
      tromey authored
      	PR preprocessor/30786:
      	* gcc.dg/cpp/pr30786.c: New file.
      libcpp
      	PR preprocessor/30786:
      	* macro.c (builtin_macro): Return result of _cpp_do__Pragma.
      	* directives.c (_cpp_do__Pragma): Return error status.
      	* internal.h (_cpp_do__Pragma): Update.
      	* directives.c (get__Pragma_string): Back up if EOF seen.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129800 138bc75d-0d04-0410-961f-82ee72b054a4
      2d507e67
  25. 06 Sep, 2007 1 commit
    • tromey's avatar
      gcc: · 931b0a0f
      tromey authored
      	* tree-cfg.c (remove_bb): Only warn if line is non-zero.
      	* c-pch.c (c_common_read_pch): Restore current location after
      	reading PCH file.
      	* tree.c (expand_location): Update.
      	(expr_filename): Changed return type.  Unified the two cases.
      	(expr_lineno): Likewise.
      	(annotate_with_file_line): Don't use EXPR_LINENO and EXPR_FILENAME
      	as lvalues.
      	* toplev.c (line_table): Changed type.
      	(general_init): Update.
      	(realloc_for_line_map): New function.
      	(general_init): Allocate line_table using GC.
      	* fix-header.c (line_table): Changed type.
      	(read_scan_file): Update.
      	(read_scan_file): Update.
      	* c-ppoutput.c (maybe_print_line): Update.
      	(print_line): Update.
      	(cb_line_change): Update.
      	(cb_define): Update.
      	(pp_file_change): Update.
      	* c-opts.c (c_common_init_options): Update.
      	(finish_options): Update.
      	(push_command_line_include): Update.
      	* c-lex.c (cb_line_change): Update.
      	(cb_def_pragma): Update.
      	(cb_define): Update.
      	(cb_undef): Update.
      	(c_lex_with_flags): Use cpp_get_token_with_location.
      	* input.h (line_table): Changed type.
      	(location_from_locus): New macro.
      	* tree.h (EXPR_FILENAME): No longer an lvalue.
      	(EXPR_LINENO): Likewise.
      	(expr_locus, set_expr_locus): Declare separately for
      	USE_MAPPED_LOCATION.
      	(expr_filename, expr_lineno): Changed return type.
      	* gimplify.c (tree_to_gimple_tuple): Use SET_EXPR_LOCUS.
      	* cfgexpand.c (expand_gimple_cond_expr): Use location_from_locus.
      	(expand_gimple_basic_block): Likewise.
      	* final.c (final_scan_insn): Use expanded_location.
      gcc/cp:
      	* decl.c (finish_function): Put return's location on line zero of
      	file.
      gcc/fortran:
      	* scanner.c (get_file): Update.
      	(load_file): Update.
      	(gfc_next_char_literal): Use gfc_linebuf_linenum.
      	* f95-lang.c (gfc_init): Update.
      	* gfortran.h (gfc_linebuf_linenum): New macro.
      gcc/java:
      	* lang.c (java_post_options): Update.
      	* jcf-parse.c (set_source_filename): Update.
      	(give_name_to_class): Update.
      	(jcf_parse): Update.
      	(duplicate_class_warning): Update.
      	(parse_class_file): Update.
      	(java_parse_file): Update.
      	* expr.c (expand_byte_code): Update.
      gcc/testsuite:
      	* lib/g++.exp (g++_target_compile): Use -fno-show-column.
      gcc/treelang:
      	* tree1.c (treelang_init): Update.
      	(treelang_parse_file): Update.
      	(treelang_parse_file): Update.
      	(treelang_parse_file): Update.
      	* lex.l: Update.
      	(update_lineno_charno): Likewise.
      libcpp:
      	* internal.h (struct cpp_reader) <invocation_location>: New
      	field.
      	(struct cpp_reader) <set_invocation_location>: Likewise.
      	* init.c (cpp_set_line_map): New function.
      	* line-map.c (linemap_add): Use linemap's allocator.
      	* include/line-map.h (GTY): Define.
      	(line_map_realloc): New typedef.
      	(struct line_map): Mark with GTY.
      	(struct line_maps): Likewise.
      	(struct line_maps) <maps>: Likewise.
      	(struct line_maps) <reallocator>: New field.
      	* include/symtab.h (GTY): Conditionally define.
      	* include/cpplib.h (cpp_set_line_map): Declare.
      	(cpp_get_token_with_location): Declare.
      	* macro.c (cpp_get_token): Set invocation_location on the reader.
      	(cpp_get_token_with_location): New function.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128190 138bc75d-0d04-0410-961f-82ee72b054a4
      931b0a0f
  26. 30 Jul, 2007 1 commit
    • aaw's avatar
      libcpp/ · fcde64dc
      aaw authored
      	* 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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127066 138bc75d-0d04-0410-961f-82ee72b054a4
      fcde64dc
  27. 24 May, 2007 1 commit
    • aaw's avatar
      * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER. · ce079f70
      aaw authored
      	* pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
      	(cpp_write_pch_state): Save __COUNTER__ state.
      	(cpp_valid_state): Check valid __COUNTER__ state.
      	(cpp_read_state): Read new __COUNTER__ state.
      	* include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
      	* init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
      	* internal.h (struct cpp_reader): Add counter member.
      
      	* gcc.dg/cpp/counter-1.c: New test.
      	* gcc.dg/pch/counter-1.c: New test.
      	* gcc.dg/pch/counter-1.hs: New file.
      	* gcc.dg/pch/counter-2.c: New test.
      	* gcc.dg/pch/counter-2.hs: New file.
      	* gcc.dg/pch/counter-3.c: New test.
      	* gcc.dg/pch/counter-3.hs: New file.
      
      	* doc/cpp.texi (Common Predefined Macros): Add __COUNTER__
      	description.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125041 138bc75d-0d04-0410-961f-82ee72b054a4
      ce079f70
  28. 21 May, 2007 1 commit
    • ian's avatar
      * internal.h (struct cpp_reader): Add new fields: · 248dfc42
      ian authored
      	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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124929 138bc75d-0d04-0410-961f-82ee72b054a4
      248dfc42
  29. 04 Jan, 2007 1 commit
    • tromey's avatar
      libcpp · 927b511f
      tromey authored
      	PR preprocessor/28165:
      	* internal.h (cpp_in_primary_file): New function.
      	* directives.c (do_include_next): Use cpp_in_primary_file.
      	(do_pragma_once): Likewise.
      	(do_pragma_system_header): Likewise.
      gcc/testsuite
      	PR preprocessor/28165:
      	* gcc.dg/cpp/pr28165.c: New file.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120441 138bc75d-0d04-0410-961f-82ee72b054a4
      927b511f
  30. 18 Feb, 2006 1 commit
    • dalecki's avatar
      2006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com> · cca5dddc
      dalecki authored
      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.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111232 138bc75d-0d04-0410-961f-82ee72b054a4
      cca5dddc
  31. 04 Jan, 2006 1 commit
    • rth's avatar
      libcpp/ · b75b98aa
      rth authored
      	* directives.c (struct pragma_entry): Add is_deferred.  Add ident
      	entry to value union.
      	(end_directive): Don't eat the line if in_deferred_pragma.
      	(run_directive): Remove pragma hacks.
      	(insert_pragma_entry): Remove.
      	(new_pragma_entry): New.
      	(register_pragma_1): Split out of register_pragma.  Only handle
      	the lookup tree and return the new entry.
      	(cpp_register_pragma): Fill in the pragma entry here.
      	(cpp_register_deferred_pragma): New.
      	(register_pragma_internal): New.
      	(_cpp_init_internal_pragmas): Use register_pragma_internal.
      	(do_pragma): Allow pragma expansion after namespace.  For deferred
      	pragmas, don't slurp the line into a string.
      	(destringize_and_run): Save tokens for deferred pragmas.
      	(cpp_handle_deferred_pragma): Remove.
      	* macro.c (builtin_macro): Remove pragma token hack.
      	(_cpp_push_token_context): Rename from push_token_context and export.
      	* internal.h (struct lexer_state): Add pragma_allow_expansion.
      	(_cpp_push_token_context): Declare.
      	* lex.c (_cpp_lex_token): Allow ...
      b75b98aa
  32. 21 Oct, 2005 1 commit
    • wilson's avatar
      Fix bug with -MM -MG. · 04c0bfd0
      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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105757 138bc75d-0d04-0410-961f-82ee72b054a4
      04c0bfd0
  33. 29 Jun, 2005 1 commit
  34. 15 Mar, 2005 1 commit
    • geoffk's avatar
      Index: gcc/ChangeLog · bce47149
      geoffk authored
      2005-03-14  Geoffrey Keating  <geoffk@apple.com>
      
      	* doc/cppopts.texi (-fexec-charset): Add concept index entry.
      	(-fwide-exec-charset): Likewise.
      	(-finput-charset): Likewise.
      	* doc/invoke.texi (Warning Options): Document -Wnormalized=.
      	* c-opts.c (c_common_handle_option): Handle -Wnormalized=.
      	* c.opt (Wnormalized): New.
      
      Index: libcpp/ChangeLog
      2005-03-14  Geoffrey Keating  <geoffk@apple.com>
      
      	* init.c (cpp_create_reader): Default warn_normalize to normalized_C.
      	* charset.c: Update for new format of ucnid.h.
      	(ucn_valid_in_identifier): Update for new format of ucnid.h.
      	Add NST parameter, and update it; update callers.
      	(cpp_valid_ucn): Add NST parameter, update callers.  Replace abort
      	with cpp_error.
      	(convert_ucn): Pass normalize_state to cpp_valid_ucn.
      	* internal.h (struct normalize_state): New.
      	(INITIAL_NORMALIZE_STATE): New.
      	(NORMALIZE_STATE_RESULT): New.
      	(NORMALIZE_STATE_UPDATE_IDNUM): New.
      	(_cpp_valid_ucn): New.
      	* lex.c (warn_about_normalization): New.
      	(forms_identifier_p): Add normalize_state parameter, update callers.
      	(lex_identifier): Add normalize_state parameter, update callers.  Keep
      	the state current.
      	(lex_number): Likewise.
      	(_cpp_lex_direct): Pass normalize_state to subroutines.  Check
      	it with warn_about_normalization.
      	* makeucnid.c: New.
      	* ucnid.h: Replace.
      	* ucnid.pl: Remove.
      	* ucnid.tab: Make appropriate for input to makeucnid.c.  Remove
      	comments about obsolete version of C++.
      	* include/cpplib.h (enum cpp_normalize_level): New.
      	(struct cpp_options): Add warn_normalize field.
      
      Index: gcc/testsuite/ChangeLog
      2005-03-14  Geoffrey Keating  <geoffk@apple.com>
      
      	* gcc.dg/cpp/normalize-1.c: New.
      	* gcc.dg/cpp/normalize-2.c: New.
      	* gcc.dg/cpp/normalize-3.c: New.
      	* gcc.dg/cpp/normalize-4.c: New.
      	* gcc.dg/cpp/ucnid-4.c: New.
      	* gcc.dg/cpp/ucnid-5.c: New.
      	* g++.dg/cpp/normalize-1.C: New.
      	* g++.dg/cpp/ucnid-1.C: New.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96459 138bc75d-0d04-0410-961f-82ee72b054a4
      bce47149
  35. 12 Mar, 2005 1 commit
    • geoffk's avatar
      Index: libcpp/ChangeLog · bb1fa6bb
      geoffk authored
      2005-03-12  Geoffrey Keating  <geoffk@apple.com>
      
      	* directives.c (glue_header_name): Update call to cpp_spell_token.
      	* internal.h (_cpp_interpret_identifier): New.
      	* charset.c (_cpp_interpret_identifier): New.
      	(_cpp_valid_ucn): Allow UCN version of '$'.
      	* lex.c (lex_identifier): Add extra parameter to indicate if initial
      	character was '$' or '\'.  Support identifiers with UCNs.
      	(forms_identifier_p): Allow UCNs.
      	(_cpp_lex_direct): Pass extra parameter to lex_identifier.
      	(utf8_to_ucn): New.
      	(cpp_spell_token): Add FORSTRING parameter.  Use it.
      	(cpp_token_as_text): Update call to cpp_spell_token.
      	(cpp_output_token): Write UCNs back out.
      	(stringify_arg): Update call to cpp_spell_token.
      	(paste_tokens): Likewise.
      	(cpp_macro_definition): Likewise.
      	* macro.c (stringify_arg): Likewise.
      	(paste_tokens): Likewise.
      	(cpp_macro_definition): Likewise.
      	* include/cpplib.h: Add parameter to cpp_spell_token.
      
      Index: gcc/ChangeLog
      2005-03-12  Geoffrey Keating  <geoffk@apple.com>
      
      	* c-lex.c (c_lex_with_flags): Add parameter to call to
      	cpp_spell_token.
      
      Index: gcc/testsuite/ChangeLog
      2005-03-12  Geoffrey Keating  <geoffk@apple.com>
      
      	* gcc.dg/ucnid-1.c: New.
      	* gcc.dg/ucnid-2.c: New.
      	* gcc.dg/ucnid-3.c: New.
      	* gcc.dg/ucnid-4.c: New.
      	* gcc.dg/ucnid-5.c: New.
      	* gcc.dg/ucnid-6.c: New.
      	* gcc.dg/cpp/ucnid-1.c: New.
      	* gcc.dg/cpp/ucnid-2.c: New.
      	* gcc.dg/cpp/ucnid-3.c: New.
      	* g++.dg/other/ucnid-1.C: New.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96333 138bc75d-0d04-0410-961f-82ee72b054a4
      bb1fa6bb
  36. 14 Feb, 2005 2 commits
    • kazu's avatar
      * directives.c, files.c, init.c, internal.h, macro.c, pch.c, · 129a1540
      kazu authored
      	traditional.c: Update copyright.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95012 138bc75d-0d04-0410-961f-82ee72b054a4
      129a1540
    • bonzini's avatar
      include: · bb30d1f4
      bonzini authored
      2005-02-08  Paolo Bonzini  <bonzini@gnu.org>
      
      	PR bootstrap/19818
      	* ansidecl.h (PARAMS): Guard from redefinition.
      
      libcpp:
      2005-02-08  Paolo Bonzini  <bonzini@gnu.org>
      
      	PR bootstrap/19818
      	* configure.ac: Check for declaration of basename and getopt.
      	* config.in: Regenerate.
      	* configure: Regenerate.
      	* internal.h (ustrcspn): New.
      	* macro.c (create_iso_definition): Fix allocation of memory.
      	(padding_token): Add cast to remove const-ness.
      	* pch.c (cpp_read_state): Use ustrcspn.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95003 138bc75d-0d04-0410-961f-82ee72b054a4
      bb30d1f4
  37. 02 Jan, 2005 1 commit