Lines Matching defs:sym
31 static pseudo_t linearize_one_symbol(struct entrypoint *ep, struct symbol *sym);
112 struct symbol *sym = pseudo->sym;
115 if (!sym) {
119 if (sym->bb_target) {
120 snprintf(buf, 64, "%s", show_label(sym->bb_target));
123 if (sym->ident) {
124 snprintf(buf, 64, "%s", show_ident(sym->ident));
127 expr = sym->initializer;
128 snprintf(buf, 64, "<anon symbol:%p>", verbose ? sym : NULL);
586 struct symbol *sym;
594 FOR_EACH_PTR(ep->syms, sym) {
595 if (!sym->pseudo)
597 if (!sym->pseudo->users)
599 printf(" sym: %p %s\n", sym, show_ident(sym->ident));
600 if (sym->ctype.modifiers & (MOD_EXTERN | MOD_STATIC | MOD_ADDRESSABLE))
602 show_symbol_usage(sym->pseudo);
603 } END_FOR_EACH_PTR(sym);
767 static pseudo_t symbol_pseudo(struct entrypoint *ep, struct symbol *sym)
771 if (!sym)
774 pseudo = sym->pseudo;
779 pseudo->sym = sym;
780 pseudo->ident = sym->ident;
781 sym->pseudo = pseudo;
928 static struct symbol *bitfield_base_type(struct symbol *sym)
930 struct symbol *base = sym;
932 if (sym) {
933 if (sym->type == SYM_NODE)
937 if (sym->packed) {
938 int size = bits_to_bytes(sym->bit_offset + sym->bit_size);
939 sym = __alloc_symbol(0);
940 *sym = *base;
941 sym->bit_size = bytes_to_bits(size);
942 return sym;
947 return sym;
1952 static pseudo_t linearize_one_symbol(struct entrypoint *ep, struct symbol *sym)
1957 if (!sym || !sym->initializer || sym->initialized)
1961 if (sym->ctype.modifiers & (MOD_STATIC | MOD_TOPLEVEL))
1964 sym->initialized = 1;
1965 ad.address = symbol_pseudo(ep, sym);
1967 if (sym->initializer && !is_scalar_type(sym)) {
1973 ad.type = sym;
1974 ad.address = symbol_pseudo(ep, sym);
1978 value = linearize_initializer(ep, sym->initializer, &ad);
2040 struct symbol *sym;
2043 FOR_EACH_PTR(args->declaration, sym) {
2044 pseudo_t value = linearize_one_symbol(ep, sym);
2046 } END_FOR_EACH_PTR(sym);
2202 struct symbol *sym;
2206 FOR_EACH_PTR(stmt->declaration, sym) {
2207 linearize_one_symbol(ep, sym);
2208 } END_FOR_EACH_PTR(sym);
2229 struct symbol *sym;
2252 FOR_EACH_PTR(stmt->switch_case->symbol_list, sym) {
2253 struct statement *case_stmt = sym->stmt;
2254 struct basic_block *bb_case = get_bound_block(ep, sym);
2277 } END_FOR_EACH_PTR(sym);
2305 struct symbol *sym;
2307 FOR_EACH_PTR(stmt->iterator_syms, sym) {
2308 linearize_one_symbol(ep, sym);
2309 } END_FOR_EACH_PTR(sym);
2394 struct symbol *sym;
2424 FOR_EACH_PTR(stmt->target_list, sym) {
2425 struct basic_block *bb_computed = get_bound_block(ep, sym);
2430 } END_FOR_EACH_PTR(sym);
2532 static struct entrypoint *linearize_fn(struct symbol *sym, struct symbol *base_type)
2544 if (!stmt || sym->bogus_linear)
2548 ep->name = sym;
2549 sym->ep = ep;
2550 bb = alloc_basic_block(ep, sym->pos);
2582 struct entrypoint *linearize_symbol(struct symbol *sym)
2586 if (!sym)
2588 current_pos = sym->pos;
2589 base_type = sym->ctype.base_type;
2593 return linearize_fn(sym, base_type);
2665 struct symbol *sym;
2666 sym = create_symbol(stream, ptr->name, SYM_NODE, NS_SYMBOL);
2667 if (!sym->op)
2668 sym->op = &ptr->op;
2669 sym->op->type |= KW_BUILTIN;
2670 sym->op->linearize = ptr->linearize;