1. 17 Oct, 2011 3 commits
    • dodji's avatar
      Support -fdebug-cpp option · 62db153a
      dodji authored
      This patch adds -fdebug-cpp option. When used with -E this dumps the
      relevant macro map before every single token. This clutters the output
      a lot but has proved to be invaluable in tracking some bugs during the
      development of the virtual location support.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180084 138bc75d-0d04-0410-961f-82ee72b054a4
      62db153a
    • 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...
      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
  2. 28 Aug, 2011 1 commit
    • dodji's avatar
      Fix the use of linemap_add and remove unnecessary kludge · 1dc92c59
      dodji authored
      libcpp/
      
      	* line-map.c (linemap_add): Assert that reason must not be
      	LC_RENAME when called for the first time on a "main input file".
      
      c-family/
      
      	* c-pch.c (c_common_read_pch): Call linemap_add with LC_ENTER as it's
      	the first time it's being called on this main TU.
      
      gcc/lto/
      
      	* lto-lang.c (lto_init): Likewise.  Also, avoid calling
      	linemap_add twice.
      
      gcc/fortran/
      
      	* scanner.c (load_file): Don't abuse LC_RENAME reason while
      	(indirectly) calling linemap_add.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178146 138bc75d-0d04-0410-961f-82ee72b054a4
      1dc92c59
  3. 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
  4. 18 Aug, 2011 3 commits
  5. 15 Aug, 2011 1 commit
    • gchare's avatar
      LINEMAP_POSITION_FOR_COLUMN had the exact same effect as · 80ea6373
      gchare authored
      linemap_position_for_column, removed it and updated users
      to use linemap_position_for_column instead
      
              libcpp/ChangeLog
      	* include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
      	Update all users to use linemap_position_for_column instead.
      
              gcc/go/ChangeLog
      	* gofrontend/lex.cc (Lex::location): Update to use
      	linemap_position_for_column instead.
              (Lex::earlier_location): Likewise.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177768 138bc75d-0d04-0410-961f-82ee72b054a4
      80ea6373
  6. 28 Jul, 2011 2 commits
  7. 25 Jul, 2011 1 commit
  8. 22 Jul, 2011 1 commit
    • ro's avatar
      2011-07-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> · 6678cb4e
      ro authored
      	    Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
      
      	gcc:
      	PR bootstrap/49794
      	* configure.ac: Test AM_ICONV with CXX.
      	* configure: Regenerate.
      	* config/sol2-c.c (solaris_format_types): Use EXPORTED_CONST.
      
      	gcc/ada:
      	PR bootstrap/49794
      	* init.c [sun && __SVR4 && !__vxworks] (__gnat_install_handler):
      	Assign to act.sa_sigaction.
      	* tracebak.c [USE_GENERIC_UNWINDER] (__gnat_backtrace): Cast
      	current->return_address to char * before arithmetic.
      
      	libcpp:
      	PR bootstrap/49794
      	* configure.ac: Test AM_ICONV with CXX.
      	* configure: Regenerate.
      	* system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176620 138bc75d-0d04-0410-961f-82ee72b054a4
      6678cb4e
  9. 15 Jul, 2011 1 commit
    • dodji's avatar
      Use source_location where it is due · c219ee5c
      dodji authored
      libcpp/
      
      	* directives.c (struct if_stack): Use source_location as type
      	here.
      	* include/cpplib.h (struct cpp_callbacks)<include, define, undef,
      	indent, def_pragma, used_define, used_undef>: Properly use
      	source_location as parameter type, rather than unsigned int.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176333 138bc75d-0d04-0410-961f-82ee72b054a4
      c219ee5c
  10. 08 Jul, 2011 1 commit
  11. 07 Jul, 2011 1 commit
    • ro's avatar
      gcc: · 14f27bc6
      ro authored
      	PR target/39150
      	* configure.ac (gcc_cv_as_hidden): Also accept
      	x86_64-*-solaris2.1[0-9]*.
      	(gcc_cv_as_cfi_directive): Likewise.
      	(gcc_cv_as_comdat_group_group): Likewise.
      	(set_have_as_tls): Likewise.
      	* configure: Regenerate.
      	* config.gcc (i[34567]86-*-solaris2*): Also handle
      	x86_64-*-solaris2.1[0-9]*.
      	* config.host (i[34567]86-*-solaris2*): Likewise.
      	* config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Remove.
      	* config/sol2-bi.h (ASM_CPU_DEFAULT_SPEC): Redefine.
      	[USE_GLD] (ARCH_DEFAULT_EMULATION): Define.
      	(TARGET_LD_EMULATION): Use it.
      	* config/i386/sol2.h (ASM_CPU_DEFAULT_SPEC): Define.
      	(SUBTARGET_CPU_EXTRA_SPECS): Add asm_cpu_default.
      	* config/i386/sol2-bi.h (ASM_CPU32_DEFAULT_SPEC): Define.
      	(ASM_CPU64_DEFAULT_SPEC): Define.
      	(ASM_CPU_SPEC): Use %(asm_cpu_default).
      	(ASM_SPEC): Redefine.
      	(DEFAULT_ARCH32_P): Define using TARGET_64BIT_DEFAULT.
      	* config/host-solaris.c [__x86_64__] (TRY_EMPTY_VM_SPACE): Reduce.
      	* doc/install.texi (Specific, amd64-*-solaris2.1[0-9]*):
      	Document.
      	(Specific, ...
      14f27bc6
  12. 21 Jun, 2011 1 commit
  13. 16 Jun, 2011 1 commit
  14. 06 Jun, 2011 1 commit
    • dodji's avatar
      PR preprocessor/48532 · 2c694d44
      dodji authored
      libcpp/
      
      	* directives.c (do_pragma): Don't forget the invocation location
      	when parsing the pragma name of a namespaced pragma directive.
      
      gcc/testsuite/
      
      	* gcc.dg/cpp/pragma-3.c: New test case.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174694 138bc75d-0d04-0410-961f-82ee72b054a4
      2c694d44
  15. 02 Jun, 2011 1 commit
  16. 22 May, 2011 2 commits
  17. 12 May, 2011 1 commit
  18. 25 Apr, 2011 1 commit
    • jkratoch's avatar
      include/ · cdd0bb4b
      jkratoch authored
      	* ansidecl.h (ENUM_BITFIELD): New, from gcc/system.h.
      
      contrib/
      	* paranoia.cc (ENUM_BITFIELD): Remove.
      
      gcc/
      	* system.h (ENUM_BITFIELD): Remove.
      
      libcpp/
      	* system.h (ENUM_BITFIELD): Remove.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172933 138bc75d-0d04-0410-961f-82ee72b054a4
      cdd0bb4b
  19. 23 Apr, 2011 1 commit
  20. 20 Apr, 2011 1 commit
    • meyering's avatar
      remove useless if-before-free tests · dd045aee
      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.
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172785 138bc75d-0d04-0410-961f-82ee72b054a4
      dd045aee
  21. 03 Apr, 2011 1 commit
  22. 25 Mar, 2011 1 commit
    • ktietz's avatar
      2011-03-25 Kai Tietz <ktietz@redhat.com> · bb7824b5
      ktietz authored
      	* 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.
      
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171521 138bc75d-0d04-0410-961f-82ee72b054a4
      bb7824b5
  23. 24 Mar, 2011 1 commit
  24. 21 Mar, 2011 1 commit
  25. 18 Mar, 2011 1 commit
  26. 05 Mar, 2011 1 commit
  27. 07 Jan, 2011 1 commit
  28. 04 Jan, 2011 1 commit
  29. 03 Jan, 2011 1 commit
  30. 19 Dec, 2010 2 commits
  31. 18 Dec, 2010 2 commits
  32. 17 Dec, 2010 1 commit