glsl: remove unused symbol table functionality

Added in a8f52647b0 and c17c790387 but not used since b04ef3c08a
over 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:
Timothy Arceri 2024-06-24 10:39:14 +10:00 committed by Marge Bot
parent 6ebc94250c
commit 539aaad6a3
4 changed files with 0 additions and 72 deletions

View file

@ -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);

View file

@ -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
*/

View file

@ -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)
{

View file

@ -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);