[PATCH] line-map include-from representation
commit03410c5ec328943fb2aeefd8963177f5bddd821d
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Aug 2018 18:13:00 +0000 (8 18:13 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Aug 2018 18:13:00 +0000 (8 18:13 +0000)
treea4ec7ecbde7bfc84329e5a2bb1dc8dea689d7d31
parent4f61feff8ad3615c0b686deac3852d98734ef964
[PATCH] line-map include-from representation

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00554.html
Make linemap::included_from a location
libcpp/
* include/line-map.h (struct line_map_ordinary): Replace
included_from map index with included_at source_location.
(ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
(LAST_SOURCE_LINE_LOCATION): Delete.
(LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
(linemap_included_from): New.
(linemap_included_from_linemap): Declare.
(MAIN_FILE_P): Adjust.
* line-map.c (linemap_included_from_linemap): New.
(lonemap_check_files_exited): Use linemap_included_at.
(linemap_add): Adjust inclusion setting.
(linemap_dump, linemap_dump_location): Adjust.
* directives.c (do_linemarker): Use linemap_included_at.
gcc/
* diagnostic.c (diagnostic_report_current_module): Use
linemap_included_from & linemap_included_from_linemap.
gcc/c-family/
* c-common.c (try_to_locate_new_include_inertion_point): Use
linemap_included_from_linemap.
* c-lex.c (fe_file_change): Use linemap_included_from.
* c-ppoutput.c (pp_file_change): Likewise.
gcc/fortran/
* cpp.c (cb_file_change): Use linemap_included_from.
gcc/testsuite/
* c-c++-common/inc-from-1a.h, c-c++-common/inc-from-1b.h,
c-c++-common/inc-from-1.c: New

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263429 138bc75d-0d04-0410-961f-82ee72b054a4
16 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-lex.c
gcc/c-family/c-ppoutput.c
gcc/diagnostic.c
gcc/fortran/ChangeLog
gcc/fortran/cpp.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/inc-from-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/inc-from-1a.h [new file with mode: 0644]
gcc/testsuite/c-c++-common/inc-from-1b.h [new file with mode: 0644]
libcpp/ChangeLog
libcpp/directives.c
libcpp/include/line-map.h
libcpp/line-map.c