gcc/libcpp
Nathan Sidwell f207eed69e c++: Macro location fixes [PR 98718]
This fixes some issues with macro maps.  We were incorrectly
calculating the number of macro expansions in a location span, and I
had a workaround that partially covered that up.  Further, while macro
location spans are monotonic, that is not true of ordinary location
spans.  Thus we need to insert an indirection array when binary
searching the latter. (We load ordinary locations before loading
imports, but macro locations afterwards.  We make sure an import
location is de-macrofied, if needed.)

	PR c++/98718
	gcc/cp/
	* module.cc (ool): New indirection vector.
	(loc_spans::maybe_propagate): Location is not optional.
	(loc_spans::open): Likewise.  Assert monotonically advancing.
	(module_for_ordinary_loc): Use ool indirection vector.
	(module_state::write_prepare_maps): Do not count empty macro
	expansions.  Elide empty spans.
	(module_state::write_macro_maps): Skip empty expansions.
	(ool_cmp): New qsort comparator.
	(module_state::write): Create and destroy ool vector.
	(name_pending_imports): Fix dump push/pop.
	(preprocess_module): Likewise.  Add more dumping.
	(preprocessed_module): Likewise.
	libcpp/
	* include/line-map.h
	* line-map.c
	gcc/testsuite/
	* g++.dg/modules/pr98718_a.C: New.
	* g++.dg/modules/pr98718_b.C: New.
2021-02-24 12:46:09 -08:00
..
include c++: Macro location fixes [PR 98718] 2021-02-24 12:46:09 -08:00
po Daily bump. 2021-02-20 00:16:26 +00:00
ChangeLog Daily bump. 2021-02-19 00:16:21 +00:00
ChangeLog.jit
Makefile.in Update copyright years. 2021-01-04 10:26:59 +01:00
aclocal.m4 libcpp: Enable Intel CET on Intel CET enabled host for jit 2020-05-12 09:17:45 -07:00
charset.c Update copyright years. 2021-01-04 10:26:59 +01:00
config.in
configure Require CET support only for the final GCC build 2020-07-30 05:36:24 -07:00
configure.ac libcpp, libdecnumber: configure and substitute AR 2020-05-23 21:59:02 +00:00
directives.c Update copyright years. 2021-01-04 10:26:59 +01:00
errors.c Update copyright years. 2021-01-04 10:26:59 +01:00
expr.c c++, libcpp: Use make_signed_t<size_t> in the 1z diagnostics 2021-02-04 18:30:45 +01:00
files.c c++: header-unit build capability [PR 99023] 2021-02-18 13:22:48 -08:00
generated_cpp_wcwidth.h libcpp: Update cpp_wcwidth() to Unicode 13.0.0 2020-11-07 09:36:43 -05:00
identifiers.c Update copyright years. 2021-01-04 10:26:59 +01:00
init.c c++: modules & -fpreprocessed [PR 99072] 2021-02-24 09:14:34 -08:00
internal.h c++: header-unit build capability [PR 99023] 2021-02-18 13:22:48 -08:00
lex.c libcpp: Fix up -fdirectives-only preprocessing [PR98882] 2021-02-03 23:18:05 +01:00
line-map.c c++: Macro location fixes [PR 98718] 2021-02-24 12:46:09 -08:00
location-example.txt
macro.c c++: header-unit build capability [PR 99023] 2021-02-18 13:22:48 -08:00
makeucnid.c Update copyright years. 2021-01-04 10:26:59 +01:00
mkdeps.c preprocessor: Make quoting : [PR 95253] 2021-01-15 08:56:20 -08:00
pch.c Update copyright years. 2021-01-04 10:26:59 +01:00
symtab.c Update copyright years. 2021-01-04 10:26:59 +01:00
system.h Update copyright years. 2021-01-04 10:26:59 +01:00
traditional.c Update copyright years. 2021-01-04 10:26:59 +01:00
ucnid.h Update copyright years. 2021-01-04 10:26:59 +01:00
ucnid.tab Update copyright years. 2021-01-04 10:26:59 +01:00