OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support expansion of reserved locations wrapped in virtual locations
[pf3gnuchains/gcc-fork.git]
/
gcc
/
input.c
diff --git
a/gcc/input.c
b/gcc/input.c
index
41842b7
..
4077f9e
100644
(file)
--- a/
gcc/input.c
+++ b/
gcc/input.c
@@
-30,20
+30,23
@@
location_t input_location;
struct line_maps *line_table;
struct line_maps *line_table;
+/* Expand the source location LOC into a human readable location. If
+ LOC resolves to a builtin location, the file name of the readable
+ location is set to the string "<built-in>". */
+
expanded_location
expand_location (source_location loc)
{
expanded_location xloc;
expanded_location
expand_location (source_location loc)
{
expanded_location xloc;
+ const struct line_map *map;
+
+ loc = linemap_resolve_location (line_table, loc,
+ LRK_SPELLING_LOCATION, &map);
+ xloc = linemap_expand_location (line_table, map, loc);
+
if (loc <= BUILTINS_LOCATION)
if (loc <= BUILTINS_LOCATION)
- {
- xloc.file = loc == UNKNOWN_LOCATION ? NULL : _("<built-in>");
- xloc.line = 0;
- xloc.column = 0;
- xloc.sysp = 0;
- }
- else
- xloc = linemap_expand_location_full (line_table, loc,
- LRK_SPELLING_LOCATION);
+ xloc.file = loc == UNKNOWN_LOCATION ? NULL : _("<built-in>");
+
return xloc;
}
return xloc;
}
@@
-80,7
+83,7
@@
void
dump_line_table_statistics (void)
{
struct linemap_stats s;
dump_line_table_statistics (void)
{
struct linemap_stats s;
-
size_t
total_used_map_size,
+
long
total_used_map_size,
macro_maps_size,
total_allocated_map_size;
macro_maps_size,
total_allocated_map_size;
@@
-99,45
+102,45
@@
dump_line_table_statistics (void)
+ s.macro_maps_used_size
+ s.macro_maps_locations_size;
+ s.macro_maps_used_size
+ s.macro_maps_locations_size;
- fprintf (stderr, "Number of expanded macros: %5l
u
\n",
+ fprintf (stderr, "Number of expanded macros: %5l
d
\n",
s.num_expanded_macros);
if (s.num_expanded_macros != 0)
s.num_expanded_macros);
if (s.num_expanded_macros != 0)
- fprintf (stderr, "Average number of tokens per macro expansion: %5l
u
\n",
+ fprintf (stderr, "Average number of tokens per macro expansion: %5l
d
\n",
s.num_macro_tokens / s.num_expanded_macros);
fprintf (stderr,
"\nLine Table allocations during the "
"compilation process\n");
s.num_macro_tokens / s.num_expanded_macros);
fprintf (stderr,
"\nLine Table allocations during the "
"compilation process\n");
- fprintf (stderr, "Number of ordinary maps used: %5l
u
%c\n",
+ fprintf (stderr, "Number of ordinary maps used: %5l
d
%c\n",
SCALE (s.num_ordinary_maps_used),
STAT_LABEL (s.num_ordinary_maps_used));
SCALE (s.num_ordinary_maps_used),
STAT_LABEL (s.num_ordinary_maps_used));
- fprintf (stderr, "Ordinary map used size: %5l
u
%c\n",
+ fprintf (stderr, "Ordinary map used size: %5l
d
%c\n",
SCALE (s.ordinary_maps_used_size),
STAT_LABEL (s.ordinary_maps_used_size));
SCALE (s.ordinary_maps_used_size),
STAT_LABEL (s.ordinary_maps_used_size));
- fprintf (stderr, "Number of ordinary maps allocated: %5l
u
%c\n",
+ fprintf (stderr, "Number of ordinary maps allocated: %5l
d
%c\n",
SCALE (s.num_ordinary_maps_allocated),
STAT_LABEL (s.num_ordinary_maps_allocated));
SCALE (s.num_ordinary_maps_allocated),
STAT_LABEL (s.num_ordinary_maps_allocated));
- fprintf (stderr, "Ordinary maps allocated size: %5l
u
%c\n",
+ fprintf (stderr, "Ordinary maps allocated size: %5l
d
%c\n",
SCALE (s.ordinary_maps_allocated_size),
STAT_LABEL (s.ordinary_maps_allocated_size));
SCALE (s.ordinary_maps_allocated_size),
STAT_LABEL (s.ordinary_maps_allocated_size));
- fprintf (stderr, "Number of macro maps used: %5l
u
%c\n",
+ fprintf (stderr, "Number of macro maps used: %5l
d
%c\n",
SCALE (s.num_macro_maps_used),
STAT_LABEL (s.num_macro_maps_used));
SCALE (s.num_macro_maps_used),
STAT_LABEL (s.num_macro_maps_used));
- fprintf (stderr, "Macro maps used size: %5l
u
%c\n",
+ fprintf (stderr, "Macro maps used size: %5l
d
%c\n",
SCALE (s.macro_maps_used_size),
STAT_LABEL (s.macro_maps_used_size));
SCALE (s.macro_maps_used_size),
STAT_LABEL (s.macro_maps_used_size));
- fprintf (stderr, "Macro maps locations size: %5l
u
%c\n",
+ fprintf (stderr, "Macro maps locations size: %5l
d
%c\n",
SCALE (s.macro_maps_locations_size),
STAT_LABEL (s.macro_maps_locations_size));
SCALE (s.macro_maps_locations_size),
STAT_LABEL (s.macro_maps_locations_size));
- fprintf (stderr, "Macro maps size: %5l
u
%c\n",
+ fprintf (stderr, "Macro maps size: %5l
d
%c\n",
SCALE (macro_maps_size),
STAT_LABEL (macro_maps_size));
SCALE (macro_maps_size),
STAT_LABEL (macro_maps_size));
- fprintf (stderr, "Duplicated maps locations size: %5l
u
%c\n",
+ fprintf (stderr, "Duplicated maps locations size: %5l
d
%c\n",
SCALE (s.duplicated_macro_maps_locations_size),
STAT_LABEL (s.duplicated_macro_maps_locations_size));
SCALE (s.duplicated_macro_maps_locations_size),
STAT_LABEL (s.duplicated_macro_maps_locations_size));
- fprintf (stderr, "Total allocated maps size: %5l
u
%c\n",
+ fprintf (stderr, "Total allocated maps size: %5l
d
%c\n",
SCALE (total_allocated_map_size),
STAT_LABEL (total_allocated_map_size));
SCALE (total_allocated_map_size),
STAT_LABEL (total_allocated_map_size));
- fprintf (stderr, "Total used maps size: %5l
u
%c\n",
+ fprintf (stderr, "Total used maps size: %5l
d
%c\n",
SCALE (total_used_map_size),
STAT_LABEL (total_used_map_size));
fprintf (stderr, "\n");
SCALE (total_used_map_size),
STAT_LABEL (total_used_map_size));
fprintf (stderr, "\n");