[linemap PATCH] Constify lookup
authorNathan Sidwell <nathan@acm.org>
Tue, 15 Oct 2019 12:03:04 +0000 (12:03 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 15 Oct 2019 12:03:04 +0000 (12:03 +0000)
commit9158f0ba97ff987948cd5ce8391a546751c6dff3
tree23993f28ac6545c0a27d83cecfcfe29a6cd27608
parentd8955dc0f4583317c4d6a65d17c92c538f46a60c
[linemap PATCH] Constify lookup

https://gcc.gnu.org/ml/gcc-patches/2019-10/msg01080.html
looking up a line map takes a non-constant line_maps object, which is confusing.
This makes the caching fields mutable, so permits a constant object, as one might expect for a lookup.

* include/line-map.h (struct maps_info_ordinary): Make cache
mutable.
(struct maps_info_macro): Likewise.
(LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor.
(LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise.
(LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use
LINEMAPS_USED and LINEMAPS_MAP_AT.
(linemap_lookup): Constify line_map arg.
linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup):
Constify line_map arg.

From-SVN: r276994
libcpp/ChangeLog
libcpp/include/line-map.h
libcpp/line-map.c