aboutsummaryrefslogtreecommitdiff
path: root/libcpp/include/line-map.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/include/line-map.h')
-rw-r--r--libcpp/include/line-map.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
index 22e2f0f..1c81fc5 100644
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@ -666,12 +666,30 @@ source_location linemap_resolve_location (struct line_maps *,
location L of the point where M got expanded. If L is a spelling
location inside a macro expansion M', then this function returns
the point where M' was expanded. LOC_MAP is an output parameter.
- When non-NULL, *LOC_MAP is set the the map of the returned
+ When non-NULL, *LOC_MAP is set to the map of the returned
location. */
source_location linemap_unwind_toward_expansion (struct line_maps *,
source_location loc,
const struct line_map **loc_map);
+/* If LOC is the virtual location of a token coming from the expansion
+ of a macro M and if its spelling location is reserved (e.g, a
+ location for a built-in token), then this function unwinds (using
+ linemap_unwind_toward_expansion) the location until a location that
+ is not reserved and is not in a system header is reached. In other
+ words, this unwinds the reserved location until a location that is
+ in real source code is reached.
+
+ Otherwise, if the spelling location for LOC is not reserved or if
+ LOC doesn't come from the expansion of a macro, the function
+ returns LOC as is and *MAP is not touched.
+
+ *MAP is set to the map of the returned location if the later is
+ different from LOC. */
+source_location linemap_unwind_to_first_non_reserved_loc (struct line_maps *,
+ source_location loc,
+ const struct line_map **map);
+
/* Expand source code location LOC and return a user readable source
code location. LOC must be a spelling (non-virtual) location. If
it's a location < RESERVED_LOCATION_COUNT a zeroed expanded source