tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Fix comment.

2012-04-26  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Fix
	comment. Delete unused parameter first_exp_point_map.
	(virt_loc_aware_diagnostic_finalizer): Update call.
libcpp/
	* line-map.c (linemap_resolve_location): Synchronize comments with
	those in line-map.h.
	* include/line-map.h (linemap_resolve_location): Fix spelling in
	comment.

From-SVN: r186860
parent c7121189
2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
* tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Fix
comment. Delete unused parameter first_exp_point_map.
(virt_loc_aware_diagnostic_finalizer): Update call.
2012-04-26 Michael Hope <michael.hope@linaro.org> 2012-04-26 Michael Hope <michael.hope@linaro.org>
Richard Earnshaw <rearnsha@arm.com> Richard Earnshaw <rearnsha@arm.com>
......
...@@ -95,23 +95,18 @@ DEF_VEC_ALLOC_O (loc_map_pair, heap); ...@@ -95,23 +95,18 @@ DEF_VEC_ALLOC_O (loc_map_pair, heap);
test.c:5:3: note: expanded from here test.c:5:3: note: expanded from here
test.c:5:14: note: in expansion of macro 'SHIFTL' test.c:5:14: note: in expansion of macro 'SHIFTL'
test.c:8:3: note: expanded from here test.c:8:3: note: expanded from here
test.c:8:3: note: in expansion of macro 'MULT2' test.c:8:3: note: in expansion of macro 'MULT'
test.c:13:3: note: expanded from here test.c:13:3: note: expanded from here
The part that goes from the third to the eighth line of this The part that goes from the third to the eighth line of this
diagnostic (the lines containing the 'note:' string) is called the diagnostic (the lines containing the 'note:' string) is called the
unwound macro expansion trace. That's the part generated by this unwound macro expansion trace. That's the part generated by this
function. function. */
If FIRST_EXP_POINT_MAP is non-null, *FIRST_EXP_POINT_MAP is set to
the map of the location in the source that first triggered the
macro expansion. This must be an ordinary map. */
static void static void
maybe_unwind_expanded_macro_loc (diagnostic_context *context, maybe_unwind_expanded_macro_loc (diagnostic_context *context,
diagnostic_info *diagnostic, diagnostic_info *diagnostic,
source_location where, source_location where)
const struct line_map **first_exp_point_map)
{ {
const struct line_map *map; const struct line_map *map;
VEC(loc_map_pair,heap) *loc_vec = NULL; VEC(loc_map_pair,heap) *loc_vec = NULL;
...@@ -146,8 +141,8 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context, ...@@ -146,8 +141,8 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context,
where = linemap_unwind_toward_expansion (line_table, where, &map); where = linemap_unwind_toward_expansion (line_table, where, &map);
} while (linemap_macro_expansion_map_p (map)); } while (linemap_macro_expansion_map_p (map));
if (first_exp_point_map) /* Now map is set to the map of the location in the source that
*first_exp_point_map = map; first triggered the macro expansion. This must be an ordinary map. */
/* Walk LOC_VEC and print the macro expansion trace, unless the /* Walk LOC_VEC and print the macro expansion trace, unless the
first macro which expansion triggered this trace was expanded first macro which expansion triggered this trace was expanded
...@@ -227,8 +222,7 @@ virt_loc_aware_diagnostic_finalizer (diagnostic_context *context, ...@@ -227,8 +222,7 @@ virt_loc_aware_diagnostic_finalizer (diagnostic_context *context,
diagnostic_info *diagnostic) diagnostic_info *diagnostic)
{ {
maybe_unwind_expanded_macro_loc (context, diagnostic, maybe_unwind_expanded_macro_loc (context, diagnostic,
diagnostic->location, diagnostic->location);
NULL);
} }
/* Default tree printer. Handles declarations only. */ /* Default tree printer. Handles declarations only. */
......
2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
* line-map.c (linemap_resolve_location): Synchronize comments with
those in line-map.h.
* include/line-map.h (linemap_resolve_location): Fix spelling in
comment.
2012-03-22 Richard Earnshaw <rearnsha@arm.com> 2012-03-22 Richard Earnshaw <rearnsha@arm.com>
* lex.c (search_line_fast): Provide Neon-optimized version for ARM. * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
......
...@@ -651,7 +651,7 @@ enum location_resolution_kind ...@@ -651,7 +651,7 @@ enum location_resolution_kind
LRK_SPELLING_LOCATION. LRK_SPELLING_LOCATION.
If LOC_MAP is not NULL, *LOC_MAP is set to the map encoding the If LOC_MAP is not NULL, *LOC_MAP is set to the map encoding the
returned location. Note that if the resturned 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, the *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. */
......
...@@ -1015,19 +1015,22 @@ linemap_macro_loc_to_exp_point (struct line_maps *set, ...@@ -1015,19 +1015,22 @@ linemap_macro_loc_to_exp_point (struct line_maps *set,
* If LRK is set to LRK_MACRO_EXPANSION_POINT * If LRK is set to LRK_MACRO_EXPANSION_POINT
------------------------------- -------------------------------
The virtual location is resolved to the location to the locus of The virtual location is resolved to the first macro expansion point
the expansion point of the macro. that led to this macro expansion.
* If LRK is set to LRK_SPELLING_LOCATION * If LRK is set to LRK_SPELLING_LOCATION
------------------------------------- -------------------------------------
The virtual location is resolved to the location to the locus where The virtual location is resolved to the locus where the token has
the token has been spelled in the source. This can follow through been spelled in the source. This can follow through all the macro
all the macro expansions that led to the token. expansions that led to the token.
* If LRK is set to LRK_MACRO_PARM_REPLACEMENT_POINT * If LRK is set to LRK_MACRO_DEFINITION_LOCATION
-------------------------------------- --------------------------------------
The virtual location is resolved to the locus of the token in the
context of the macro definition.
If LOC is the locus of a token that is an argument of a If LOC is the locus of a token that is an argument of a
function-like macro [replacing a parameter in the replacement list function-like macro [replacing a parameter in the replacement list
of the macro] the virtual location is resolved to the locus of the of the macro] the virtual location is resolved to the locus of the
...@@ -1038,8 +1041,8 @@ linemap_macro_loc_to_exp_point (struct line_maps *set, ...@@ -1038,8 +1041,8 @@ 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 MAP is non-NULL, *MAP is set to the map of the resolved If LOC_MAP is not NULL, *LOC_MAP is set to the map encoding the
location. Note that if the resturned 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, the *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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment