Index: gcc/libcpp/line-map.c |
diff --git a/gcc/libcpp/line-map.c b/gcc/libcpp/line-map.c |
index 3e25511e6aca4685c4e3e91ab436d4c494017352..a82c4286f07ba2d48bde4b2d5a9e7c4008651a24 100644 |
--- a/gcc/libcpp/line-map.c |
+++ b/gcc/libcpp/line-map.c |
@@ -38,9 +38,10 @@ linemap_init (struct line_maps *set) |
set->trace_includes = false; |
set->depth = 0; |
set->cache = 0; |
- set->highest_location = 0; |
- set->highest_line = 0; |
+ set->highest_location = RESERVED_LOCATION_COUNT - 1; |
+ set->highest_line = RESERVED_LOCATION_COUNT - 1; |
set->max_column_hint = 0; |
+ set->reallocator = 0; |
} |
/* Check for and warn about line_maps entered but not exited. */ |
@@ -108,9 +109,12 @@ linemap_add (struct line_maps *set, enum lc_reason reason, |
map = &set->maps[set->used]; |
- if (to_file && *to_file == '\0') |
+ if (to_file && *to_file == '\0' && reason != LC_RENAME_VERBATIM) |
to_file = "<stdin>"; |
+ if (reason == LC_RENAME_VERBATIM) |
+ reason = LC_RENAME; |
+ |
/* If we don't keep our line maps consistent, we can easily |
segfault. Don't rely on the client to do it for us. */ |
if (set->depth == 0) |
@@ -302,45 +306,6 @@ linemap_lookup (struct line_maps *set, source_location line) |
return &set->maps[mn]; |
} |
-/* Print the file names and line numbers of the #include commands |
- which led to the map MAP, if any, to stderr. Nothing is output if |
- the most recently listed stack is the same as the current one. */ |
- |
-void |
-linemap_print_containing_files (struct line_maps *set, |
- const struct line_map *map) |
-{ |
- if (MAIN_FILE_P (map) || set->last_listed == map->included_from) |
- return; |
- |
- set->last_listed = map->included_from; |
- map = INCLUDED_FROM (set, map); |
- |
- fprintf (stderr, _("In file included from %s:%u"), |
- map->to_file, LAST_SOURCE_LINE (map)); |
- |
- while (! MAIN_FILE_P (map)) |
- { |
- map = INCLUDED_FROM (set, map); |
- /* Translators note: this message is used in conjunction |
- with "In file included from %s:%ld" and some other |
- tricks. We want something like this: |
- |
- | In file included from sys/select.h:123, |
- | from sys/types.h:234, |
- | from userfile.c:31: |
- | bits/select.h:45: <error message here> |
- |
- with all the "from"s lined up. |
- The trailing comma is at the beginning of this message, |
- and the trailing colon is not translated. */ |
- fprintf (stderr, _(",\n from %s:%u"), |
- map->to_file, LAST_SOURCE_LINE (map)); |
- } |
- |
- fputs (":\n", stderr); |
-} |
- |
/* Print an include trace, for e.g. the -H option of the preprocessor. */ |
static void |