diff options
Diffstat (limited to 'libcpp/line-map.cc')
-rw-r--r-- | libcpp/line-map.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libcpp/line-map.cc b/libcpp/line-map.cc index 284af57..33701b5 100644 --- a/libcpp/line-map.cc +++ b/libcpp/line-map.cc @@ -767,6 +767,17 @@ linemap_module_restore (line_maps *set, line_map_uint_t lwm) return 0; } +/* TRUE iff the location comes from a module import. */ + +bool +linemap_location_from_module_p (const line_maps *set, location_t loc) +{ + const line_map_ordinary *map = linemap_ordinary_map_lookup (set, loc); + while (map && map->reason != LC_MODULE) + map = linemap_included_from_linemap (set, map); + return !!map; +} + /* Returns TRUE if the line table set tracks token locations across macro expansion, FALSE otherwise. */ |