summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcpp/ChangeLog15
-rw-r--r--libcpp/include/line-map.h9
-rw-r--r--libcpp/line-map.c24
3 files changed, 31 insertions, 17 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 09304ef8496..eeef815ca52 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -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>
* lex.c (search_line_fast): Add new version to be used for Power8
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
index 0c8f588abc5..1f6553c9468 100644
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@ -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
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
@@ -599,9 +599,10 @@ linemap_position_for_column (struct line_maps *, unsigned int);
/* 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)
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index a4055c29c74..d10d578f62e 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -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
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. */
@@ -621,7 +621,7 @@ linemap_position_for_column (struct line_maps *set, unsigned int to_column)
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)
{
@@ -772,15 +772,13 @@ linemap_macro_map_loc_to_exp_point (const struct line_map *map,
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)
{
@@ -940,7 +938,7 @@ linemap_location_in_system_header_p (struct line_maps *set,
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))
@@ -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
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. */