Lines Matching refs:table
87 _mesa_symbol_table_pop_scope(struct _mesa_symbol_table *table) in _mesa_symbol_table_pop_scope() argument
89 struct scope_level *const scope = table->current_scope; in _mesa_symbol_table_pop_scope()
92 table->current_scope = scope->next; in _mesa_symbol_table_pop_scope()
93 table->depth--; in _mesa_symbol_table_pop_scope()
99 struct hash_entry *hte = _mesa_hash_table_search(table->ht, in _mesa_symbol_table_pop_scope()
108 _mesa_hash_table_remove(table->ht, hte); in _mesa_symbol_table_pop_scope()
119 _mesa_symbol_table_push_scope(struct _mesa_symbol_table *table) in _mesa_symbol_table_push_scope() argument
127 scope->next = table->current_scope; in _mesa_symbol_table_push_scope()
128 table->current_scope = scope; in _mesa_symbol_table_push_scope()
129 table->depth++; in _mesa_symbol_table_push_scope()
134 find_symbol(struct _mesa_symbol_table *table, const char *name) in find_symbol() argument
136 struct hash_entry *entry = _mesa_hash_table_search(table->ht, name); in find_symbol()
150 _mesa_symbol_table_symbol_scope(struct _mesa_symbol_table *table, in _mesa_symbol_table_symbol_scope() argument
153 struct symbol *const sym = find_symbol(table, name); in _mesa_symbol_table_symbol_scope()
156 assert(sym->depth <= table->depth); in _mesa_symbol_table_symbol_scope()
157 return table->depth - sym->depth; in _mesa_symbol_table_symbol_scope()
165 _mesa_symbol_table_find_symbol(struct _mesa_symbol_table *table, in _mesa_symbol_table_find_symbol() argument
168 struct symbol *const sym = find_symbol(table, name); in _mesa_symbol_table_find_symbol()
177 _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table, in _mesa_symbol_table_add_symbol() argument
181 struct symbol *sym = find_symbol(table, name); in _mesa_symbol_table_add_symbol()
183 if (sym && sym->depth == table->depth) in _mesa_symbol_table_add_symbol()
205 new_sym->next_with_same_scope = table->current_scope->symbols; in _mesa_symbol_table_add_symbol()
207 new_sym->depth = table->depth; in _mesa_symbol_table_add_symbol()
209 table->current_scope->symbols = new_sym; in _mesa_symbol_table_add_symbol()
211 _mesa_hash_table_insert(table->ht, new_sym->name, new_sym); in _mesa_symbol_table_add_symbol()
217 _mesa_symbol_table_replace_symbol(struct _mesa_symbol_table *table, in _mesa_symbol_table_replace_symbol() argument
221 struct symbol *sym = find_symbol(table, name); in _mesa_symbol_table_replace_symbol()
232 _mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *table, in _mesa_symbol_table_add_global_symbol() argument
237 struct symbol *sym = find_symbol(table, name); in _mesa_symbol_table_add_global_symbol()
250 for (top_scope = table->current_scope; top_scope->next != NULL; in _mesa_symbol_table_add_global_symbol()
282 _mesa_hash_table_insert(table->ht, sym->name, sym); in _mesa_symbol_table_add_global_symbol()
292 struct _mesa_symbol_table *table = calloc(1, sizeof(*table)); in _mesa_symbol_table_ctor() local
294 if (table != NULL) { in _mesa_symbol_table_ctor()
295 table->ht = _mesa_hash_table_create(NULL, _mesa_hash_string, in _mesa_symbol_table_ctor()
298 _mesa_symbol_table_push_scope(table); in _mesa_symbol_table_ctor()
301 return table; in _mesa_symbol_table_ctor()
306 _mesa_symbol_table_dtor(struct _mesa_symbol_table *table) in _mesa_symbol_table_dtor() argument
308 while (table->current_scope != NULL) { in _mesa_symbol_table_dtor()
309 _mesa_symbol_table_pop_scope(table); in _mesa_symbol_table_dtor()
312 _mesa_hash_table_destroy(table->ht, NULL); in _mesa_symbol_table_dtor()
313 free(table); in _mesa_symbol_table_dtor()