gcc/libcpp/include
Eric Botcazou 63d4c1b5a4 Fix thinko in libcpp preparation patch for modules
The problem is that the new IS_MACRO_LOC macro:

inline bool
IS_MACRO_LOC (location_t loc)
{
  return !IS_ORDINARY_LOC (loc) && !IS_ADHOC_LOC (loc);
}

is not fully correct since the position of the macro lines is not fixed:

/* Returns the lowest location [of a token resulting from macro
   expansion] encoded in this line table.  */
inline location_t
LINEMAPS_MACRO_LOWEST_LOCATION (const line_maps *set)
{
  return LINEMAPS_MACRO_USED (set)
         ? MAP_START_LOCATION (LINEMAPS_LAST_MACRO_MAP (set))
         : MAX_LOCATION_T + 1;
}

In Ada, LINEMAPS_MACRO_USED is false so LINEMAPS_MACRO_LOWEST_LOCATION is
MAX_LOCATION_T + 1, but IS_MACRO_LOC nevertheless returns true for anything
in the range [LINE_MAP_MAX_LOCATION; MAX_LOCATION_T], thus yielding an ICE
in linemap_macro_map_lookup for very large files.

libcpp/
	* include/line-map.h (IS_MACRO_LOC): Delete.
	* line-map.c (linemap_location_from_macro_expansion_p): Test
	LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.
2021-04-13 13:36:54 +02:00
..
cpplib.h Remove trailing comma to avoid pedantic warning in C++ 98 mode: comma at end of enumerator list 2020-02-05 17:14:42 -07:00
line-map.h Fix thinko in libcpp preparation patch for modules 2021-04-13 13:36:54 +02:00
mkdeps.h Update copyright years. 2020-01-01 12:51:42 +01:00
symtab.h Update copyright years. 2020-01-01 12:51:42 +01:00