diff options
Diffstat (limited to 'gcc/tree-diagnostic.c')
-rw-r--r-- | gcc/tree-diagnostic.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/tree-diagnostic.c b/gcc/tree-diagnostic.c index 3eab7ec..788b118 100644 --- a/gcc/tree-diagnostic.c +++ b/gcc/tree-diagnostic.c @@ -61,8 +61,6 @@ typedef struct source_location where; } loc_map_pair; -DEF_VEC_O (loc_map_pair); -DEF_VEC_ALLOC_O (loc_map_pair, heap); /* Unwind the different macro expansions that lead to the token which location is WHERE and emit diagnostics showing the resulting @@ -106,7 +104,7 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context, source_location where) { const struct line_map *map; - VEC(loc_map_pair,heap) *loc_vec = NULL; + vec<loc_map_pair> loc_vec = vec<loc_map_pair>(); unsigned ix; loc_map_pair loc, *iter; @@ -127,7 +125,7 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context, loc.where = where; loc.map = map; - VEC_safe_push (loc_map_pair, heap, loc_vec, loc); + loc_vec.safe_push (loc); /* WHERE is the location of a token inside the expansion of a macro. MAP is the map holding the locations of that macro @@ -148,7 +146,7 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context, expand_location_to_spelling_point (diagnostic->location).line; if (!LINEMAP_SYSP (map)) - FOR_EACH_VEC_ELT (loc_map_pair, loc_vec, ix, iter) + FOR_EACH_VEC_ELT (loc_vec, ix, iter) { /* Sometimes, in the unwound macro expansion trace, we want to print a part of the context that shows where, in the @@ -223,7 +221,7 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context, linemap_map_get_macro_name (iter->map)); } - VEC_free (loc_map_pair, heap, loc_vec); + loc_vec.release (); } /* This is a diagnostic finalizer implementation that is aware of |