From 539aaad6a39e28b20bc4ce12a6e5ca5c7f6a6541 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 24 Jun 2024 10:39:14 +1000 Subject: [PATCH] glsl: remove unused symbol table functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added in a8f52647b045 and c17c7903871b but not used since b04ef3c08a28 over 10 years ago. Reviewed-by: Alejandro Piñeiro Reviewed-by: Marek Olšák Part-of: --- src/compiler/glsl/glsl_symbol_table.cpp | 8 ---- src/compiler/glsl/glsl_symbol_table.h | 5 --- src/mesa/program/symbol_table.c | 54 ------------------------- src/mesa/program/symbol_table.h | 5 --- 4 files changed, 72 deletions(-) diff --git a/src/compiler/glsl/glsl_symbol_table.cpp b/src/compiler/glsl/glsl_symbol_table.cpp index eebc244bb25..1325a274007 100644 --- a/src/compiler/glsl/glsl_symbol_table.cpp +++ b/src/compiler/glsl/glsl_symbol_table.cpp @@ -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); diff --git a/src/compiler/glsl/glsl_symbol_table.h b/src/compiler/glsl/glsl_symbol_table.h index 4f19d415dbf..37cc8319ba0 100644 --- a/src/compiler/glsl/glsl_symbol_table.h +++ b/src/compiler/glsl/glsl_symbol_table.h @@ -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 */ diff --git a/src/mesa/program/symbol_table.c b/src/mesa/program/symbol_table.c index 834baf86b8d..3f34aa14740 100644 --- a/src/mesa/program/symbol_table.c +++ b/src/mesa/program/symbol_table.c @@ -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) { diff --git a/src/mesa/program/symbol_table.h b/src/mesa/program/symbol_table.h index 6db2164fc21..6ea5e83dd3f 100644 --- a/src/mesa/program/symbol_table.h +++ b/src/mesa/program/symbol_table.h @@ -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);