Lines Matching refs:sym
157 struct symbol *sym; in find_symbol() local
159 for (sym = symtab[h]; sym; sym = sym->hash_next) in find_symbol()
160 if (map_to_ns(sym->type) == map_to_ns(ns) && in find_symbol()
161 strcmp(name, sym->name) == 0 && in find_symbol()
162 sym->is_declared) in find_symbol()
165 if (exact && sym && sym->type != ns) in find_symbol()
167 return sym; in find_symbol()
170 static int is_unknown_symbol(struct symbol *sym) in is_unknown_symbol() argument
174 return ((sym->type == SYM_STRUCT || in is_unknown_symbol()
175 sym->type == SYM_UNION || in is_unknown_symbol()
176 sym->type == SYM_ENUM) && in is_unknown_symbol()
177 (defn = sym->defn) && defn->tag == SYM_NORMAL && in is_unknown_symbol()
190 struct symbol *sym; in __add_symbol() local
230 for (sym = symtab[h]; sym; sym = sym->hash_next) { in __add_symbol()
231 if (map_to_ns(sym->type) == map_to_ns(type) && in __add_symbol()
232 strcmp(name, sym->name) == 0) { in __add_symbol()
235 else if (sym->type == type && in __add_symbol()
236 equal_list(sym->defn, defn)) { in __add_symbol()
237 if (!sym->is_declared && sym->is_override) { in __add_symbol()
243 sym->is_declared = 1; in __add_symbol()
244 return sym; in __add_symbol()
245 } else if (!sym->is_declared) { in __add_symbol()
246 if (sym->is_override && flag_preserve) { in __add_symbol()
251 sym->is_declared = 1; in __add_symbol()
252 return sym; in __add_symbol()
254 status = is_unknown_symbol(sym) ? in __add_symbol()
259 return sym; in __add_symbol()
265 if (sym) { in __add_symbol()
269 if (*psym == sym) { in __add_symbol()
270 *psym = sym->hash_next; in __add_symbol()
277 sym = xmalloc(sizeof(*sym)); in __add_symbol()
278 sym->name = name; in __add_symbol()
279 sym->type = type; in __add_symbol()
280 sym->defn = defn; in __add_symbol()
281 sym->expansion_trail = NULL; in __add_symbol()
282 sym->visited = NULL; in __add_symbol()
283 sym->is_extern = is_extern; in __add_symbol()
285 sym->hash_next = symtab[h]; in __add_symbol()
286 symtab[h] = sym; in __add_symbol()
288 sym->is_declared = !is_reference; in __add_symbol()
289 sym->status = status; in __add_symbol()
290 sym->is_override = 0; in __add_symbol()
306 return sym; in __add_symbol()
460 struct string_list *sym, *def; in read_reference() local
464 sym = read_node(f); in read_reference()
465 if (sym && sym->tag == SYM_NORMAL && in read_reference()
466 !strcmp(sym->string, "override")) { in read_reference()
468 free_node(sym); in read_reference()
469 sym = read_node(f); in read_reference()
471 if (!sym) in read_reference()
485 subsym = add_reference_symbol(xstrdup(sym->string), sym->tag, in read_reference()
488 free_node(sym); in read_reference()
530 static unsigned long expand_and_crc_sym(struct symbol *sym, unsigned long crc) in expand_and_crc_sym() argument
532 struct string_list *list = sym->defn; in expand_and_crc_sym()
624 if (!sym->visited) { in expand_and_crc_sym()
625 *end = sym; in expand_and_crc_sym()
626 end = &sym->visited; in expand_and_crc_sym()
627 sym->visited = (struct symbol *)-1L; in expand_and_crc_sym()
636 struct symbol *sym; in export_symbol() local
638 sym = find_symbol(name, SYM_NORMAL, 0); in export_symbol()
639 if (!sym) in export_symbol()
650 sym->expansion_trail = expansion_trail; in export_symbol()
651 expansion_trail = sym; in export_symbol()
652 crc = expand_and_crc_sym(sym, 0xffffffff) ^ 0xffffffff; in export_symbol()
654 sym = expansion_trail; in export_symbol()
655 while (sym != (struct symbol *)-1L) { in export_symbol()
656 struct symbol *n = sym->expansion_trail; in export_symbol()
658 if (sym->status != STATUS_UNCHANGED) { in export_symbol()
667 print_type_name(sym->type, sym->name); in export_symbol()
668 if (sym->status == STATUS_DEFINED) in export_symbol()
674 sym->expansion_trail = 0; in export_symbol()
675 sym = n; in export_symbol()
833 struct symbol *sym = visited_symbols; in main() local
835 if (sym->is_override) in main()
837 if (symbol_types[sym->type].n) { in main()
838 putc(symbol_types[sym->type].n, dumpfile); in main()
841 fputs(sym->name, dumpfile); in main()
843 if (sym->is_extern) in main()
845 print_list(dumpfile, sym->defn); in main()
848 visited_symbols = sym->visited; in main()
849 sym->visited = NULL; in main()