mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
glsl: remove unused symbol table functionality
Added ina8f52647b0andc17c790387but not used sinceb04ef3c08aover 10 years ago. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29868>
This commit is contained in:
parent
6ebc94250c
commit
539aaad6a3
4 changed files with 0 additions and 72 deletions
|
|
@ -220,14 +220,6 @@ bool glsl_symbol_table::add_default_precision_qualifier(const char *type_name,
|
|||
return _mesa_symbol_table_replace_symbol(table, name, entry) == 0;
|
||||
}
|
||||
|
||||
void glsl_symbol_table::add_global_function(ir_function *f)
|
||||
{
|
||||
symbol_table_entry *entry = new(linalloc) symbol_table_entry(f);
|
||||
int added = _mesa_symbol_table_add_global_symbol(table, f->name, entry);
|
||||
assert(added == 0);
|
||||
(void)added;
|
||||
}
|
||||
|
||||
ir_variable *glsl_symbol_table::get_variable(const char *name)
|
||||
{
|
||||
symbol_table_entry *entry = get_entry(name);
|
||||
|
|
|
|||
|
|
@ -72,11 +72,6 @@ struct glsl_symbol_table {
|
|||
bool add_default_precision_qualifier(const char *type_name, int precision);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* Add an function at global scope without checking for scoping conflicts.
|
||||
*/
|
||||
void add_global_function(ir_function *f);
|
||||
|
||||
/**
|
||||
* \name Methods to get symbols from the table
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -226,60 +226,6 @@ _mesa_symbol_table_replace_symbol(struct _mesa_symbol_table *table,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
_mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *table,
|
||||
const char *name, void *declaration)
|
||||
{
|
||||
struct scope_level *top_scope;
|
||||
struct symbol *inner_sym = NULL;
|
||||
struct symbol *sym = find_symbol(table, name);
|
||||
|
||||
while (sym) {
|
||||
if (sym->depth == 0)
|
||||
return -1;
|
||||
|
||||
inner_sym = sym;
|
||||
|
||||
/* Get symbol from the outer scope with the same name */
|
||||
sym = sym->next_with_same_name;
|
||||
}
|
||||
|
||||
/* Find the top-level scope */
|
||||
for (top_scope = table->current_scope; top_scope->next != NULL;
|
||||
top_scope = top_scope->next) {
|
||||
/* empty */
|
||||
}
|
||||
|
||||
sym = calloc(1, sizeof(*sym) + (inner_sym ? 0 : strlen(name) + 1));
|
||||
if (sym == NULL) {
|
||||
_mesa_error_no_memory(__func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (inner_sym) {
|
||||
/* In case we add the global out of order store a link to the global
|
||||
* symbol in global.
|
||||
*/
|
||||
inner_sym->next_with_same_name = sym;
|
||||
|
||||
sym->name = inner_sym->name;
|
||||
} else {
|
||||
sym->name = (char *)(sym + 1);
|
||||
strcpy(sym->name, name);
|
||||
}
|
||||
|
||||
sym->next_with_same_scope = top_scope->symbols;
|
||||
sym->data = declaration;
|
||||
|
||||
top_scope->symbols = sym;
|
||||
|
||||
_mesa_hash_table_insert(table->ht, sym->name, sym);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct _mesa_symbol_table *
|
||||
_mesa_symbol_table_ctor(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,11 +40,6 @@ extern int _mesa_symbol_table_replace_symbol(struct _mesa_symbol_table *table,
|
|||
const char *name,
|
||||
void *declaration);
|
||||
|
||||
extern int
|
||||
_mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *symtab,
|
||||
const char *name,
|
||||
void *declaration);
|
||||
|
||||
extern int _mesa_symbol_table_symbol_scope(struct _mesa_symbol_table *table,
|
||||
const char *name);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue