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