diff options
author | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-25 08:58:54 +0000 |
---|---|---|
committer | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-25 08:58:54 +0000 |
commit | 5ebe21437f1bd988a9887289d6f33db552a83b89 (patch) | |
tree | 9772bc60a136c3ea7e6977711cf51d5fb4469798 /libcpp/include | |
parent | 7abb12dacb7560a632d491646ffa1cd9d7cf6862 (diff) | |
download | gcc-5ebe21437f1bd988a9887289d6f33db552a83b89.tar.gz |
Support expansion of reserved locations wrapped in virtual locations
libcpp/
* include/line-map.h (linemap_expand_location): Take a line table
parameter. Update comment.
(linemap_resolve_location): Update comment.
(linemap_expand_location_full): Remove.
* line-map.c (linemap_resolve_location): Handle reserved
locations; return a NULL map in those cases.
(linemap_expand_location): If location is reserved, return a
zeroed expanded location. Update comment. Take a line table to
assert that the function takes non-virtual locations only.
(linemap_expand_location_full): remove.
(linemap_dump_location): Handle the fact that
linemap_resolve_location can return NULL line maps when the
location resolves to a reserved location.
gcc/
* input.c (expand_location): Rewrite using
linemap_resolve_location and linemap_expand_location. Add a
comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180426 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/include')
-rw-r--r-- | libcpp/include/line-map.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index ef98f5935b3..112bc020309 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -651,7 +651,10 @@ enum location_resolution_kind LRK_SPELLING_LOCATION. If LOC_MAP is not NULL, *LOC_MAP is set to the map encoding the - returned location. */ + returned location. Note that if the resturned location wasn't originally + encoded by a map, the *MAP is set to NULL. This can happen if LOC + resolves to a location reserved for the client code, like + UNKNOWN_LOCATION or BUILTINS_LOCATION in GCC. */ source_location linemap_resolve_location (struct line_maps *, source_location loc, @@ -670,19 +673,13 @@ source_location linemap_unwind_toward_expansion (struct line_maps *, const struct line_map **loc_map); /* Expand source code location LOC and return a user readable source - code location. LOC must be a spelling (non-virtual) location. */ - -expanded_location linemap_expand_location (const struct line_map *, + code location. LOC must be a spelling (non-virtual) location. If + it's a location < RESERVED_LOCATION_COUNT a zeroed expanded source + location is returned. */ +expanded_location linemap_expand_location (struct line_maps *, + const struct line_map *, source_location loc); -/* Expand source code location LOC and return a user readable source - code location. LOC can be a virtual location. The LRK parameter - is the same as for linemap_resolve_location. */ - -expanded_location linemap_expand_location_full (struct line_maps *, - source_location loc, - enum location_resolution_kind lrk); - /* Statistics about maps allocation and usage as returned by linemap_get_statistics. */ struct linemap_stats |