1 /* Map logical line numbers to (source file, line number) pairs.
2 Copyright (C) 2001, 2003, 2004, 2007, 2008, 2009, 2010, 2011
3 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 3, or (at your option) any
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; see the file COPYING3. If not see
17 <http://www.gnu.org/licenses/>.
19 In other words, you are welcome to use, share and improve this program.
20 You are forbidden to forbid anyone else to use, share and improve
21 what you give them. Help stamp out software-hoarding! */
23 #ifndef LIBCPP_LINE_MAP_H
24 #define LIBCPP_LINE_MAP_H
27 #define GTY(x) /* nothing */
30 /* Reason for creating a new line map with linemap_add. LC_ENTER is
31 when including a new file, e.g. a #include directive in C.
32 LC_LEAVE is when reaching a file's end. LC_RENAME is when a file
33 name or line number changes for neither of the above reasons
34 (e.g. a #line directive in C); LC_RENAME_VERBATIM is like LC_RENAME
35 but a filename of "" is not specially interpreted as standard
36 input. LC_ENTER_MACRO is when a macro expansion is about to start. */
44 /* FIXME: add support for stringize and paste. */
47 /* The type of line numbers. */
48 typedef unsigned int linenum_type;
50 /* A logical line/column number, i.e. an "index" into a line_map. */
51 typedef unsigned int source_location;
53 /* Memory allocation function typedef. Works like xrealloc. */
54 typedef void *(*line_map_realloc) (void *, size_t);
56 /* An ordinary line map encodes physical source locations. Those
57 physical source locations are called "spelling locations".
59 Physical source file TO_FILE at line TO_LINE at column 0 is represented
60 by the logical START_LOCATION. TO_LINE+L at column C is represented by
61 START_LOCATION+(L*(1<<column_bits))+C, as long as C<(1<<column_bits),
62 and the result_location is less than the next line_map's start_location.
63 (The top line is line 1 and the leftmost column is column 1; line/column 0
64 means "entire file/line" or "unknown line/column" or "not applicable".)
66 The highest possible source location is MAX_SOURCE_LOCATION. */
67 struct GTY(()) line_map_ordinary {
71 /* An index into the set that gives the line mapping at whose end
72 the current one was included. File(s) at the bottom of the
73 include stack have this set to -1. */
76 /* SYSP is one for a system header, two for a C system header file
77 that therefore needs to be extern "C" protected in C++, and zero
78 otherwise. This field isn't really needed now that it's in
82 /* Number of the low-order source_location bits used for a column number. */
83 unsigned int column_bits : 8;
86 /* This is the highest possible source location encoded within an
87 ordinary or macro map. */
88 #define MAX_SOURCE_LOCATION 0xFFFFFFFF
92 /* A macro line map encodes location of tokens coming from a macro
95 Please note that this struct line_map_macro is a field of struct
96 line_map below, go read the comments of struct line_map below and
99 The offset from START_LOCATION is used to index into
100 MACRO_LOCATIONS; this holds the original location of the token. */
101 struct GTY(()) line_map_macro {
102 /* The cpp macro which expansion gave birth to this macro map. */
103 struct cpp_hashnode * GTY ((nested_ptr (union tree_node,
104 "%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL",
105 "%h ? HT_IDENT_TO_GCC_IDENT (HT_NODE (%h)) : NULL")))
108 /* The number of tokens inside the replacement-list of MACRO. */
109 unsigned int n_tokens;
111 /* This array of location is actually an array of pairs of
112 locations. The elements inside it thus look like:
114 x0,y0, x1,y1, x2,y2, ...., xn,yn.
118 Remember that these xI,yI are collected when libcpp is about to
119 expand a given macro.
121 yI is the location in the macro definition, either of the token
122 itself or of a macro parameter that it replaces.
126 #define PLUS(A, B) A + B <--- #1
128 int a = PLUS (1,2); <--- #2
130 There is a macro map for the expansion of PLUS in #2. PLUS is
131 expanded into its expansion-list. The expansion-list is the
132 replacement-list of PLUS where the macro parameters are replaced
133 with their arguments. So the replacement-list of PLUS is made of
138 and the expansion-list is made of the tokens:
142 Let's consider the case of token "+". Its y1 [yI for I == 1] is
143 its spelling location in #1.
145 y0 (thus for token "1") is the spelling location of A in #1.
147 And y2 (of token "2") is the spelling location of B in #1.
149 When the token is /not/ an argument for a macro, xI is the same
150 location as yI. Otherwise, xI is the location of the token
151 outside this macro expansion. If this macro was expanded from
152 another macro expansion, xI is a virtual location representing
153 the token in that macro expansion; otherwise, it is the spelling
154 location of the token.
156 Note that a virtual location is a location returned by
157 linemap_add_macro_token. It encodes the relevant locations (x,y
158 pairs) of that token accross the macro expansions from which it
159 (the token) might come from.
161 In the example above x1 (for token "+") is going to be the same
162 as y1. x0 is the spelling location for the argument token "1",
163 and x2 is the spelling location for the argument token "2". */
164 source_location * GTY((length ("2 * %h.n_tokens"))) macro_locations;
166 /* This is the location of the expansion point of the current macro
167 map. It's the location of the macro name. That location is held
168 by the map that was current right before the current one. It
169 could have been either a macro or an ordinary map, depending on
170 if we are in a nested expansion context not. */
171 source_location expansion;
174 /* A line_map encodes a sequence of locations.
175 There are two kinds of maps. Ordinary maps and macro expansion
176 maps, a.k.a macro maps.
178 A macro map encodes source locations of tokens that are part of a
179 macro replacement-list, at a macro expansion point. E.g, in:
181 #define PLUS(A,B) A + B
183 No macro map is going to be created there, because we are not at a
184 macro expansion point. We are at a macro /definition/ point. So the
185 locations of the tokens of the macro replacement-list (i.e, A + B)
186 will be locations in an ordinary map, not a macro map.
188 On the other hand, if we later do:
192 The invocation of PLUS here is a macro expansion. So we are at a
193 macro expansion point. The preprocessor expands PLUS (1,2) and
194 replaces it with the tokens of its replacement-list: 1 + 2. A macro
195 map is going to be created to hold (or rather to map, haha ...) the
196 locations of the tokens 1, + and 2. The macro map also records the
197 location of the expansion point of PLUS. That location is mapped in
198 the map that is active right before the location of the invocation
200 struct GTY(()) line_map {
201 source_location start_location;
203 /* The reason for creation of this line map. */
204 ENUM_BITFIELD (lc_reason) reason : CHAR_BIT;
207 struct line_map_ordinary GTY((tag ("0"))) ordinary;
208 struct line_map_macro GTY((tag ("1"))) macro;
209 } GTY((desc ("%1.reason == LC_ENTER_MACRO"))) d;
212 #define MAP_START_LOCATION(MAP) (MAP)->start_location
214 #define ORDINARY_MAP_FILE_NAME(MAP) \
215 linemap_check_ordinary (MAP)->d.ordinary.to_file
217 #define ORDINARY_MAP_STARTING_LINE_NUMBER(MAP) \
218 linemap_check_ordinary (MAP)->d.ordinary.to_line
220 #define ORDINARY_MAP_INCLUDER_FILE_INDEX(MAP) \
221 linemap_check_ordinary (MAP)->d.ordinary.included_from
223 #define ORDINARY_MAP_IN_SYSTEM_HEADER_P(MAP) \
224 linemap_check_ordinary (MAP)->d.ordinary.sysp
226 #define ORDINARY_MAP_NUMBER_OF_COLUMN_BITS(MAP) \
227 linemap_check_ordinary (MAP)->d.ordinary.column_bits
229 #define MACRO_MAP_MACRO(MAP) (MAP)->d.macro.macro
231 #define MACRO_MAP_NUM_MACRO_TOKENS(MAP) (MAP)->d.macro.n_tokens
233 #define MACRO_MAP_LOCATIONS(MAP) (MAP)->d.macro.macro_locations
235 #define MACRO_MAP_EXPANSION_POINT_LOCATION(MAP) (MAP)->d.macro.expansion
237 /* The abstraction of a set of location maps. There can be several
238 types of location maps. This abstraction contains the attributes
239 that are independent from the type of the map. */
240 struct GTY(()) maps_info {
241 /* This array contains the different line maps.
242 A line map is created for the following events:
243 - when a new preprocessing unit start.
244 - when a preprocessing unit ends.
245 - when a macro expansion occurs. */
246 struct line_map * GTY ((length ("%h.used"))) maps;
248 /* The total number of allocated maps. */
249 unsigned int allocated;
251 /* The number of elements used in maps. This number is smaller
252 or equal to ALLOCATED. */
258 /* A set of chronological line_map structures. */
259 struct GTY(()) line_maps {
261 struct maps_info info_ordinary;
263 struct maps_info info_macro;
265 /* Depth of the include stack, including the current file. */
268 /* If true, prints an include trace a la -H. */
271 /* Highest source_location "given out". */
272 source_location highest_location;
274 /* Start of line of highest source_location "given out". */
275 source_location highest_line;
277 /* The maximum column number we can quickly allocate. Higher numbers
278 may require allocating a new line_map. */
279 unsigned int max_column_hint;
281 /* If non-null, the allocator to use when resizing 'maps'. If null,
283 line_map_realloc reallocator;
286 /* Returns the pointer to the memory region where information about
287 maps are stored in the line table SET. MACRO_MAP_P is a flag
288 telling if we want macro or ordinary maps. */
289 #define LINEMAPS_MAP_INFO(SET, MACRO_MAP_P) \
291 ? &((SET)->info_macro) \
292 : &((SET)->info_ordinary))
294 /* Returns the pointer to the memory region where maps are stored in
295 the line table SET. MAP_KIND shall be TRUE if we are interested in
296 macro maps false otherwise. */
297 #define LINEMAPS_MAPS(SET, MAP_KIND) \
298 (LINEMAPS_MAP_INFO (SET, MAP_KIND))->maps
300 /* Returns the number of allocated maps so far. MAP_KIND shall be TRUE
301 if we are interested in macro maps, FALSE otherwise. */
302 #define LINEMAPS_ALLOCATED(SET, MAP_KIND) \
303 (LINEMAPS_MAP_INFO (SET, MAP_KIND))->allocated
305 /* Returns the number of used maps so far. MAP_KIND shall be TRUE if
306 we are interested in macro maps, FALSE otherwise.*/
307 #define LINEMAPS_USED(SET, MAP_KIND) \
308 (LINEMAPS_MAP_INFO (SET, MAP_KIND))->used
310 /* Returns the index of the last map that was looked up with
311 linemap_lookup. MAP_KIND shall be TRUE if we are interested in
312 macro maps, FALSE otherwise. */
313 #define LINEMAPS_CACHE(SET, MAP_KIND) \
314 (LINEMAPS_MAP_INFO (SET, MAP_KIND))->cache
316 /* Return the map at a given index. */
317 #define LINEMAPS_MAP_AT(SET, MAP_KIND, INDEX) \
318 (&((LINEMAPS_MAPS (SET, MAP_KIND))[(INDEX)]))
320 /* Returns the last map used in the line table SET. MAP_KIND
321 shall be TRUE if we are interested in macro maps, FALSE
323 #define LINEMAPS_LAST_MAP(SET, MAP_KIND) \
324 LINEMAPS_MAP_AT (SET, MAP_KIND, (LINEMAPS_USED (SET, MAP_KIND) - 1))
326 /* Returns the last map that was allocated in the line table SET.
327 MAP_KIND shall be TRUE if we are interested in macro maps, FALSE
329 #define LINEMAPS_LAST_ALLOCATED_MAP(SET, MAP_KIND) \
330 LINEMAPS_MAP_AT (SET, MAP_KIND, LINEMAPS_ALLOCATED (SET, MAP_KIND) - 1)
332 /* Returns a pointer to the memory region where ordinary maps are
333 allocated in the line table SET. */
334 #define LINEMAPS_ORDINARY_MAPS(SET) \
335 LINEMAPS_MAPS (SET, false)
337 /* Returns the INDEXth ordinary map. */
338 #define LINEMAPS_ORDINARY_MAP_AT(SET, INDEX) \
339 LINEMAPS_MAP_AT (SET, false, INDEX)
341 /* Return the number of ordinary maps allocated in the line table
343 #define LINEMAPS_ORDINARY_ALLOCATED(SET) \
344 LINEMAPS_ALLOCATED(SET, false)
346 /* Return the number of ordinary maps used in the line table SET. */
347 #define LINEMAPS_ORDINARY_USED(SET) \
348 LINEMAPS_USED(SET, false)
350 /* Return the index of the last ordinary map that was looked up with
352 #define LINEMAPS_ORDINARY_CACHE(SET) \
353 LINEMAPS_CACHE(SET, false)
355 /* Returns a pointer to the last ordinary map used in the line table
357 #define LINEMAPS_LAST_ORDINARY_MAP(SET) \
358 LINEMAPS_LAST_MAP(SET, false)
360 /* Returns a pointer to the last ordinary map allocated the line table
362 #define LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP(SET) \
363 LINEMAPS_LAST_ALLOCATED_MAP(SET, false)
365 /* Returns a pointer to the begining of the region where macro maps
367 #define LINEMAPS_MACRO_MAPS(SET) \
368 LINEMAPS_MAPS(SET, true)
370 /* Returns the INDEXth macro map. */
371 #define LINEMAPS_MACRO_MAP_AT(SET, INDEX) \
372 LINEMAPS_MAP_AT (SET, true, INDEX)
374 /* Returns the number of macro maps that were allocated in the line
376 #define LINEMAPS_MACRO_ALLOCATED(SET) \
377 LINEMAPS_ALLOCATED(SET, true)
379 /* Returns the number of macro maps used in the line table SET. */
380 #define LINEMAPS_MACRO_USED(SET) \
381 LINEMAPS_USED(SET, true)
383 /* Returns the index of the last macro map looked up with
385 #define LINEMAPS_MACRO_CACHE(SET) \
386 LINEMAPS_CACHE(SET, true)
388 /* Returns the lowest location [of a token resulting from macro
389 expansion] encoded in this line table. */
390 #define LINEMAPS_MACRO_LOWEST_LOCATION(SET) \
391 (LINEMAPS_MACRO_USED (set) \
392 ? MAP_START_LOCATION (LINEMAPS_LAST_MACRO_MAP (set)) \
393 : MAX_SOURCE_LOCATION)
395 /* Returns the last macro map used in the line table SET. */
396 #define LINEMAPS_LAST_MACRO_MAP(SET) \
397 LINEMAPS_LAST_MAP (SET, true)
399 /* Returns the last macro map allocated in the line table SET. */
400 #define LINEMAPS_LAST_ALLOCATED_MACRO_MAP(SET) \
401 LINEMAPS_LAST_ALLOCATED_MAP (SET, true)
403 /* Initialize a line map set. */
404 extern void linemap_init (struct line_maps *);
406 /* Check for and warn about line_maps entered but not exited. */
408 extern void linemap_check_files_exited (struct line_maps *);
410 /* Return a source_location for the start (i.e. column==0) of
411 (physical) line TO_LINE in the current source file (as in the
412 most recent linemap_add). MAX_COLUMN_HINT is the highest column
413 number we expect to use in this line (but it does not change
414 the highest_location). */
416 extern source_location linemap_line_start
417 (struct line_maps *set, linenum_type to_line, unsigned int max_column_hint);
419 /* Add a mapping of logical source line to physical source file and
420 line number. This function creates an "ordinary map", which is a
421 map that records locations of tokens that are not part of macro
422 replacement-lists present at a macro expansion point.
424 The text pointed to by TO_FILE must have a lifetime
425 at least as long as the lifetime of SET. An empty
426 TO_FILE means standard input. If reason is LC_LEAVE, and
427 TO_FILE is NULL, then TO_FILE, TO_LINE and SYSP are given their
428 natural values considering the file we are returning to.
430 A call to this function can relocate the previous set of
431 maps, so any stored line_map pointers should not be used. */
432 extern const struct line_map *linemap_add
433 (struct line_maps *, enum lc_reason, unsigned int sysp,
434 const char *to_file, linenum_type to_line);
436 /* Given a logical source location, returns the map which the
437 corresponding (source file, line, column) triplet can be deduced
438 from. Since the set is built chronologically, the logical lines are
439 monotonic increasing, and so the list is sorted and we can use a
440 binary search. If no line map have been allocated yet, this
441 function returns NULL. */
442 extern const struct line_map *linemap_lookup
443 (struct line_maps *, source_location);
445 /* Returns TRUE if the line table set tracks token locations accross
446 macro expansion, FALSE otherwise. */
447 bool linemap_tracks_macro_expansion_locs_p (struct line_maps *);
449 /* Return TRUE if MAP encodes locations coming from a macro
450 replacement-list at macro expansion point. */
451 bool linemap_macro_expansion_map_p (const struct line_map *);
453 /* Return the name of the macro associated to MACRO_MAP. */
454 const char* linemap_map_get_macro_name (const struct line_map*);
456 /* Return a positive value if LOCATION is the locus of a token that is
457 located in a system header, O otherwise. It returns 1 if LOCATION
458 is the locus of a token that is located in a system header, and 2
459 if LOCATION is the locus of a token located in a C system header
460 that therefore needs to be extern "C" protected in C++.
462 Note that this function returns 1 if LOCATION belongs to a token
463 that is part of a macro replacement-list defined in a system
464 header, but expanded in a non-system file. */
465 int linemap_location_in_system_header_p (struct line_maps *,
468 /* Return TRUE if LOCATION is a source code location of a token coming
469 from a macro replacement-list at a macro expansion point, FALSE
471 bool linemap_location_from_macro_expansion_p (struct line_maps *,
474 /* source_location values from 0 to RESERVED_LOCATION_COUNT-1 will
475 be reserved for libcpp user as special values, no token from libcpp
476 will contain any of those locations. */
477 #define RESERVED_LOCATION_COUNT 2
479 /* Converts a map and a source_location to source line. */
480 #define SOURCE_LINE(MAP, LOC) \
481 (((((LOC) - linemap_check_ordinary (MAP)->start_location) \
482 >> (MAP)->d.ordinary.column_bits) + (MAP)->d.ordinary.to_line))
484 /* Convert a map and source_location to source column number. */
485 #define SOURCE_COLUMN(MAP, LOC) \
486 ((((LOC) - linemap_check_ordinary (MAP)->start_location) \
487 & ((1 << (MAP)->d.ordinary.column_bits) - 1)))
489 /* Returns the last source line number within an ordinary map. This
490 is the (last) line of the #include, or other directive, that caused
492 #define LAST_SOURCE_LINE(MAP) \
493 SOURCE_LINE (MAP, LAST_SOURCE_LINE_LOCATION (MAP))
495 /* Return the last column number within an ordinary map. */
496 #define LAST_SOURCE_COLUMN(MAP) \
497 SOURCE_COLUMN (MAP, LAST_SOURCE_LINE_LOCATION (MAP))
499 /* Return the location of the last source line within an ordinary
501 #define LAST_SOURCE_LINE_LOCATION(MAP) \
502 ((((linemap_check_ordinary (MAP)[1].start_location - 1 \
503 - (MAP)->start_location) \
504 & ~((1 << (MAP)->d.ordinary.column_bits) - 1)) \
505 + (MAP)->start_location))
507 /* Returns the map a given map was included from, or NULL if the map
508 belongs to the main file, i.e, a file that wasn't included by
510 #define INCLUDED_FROM(SET, MAP) \
511 ((linemap_check_ordinary (MAP)->d.ordinary.included_from == -1) \
513 : (&LINEMAPS_ORDINARY_MAPS (SET)[(MAP)->d.ordinary.included_from]))
515 /* Nonzero if the map is at the bottom of the include stack. */
516 #define MAIN_FILE_P(MAP) \
517 ((linemap_check_ordinary (MAP)->d.ordinary.included_from < 0))
519 #if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
521 /* Assertion macro to be used in line-map code. */
522 #define linemap_assert(EXPR) \
528 /* Assert that MAP encodes locations of tokens that are not part of
529 the replacement-list of a macro expansion. */
530 #define linemap_check_ordinary(LINE_MAP) __extension__ \
531 ({linemap_assert (!linemap_macro_expansion_map_p (LINE_MAP)); \
534 #define linemap_assert(EXPR)
535 #define linemap_check_ordinary(LINE_MAP) (LINE_MAP)
538 /* Encode and return a source_location from a column number. The
539 source line considered is the last source line used to call
540 linemap_line_start, i.e, the last source line which a location was
542 extern source_location
543 linemap_position_for_column (struct line_maps *, unsigned int);
545 /* Encode and return a source location from a given line and
547 source_location linemap_position_for_line_and_column (struct line_map *,
550 /* Return the file this map is for. */
551 #define LINEMAP_FILE(MAP) \
552 (linemap_check_ordinary (MAP)->d.ordinary.to_file)
554 /* Return the line number this map started encoding location from. */
555 #define LINEMAP_LINE(MAP) \
556 (linemap_check_ordinary (MAP)->d.ordinary.to_line)
558 /* Return a positive value if map encodes locations from a system
559 header, 0 otherwise. Returns 1 if MAP encodes locations in a
560 system header and 2 if it encodes locations in a C system header
561 that therefore needs to be extern "C" protected in C++. */
562 #define LINEMAP_SYSP(MAP) \
563 (linemap_check_ordinary (MAP)->d.ordinary.sysp)
565 /* Return a positive value if PRE denotes the location of a token that
566 comes before the token of POST, 0 if PRE denotes the location of
567 the same token as the token for POST, and a negative value
569 int linemap_compare_locations (struct line_maps *set,
571 source_location post);
573 /* Return TRUE if LOC_A denotes the location a token that comes
574 topogically before the token denoted by location LOC_B, or if they
576 #define linemap_location_before_p(SET, LOC_A, LOC_B) \
577 (linemap_compare_locations ((SET), (LOC_A), (LOC_B)) >= 0)
581 /* The name of the source file involved. */
584 /* The line-location in the source file. */
589 /* In a system header?. */
593 /* This is enum is used by the function linemap_resolve_location
594 below. The meaning of the values is explained in the comment of
596 enum location_resolution_kind
598 LRK_MACRO_EXPANSION_POINT,
599 LRK_SPELLING_LOCATION,
600 LRK_MACRO_DEFINITION_LOCATION
603 /* Resolve a virtual location into either a spelling location, an
604 expansion point location or a token argument replacement point
605 location. Return the map that encodes the virtual location as well
606 as the resolved location.
608 If LOC is *NOT* the location of a token resulting from the
609 expansion of a macro, then the parameter LRK (which stands for
610 Location Resolution Kind) is ignored and the resulting location
611 just equals the one given in argument.
613 Now if LOC *IS* the location of a token resulting from the
614 expansion of a macro, this is what happens.
616 * If LRK is set to LRK_MACRO_EXPANSION_POINT
617 -------------------------------
619 The virtual location is resolved to the first macro expansion point
620 that led to this macro expansion.
622 * If LRK is set to LRK_SPELLING_LOCATION
623 -------------------------------------
625 The virtual location is resolved to the locus where the token has
626 been spelled in the source. This can follow through all the macro
627 expansions that led to the token.
629 * If LRK is set to LRK_MACRO_DEFINITION_LOCATION
630 --------------------------------------
632 The virtual location is resolved to the locus of the token in the
633 context of the macro definition.
635 If LOC is the locus of a token that is an argument of a
636 function-like macro [replacing a parameter in the replacement list
637 of the macro] the virtual location is resolved to the locus of the
638 parameter that is replaced, in the context of the definition of the
641 If LOC is the locus of a token that is not an argument of a
642 function-like macro, then the function behaves as if LRK was set to
643 LRK_SPELLING_LOCATION.
645 If LOC_MAP is not NULL, *LOC_MAP is set to the map encoding the
646 returned location. */
648 source_location linemap_resolve_location (struct line_maps *,
650 enum location_resolution_kind lrk,
651 const struct line_map **loc_map);
653 /* Suppose that LOC is the virtual location of a token coming from the
654 expansion of a macro M. This function then steps up to get the
655 location L of the point where M got expanded. If L is a spelling
656 location inside a macro expansion M', then this function returns
657 the point where M' was expanded. LOC_MAP is an output parameter.
658 When non-NULL, *LOC_MAP is set the the map of the returned
660 source_location linemap_unwind_toward_expansion (struct line_maps *,
662 const struct line_map **loc_map);
664 /* Expand source code location LOC and return a user readable source
665 code location. LOC must be a spelling (non-virtual) location. */
667 expanded_location linemap_expand_location (const struct line_map *,
668 source_location loc);
670 /* Expand source code location LOC and return a user readable source
671 code location. LOC can be a virtual location. The LRK parameter
672 is the same as for linemap_resolve_location. */
674 expanded_location linemap_expand_location_full (struct line_maps *,
676 enum location_resolution_kind lrk);
678 #endif /* !LIBCPP_LINE_MAP_H */