Mercurial > hg > CbC > CbC_gcc
diff gcc/tree-diagnostic.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/gcc/tree-diagnostic.c Thu Oct 25 07:37:49 2018 +0900 +++ b/gcc/tree-diagnostic.c Thu Feb 13 11:34:05 2020 +0900 @@ -1,7 +1,7 @@ /* Language-independent diagnostic subroutines for the GNU Compiler Collection that are only for use in the compilers proper and not the driver or other programs. - Copyright (C) 1999-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2020 Free Software Foundation, Inc. This file is part of GCC. @@ -56,7 +56,7 @@ struct loc_map_pair { const line_map_macro *map; - source_location where; + location_t where; }; @@ -96,16 +96,17 @@ unwound macro expansion trace. That's the part generated by this function. */ -static void +void maybe_unwind_expanded_macro_loc (diagnostic_context *context, - const diagnostic_info *diagnostic, - source_location where) + location_t where) { const struct line_map *map; auto_vec<loc_map_pair> loc_vec; unsigned ix; loc_map_pair loc, *iter; + const location_t original_loc = where; + map = linemap_lookup (line_table, where); if (!linemap_macro_expansion_map_p (map)) return; @@ -142,7 +143,7 @@ first macro which expansion triggered this trace was expanded inside a system header. */ int saved_location_line = - expand_location_to_spelling_point (diagnostic_location (diagnostic)).line; + expand_location_to_spelling_point (original_loc).line; if (!LINEMAP_SYSP (ord_map)) FOR_EACH_VEC_ELT (loc_vec, ix, iter) @@ -178,14 +179,14 @@ /* Resolve the location iter->where into the locus 1/ of the comment above. */ - source_location resolved_def_loc = + location_t resolved_def_loc = linemap_resolve_location (line_table, iter->where, LRK_MACRO_DEFINITION_LOCATION, NULL); /* Don't print trace for locations that are reserved or from within a system header. */ const line_map_ordinary *m = NULL; - source_location l = + location_t l = linemap_resolve_location (line_table, resolved_def_loc, LRK_SPELLING_LOCATION, &m); if (l < RESERVED_LOCATION_COUNT || LINEMAP_SYSP (m)) @@ -210,7 +211,7 @@ /* Resolve the location of the expansion point of the macro which expansion gave the token represented by def_loc. This is the locus 2/ of the earlier comment. */ - source_location resolved_exp_loc = + location_t resolved_exp_loc = linemap_resolve_location (line_table, MACRO_MAP_EXPANSION_POINT_LOCATION (iter->map), LRK_MACRO_DEFINITION_LOCATION, NULL); @@ -238,8 +239,7 @@ virt_loc_aware_diagnostic_finalizer (diagnostic_context *context, diagnostic_info *diagnostic) { - maybe_unwind_expanded_macro_loc (context, diagnostic, - diagnostic_location (diagnostic)); + maybe_unwind_expanded_macro_loc (context, diagnostic_location (diagnostic)); } /* Default tree printer. Handles declarations only. */ @@ -312,4 +312,6 @@ diagnostic_starter (context) = default_tree_diagnostic_starter; diagnostic_finalizer (context) = default_diagnostic_finalizer; diagnostic_format_decoder (context) = default_tree_printer; + context->print_path = default_tree_diagnostic_path_printer; + context->make_json_for_path = default_tree_make_json_for_path; }