line-map.h (linemap_location_from_macro_expansion_p): const struct line_maps * argument.

libcpp/ChangeLog:

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.

From-SVN: r216205
This commit is contained in:
Manuel López-Ibáñez 2014-10-14 14:45:36 +00:00
parent 48d3af1259
commit 3aac09524b
3 changed files with 31 additions and 17 deletions

View File

@ -1,3 +1,18 @@
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> 2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* lex.c (search_line_fast): Add new version to be used for Power8 * lex.c (search_line_fast): Add new version to be used for Power8

View File

@ -523,7 +523,7 @@ int linemap_location_in_system_header_p (struct line_maps *,
/* Return TRUE if LOCATION is a source code location of a token coming /* Return TRUE if LOCATION is a source code location of a token coming
from a macro replacement-list at a macro expansion point, FALSE from a macro replacement-list at a macro expansion point, FALSE
otherwise. */ 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);
/* source_location values from 0 to RESERVED_LOCATION_COUNT-1 will /* source_location values from 0 to RESERVED_LOCATION_COUNT-1 will
@ -599,9 +599,10 @@ linemap_position_for_column (struct line_maps *, unsigned int);
/* Encode and return a source location from a given line and /* Encode and return a source location from a given line and
column. */ column. */
source_location linemap_position_for_line_and_column (struct line_map *, source_location
linenum_type, linemap_position_for_line_and_column (const struct line_map *,
unsigned int); linenum_type, unsigned int);
/* Return the file this map is for. */ /* Return the file this map is for. */
#define LINEMAP_FILE(MAP) \ #define LINEMAP_FILE(MAP) \
(linemap_check_ordinary (MAP)->d.ordinary.to_file) (linemap_check_ordinary (MAP)->d.ordinary.to_file)

View File

@ -484,7 +484,7 @@ linemap_enter_macro (struct line_maps *set, struct cpp_hashnode *macro_node,
(which is a virtual location or a source location if the caller is (which is a virtual location or a source location if the caller is
itself a macro expansion or not). 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 either of the token itself or of a macro parameter that it
replaces. */ replaces. */
@ -621,7 +621,7 @@ linemap_position_for_column (struct line_maps *set, unsigned int to_column)
column. */ column. */
source_location 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, linenum_type line,
unsigned column) unsigned column)
{ {
@ -772,15 +772,13 @@ linemap_macro_map_loc_to_exp_point (const struct line_map *map,
return MACRO_MAP_EXPANSION_POINT_LOCATION (map); return MACRO_MAP_EXPANSION_POINT_LOCATION (map);
} }
/* If LOCATION is the source location of a token that belongs to a /* LOCATION is the source location of a token that belongs to a macro
macro replacement-list -- as part of a macro expansion -- then replacement-list as part of the macro expansion denoted by MAP.
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. */
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, linemap_macro_map_loc_to_def_point (const struct line_map *map,
source_location location) source_location location)
{ {
@ -940,7 +938,7 @@ linemap_location_in_system_header_p (struct line_maps *set,
otherwise. */ otherwise. */
bool 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) source_location location)
{ {
if (IS_ADHOC_LOC (location)) if (IS_ADHOC_LOC (location))
@ -1233,9 +1231,9 @@ linemap_macro_loc_to_exp_point (struct line_maps *set,
function-like macro, then the function behaves as if LRK was set to function-like macro, then the function behaves as if LRK was set to
LRK_SPELLING_LOCATION. 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 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 resolves to a location reserved for the client code, like
UNKNOWN_LOCATION or BUILTINS_LOCATION in GCC. */ UNKNOWN_LOCATION or BUILTINS_LOCATION in GCC. */