Lines Matching refs:sym
89 struct symbol *sym = scope->symbols; in _mesa_symbol_table_pop_scope() local
96 while (sym != NULL) { in _mesa_symbol_table_pop_scope()
97 struct symbol *const next = sym->next_with_same_scope; in _mesa_symbol_table_pop_scope()
99 sym->name); in _mesa_symbol_table_pop_scope()
100 if (sym->next_with_same_name) { in _mesa_symbol_table_pop_scope()
104 hte->key = sym->next_with_same_name->name; in _mesa_symbol_table_pop_scope()
105 hte->data = sym->next_with_same_name; in _mesa_symbol_table_pop_scope()
108 free(sym->name); in _mesa_symbol_table_pop_scope()
111 free(sym); in _mesa_symbol_table_pop_scope()
112 sym = next; in _mesa_symbol_table_pop_scope()
152 struct symbol *const sym = find_symbol(table, name); in _mesa_symbol_table_symbol_scope() local
154 if (sym) { in _mesa_symbol_table_symbol_scope()
155 assert(sym->depth <= table->depth); in _mesa_symbol_table_symbol_scope()
156 return sym->depth - table->depth; in _mesa_symbol_table_symbol_scope()
167 struct symbol *const sym = find_symbol(table, name); in _mesa_symbol_table_find_symbol() local
168 if (sym) in _mesa_symbol_table_find_symbol()
169 return sym->data; in _mesa_symbol_table_find_symbol()
180 struct symbol *sym = find_symbol(table, name); in _mesa_symbol_table_add_symbol() local
182 if (sym && sym->depth == table->depth) in _mesa_symbol_table_add_symbol()
185 new_sym = calloc(1, sizeof(*sym)); in _mesa_symbol_table_add_symbol()
191 if (sym) { in _mesa_symbol_table_add_symbol()
193 new_sym->next_with_same_name = sym; in _mesa_symbol_table_add_symbol()
194 new_sym->name = sym->name; in _mesa_symbol_table_add_symbol()
220 struct symbol *sym = find_symbol(table, name); in _mesa_symbol_table_replace_symbol() local
223 if (sym == NULL) in _mesa_symbol_table_replace_symbol()
226 sym->data = declaration; in _mesa_symbol_table_replace_symbol()
236 struct symbol *sym = find_symbol(table, name); in _mesa_symbol_table_add_global_symbol() local
238 while (sym) { in _mesa_symbol_table_add_global_symbol()
239 if (sym->depth == 0) in _mesa_symbol_table_add_global_symbol()
242 inner_sym = sym; in _mesa_symbol_table_add_global_symbol()
245 sym = sym->next_with_same_name; in _mesa_symbol_table_add_global_symbol()
254 sym = calloc(1, sizeof(*sym)); in _mesa_symbol_table_add_global_symbol()
255 if (sym == NULL) { in _mesa_symbol_table_add_global_symbol()
264 inner_sym->next_with_same_name = sym; in _mesa_symbol_table_add_global_symbol()
266 sym->name = inner_sym->name; in _mesa_symbol_table_add_global_symbol()
268 sym->name = util_strdup(name); in _mesa_symbol_table_add_global_symbol()
269 if (sym->name == NULL) { in _mesa_symbol_table_add_global_symbol()
270 free(sym); in _mesa_symbol_table_add_global_symbol()
276 sym->next_with_same_scope = top_scope->symbols; in _mesa_symbol_table_add_global_symbol()
277 sym->data = declaration; in _mesa_symbol_table_add_global_symbol()
279 top_scope->symbols = sym; in _mesa_symbol_table_add_global_symbol()
281 _mesa_hash_table_insert(table->ht, sym->name, sym); in _mesa_symbol_table_add_global_symbol()