+2014-10-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * include/line-map.h (linemap_location_from_macro_expansion_p):
+ const struct line_maps * argument.
+ (linemap_position_for_line_and_column): const struct line_map *
+ argument.
+ * line-map.c (linemap_add_macro_token): Use correct argument name
+ in comment.
+ (linemap_position_for_line_and_column): const struct line_map *
+ argument.
+ (linemap_macro_map_loc_to_def_point): Fix comment. Make static.
+ (linemap_location_from_macro_expansion_p): const struct line_maps *
+ argument.
+ (linemap_resolve_location): Fix argument names in comment.
+
2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* lex.c (search_line_fast): Add new version to be used for Power8
/* Return TRUE if LOCATION is a source code location of a token coming
from a macro replacement-list at a macro expansion point, FALSE
otherwise. */
-bool linemap_location_from_macro_expansion_p (struct line_maps *,
+bool linemap_location_from_macro_expansion_p (const struct line_maps *,
source_location);
/* source_location values from 0 to RESERVED_LOCATION_COUNT-1 will
/* Encode and return a source location from a given line and
column. */
-source_location linemap_position_for_line_and_column (struct line_map *,
- linenum_type,
- unsigned int);
+source_location
+linemap_position_for_line_and_column (const struct line_map *,
+ linenum_type, unsigned int);
+
/* Return the file this map is for. */
#define LINEMAP_FILE(MAP) \
(linemap_check_ordinary (MAP)->d.ordinary.to_file)
(which is a virtual location or a source location if the caller is
itself a macro expansion or not).
- MACRO_DEFINITION_LOC is the location in the macro definition,
+ ORIG_PARM_REPLACEMENT_LOC is the location in the macro definition,
either of the token itself or of a macro parameter that it
replaces. */
column. */
source_location
-linemap_position_for_line_and_column (struct line_map *map,
+linemap_position_for_line_and_column (const struct line_map *map,
linenum_type line,
unsigned column)
{
return MACRO_MAP_EXPANSION_POINT_LOCATION (map);
}
-/* If LOCATION is the source location of a token that belongs to a
- macro replacement-list -- as part of a macro expansion -- then
- return the location of the token at the definition point of the
- macro. Otherwise, return LOCATION. SET is the set of maps
- location come from. ORIGINAL_MAP is an output parm. If non NULL,
- the function sets *ORIGINAL_MAP to the ordinary (non-macro) map the
- returned location comes from. */
+/* LOCATION is the source location of a token that belongs to a macro
+ replacement-list as part of the macro expansion denoted by MAP.
-source_location
+ Return the location of the token at the definition point of the
+ macro. */
+
+static source_location
linemap_macro_map_loc_to_def_point (const struct line_map *map,
source_location location)
{
otherwise. */
bool
-linemap_location_from_macro_expansion_p (struct line_maps *set,
+linemap_location_from_macro_expansion_p (const struct line_maps *set,
source_location location)
{
if (IS_ADHOC_LOC (location))
function-like macro, then the function behaves as if LRK was set to
LRK_SPELLING_LOCATION.
- If LOC_MAP is not NULL, *LOC_MAP is set to the map encoding the
+ If MAP is not NULL, *MAP is set to the map encoding the
returned location. Note that if the returned location wasn't originally
- encoded by a map, the *MAP is set to NULL. This can happen if LOC
+ encoded by a map, then *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. */