gcc/libcpp
Lewis Hyatt 019dc63819 libcpp: Stabilize the location for macros restored after PCH load [PR105608]
libcpp currently lacks the infrastructure to assign correct locations to
macros that were defined prior to loading a PCH and then restored
afterwards. While I plan to address that fully for GCC 15, this patch
improves things by using at least a valid location, even if it's not the
best one. Without this change, libcpp uses pfile->directive_line as the
location for the restored macros, but this location_t applies to the old
line map, not the one that was just restored from the PCH, so the resulting
location is unpredictable and depends on what was stored in the line maps
before. With this change, all restored macros get assigned locations at the
line of the #include that triggered the PCH restore. A future patch will
store the actual file name and line number of each definition and then
synthesize locations in the new line map pointing to the right place.

gcc/c-family/ChangeLog:

	PR preprocessor/105608
	* c-pch.cc (c_common_read_pch): Adjust line map so that libcpp
	assigns a location to restored macros which is the same location
	that triggered the PCH include.

libcpp/ChangeLog:

	PR preprocessor/105608
	* pch.cc (cpp_read_state): Set a valid location for restored
	macros.
2024-02-01 09:07:17 -05:00
..
include libcpp: add function to check XID properties 2024-01-04 16:30:01 +01:00
po Daily bump. 2023-05-10 00:17:49 +00:00
aclocal.m4 *: add modern gettext 2023-11-14 00:47:11 +01:00
ChangeLog Daily bump. 2024-01-05 00:18:48 +00:00
ChangeLog.jit
charset.cc libcpp: add function to check XID properties 2024-01-04 16:30:01 +01:00
combining-chars.inc diagnostics: add support for "text art" diagrams 2023-06-21 21:49:00 -04:00
config.in libcpp: configure: drop unused Valgrind detection 2023-11-24 16:13:56 +03:00
configure libcpp: configure: drop unused Valgrind detection 2023-11-24 16:13:56 +03:00
configure.ac libcpp: configure: drop unused Valgrind detection 2023-11-24 16:13:56 +03:00
directives.cc Update copyright years. 2024-01-03 12:19:35 +01:00
errors.cc Update copyright years. 2024-01-03 12:19:35 +01:00
expr.cc Update copyright years. 2024-01-03 12:19:35 +01:00
files.cc Update copyright years. 2024-01-03 12:19:35 +01:00
generated_cpp_wcwidth.h libcpp, contrib: Update to Unicode 15.1 2023-11-14 18:32:37 +01:00
identifiers.cc Update copyright years. 2024-01-03 12:19:35 +01:00
init.cc Update copyright years. 2024-01-03 12:19:35 +01:00
internal.h Update copyright years. 2024-01-03 12:19:35 +01:00
lex.cc Update copyright years. 2024-01-03 12:19:35 +01:00
line-map.cc Update copyright years. 2024-01-03 12:19:35 +01:00
location-example.txt
macro.cc Update copyright years. 2024-01-03 12:19:35 +01:00
Makefile.in Update copyright years. 2024-01-03 12:19:35 +01:00
makeucnid.cc Update copyright years. 2024-01-03 12:19:35 +01:00
makeuname2c.cc Update copyright years. 2024-01-03 12:19:35 +01:00
mkdeps.cc Update copyright years. 2024-01-03 12:19:35 +01:00
pch.cc libcpp: Stabilize the location for macros restored after PCH load [PR105608] 2024-02-01 09:07:17 -05:00
printable-chars.inc diagnostics: add support for "text art" diagrams 2023-06-21 21:49:00 -04:00
symtab.cc Update copyright years. 2024-01-03 12:19:35 +01:00
system.h Update copyright years. 2024-01-03 12:19:35 +01:00
traditional.cc Update copyright years. 2024-01-03 12:19:35 +01:00
ucnid.h Update copyright years. 2024-01-03 12:19:35 +01:00
ucnid.tab Update copyright years. 2024-01-03 12:19:35 +01:00
uname2c.h Update copyright years. 2024-01-03 12:19:35 +01:00