Lines Matching refs:set

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