Lines Matching refs:set

29 /* Initialize a line map set.  */
32 linemap_init (struct line_maps *set)
34 set->maps = NULL;
35 set->allocated = 0;
36 set->used = 0;
37 set->last_listed = -1;
38 set->trace_includes = false;
39 set->depth = 0;
40 set->cache = 0;
41 set->highest_location = 0;
42 set->highest_line = 0;
43 set->max_column_hint = 0;
49 linemap_check_files_exited (struct line_maps *set)
54 for (map = &set->maps[set->used - 1]; ! MAIN_FILE_P (map);
55 map = INCLUDED_FROM (set, map))
60 /* Free a line map set. */
63 linemap_free (struct line_maps *set)
65 if (set->maps)
67 linemap_check_files_exited (set);
69 free (set->maps);
83 function. A call to this function can relocate the previous set of
84 A call to this function can relocate the previous set of
88 linemap_add (struct line_maps *set, enum lc_reason reason,
92 source_location start_location = set->highest_location + 1;
94 if (set->used && start_location < set->maps[set->used - 1].start_location)
97 if (set->used == set->allocated)
99 set->allocated = 2 * set->allocated + 256;
100 set->maps = XRESIZEVEC (struct line_map, set->maps, set->allocated);
103 map = &set->maps[set->used];
110 if (set->depth == 0)
121 set->depth--;
130 from = INCLUDED_FROM (set, map - 1);
154 set->cache = set->used++;
156 set->highest_location = start_location;
157 set->highest_line = start_location;
158 set->max_column_hint = 0;
162 map->included_from = set->depth == 0 ? -1 : (int) (set->used - 2);
163 set->depth++;
164 if (set->trace_includes)
165 trace_include (set, map);
171 set->depth--;
172 map->included_from = INCLUDED_FROM (set, map - 1)->included_from;
179 linemap_line_start (struct line_maps *set, unsigned int to_line,
182 struct line_map *map = &set->maps[set->used - 1];
183 source_location highest = set->highest_location;
185 unsigned int last_line = SOURCE_LINE (map, set->highest_line);
196 max_column_hint = set->max_column_hint;
221 map = (struct line_map*) linemap_add (set, LC_RENAME, map->sysp,
229 set->highest_line = r;
230 if (r > set->highest_location)
231 set->highest_location = r;
232 set->max_column_hint = max_column_hint;
237 linemap_position_for_column (struct line_maps *set, unsigned int to_column)
239 source_location r = set->highest_line;
240 if (to_column >= set->max_column_hint)
249 struct line_map *map = &set->maps[set->used - 1];
250 r = linemap_line_start (set, SOURCE_LINE (map, r), to_column + 50);
254 if (r >= set->highest_location)
255 set->highest_location = r;
260 (source file, line) pair can be deduced. Since the set is built
265 linemap_lookup (struct line_maps *set, source_location line)
270 mn = set->cache;
271 mx = set->used;
273 cached = &set->maps[mn];
289 if (set->maps[md].start_location > line)
295 set->cache = mn;
296 return &set->maps[mn];
304 linemap_print_containing_files (struct line_maps *set,
307 if (MAIN_FILE_P (map) || set->last_listed == map->included_from)
310 set->last_listed = map->included_from;
311 map = INCLUDED_FROM (set, map);
318 map = INCLUDED_FROM (set, map);
341 trace_include (const struct line_maps *set, const struct line_map *map)
343 unsigned int i = set->depth;