Module: Mesa
Branch: master
Commit: e7f75745984937d004bf3ce08a2a8fd2149801d1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7f75745984937d004bf3ce08a2a8fd2149801d1

Author: Chia-I Wu <olva...@gmail.com>
Date:   Thu Mar 20 15:45:12 2014 +0800

glsl: remove {add,get}_type_ast from glsl_symbol_table

They are not needed since 0da1a2cc369052643ccaea75a1722cc37652d82a.

Signed-off-by: Chia-I Wu <olva...@gmail.com>
Reviewed-by: Matt Turner <matts...@gmail.com>

---

 src/glsl/glsl_parser.yy        |    1 -
 src/glsl/glsl_symbol_table.cpp |   25 -------------------------
 src/glsl/glsl_symbol_table.h   |    2 --
 3 files changed, 28 deletions(-)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index faaf438..2d0e7be 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1901,7 +1901,6 @@ struct_specifier:
       $$ = new(ctx) ast_struct_specifier($2, $4);
       $$->set_location_range(@2, @5);
       state->symbols->add_type($2, glsl_type::void_type);
-      state->symbols->add_type_ast($2, new(ctx) ast_type_specifier($$));
    }
    | STRUCT '{' struct_declaration_list '}'
    {
diff --git a/src/glsl/glsl_symbol_table.cpp b/src/glsl/glsl_symbol_table.cpp
index 11569f4..a052362 100644
--- a/src/glsl/glsl_symbol_table.cpp
+++ b/src/glsl/glsl_symbol_table.cpp
@@ -162,23 +162,6 @@ bool glsl_symbol_table::add_type(const char *name, const 
glsl_type *t)
    return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
 }
 
-static char *make_ast_name(const char *name)
-{
-   char *ast_name = new char[strlen("#ast.") + strlen(name) + 1];
-   strcpy(ast_name, "#ast.");
-   strcat(ast_name + strlen("#ast."), name);
-   return ast_name;
-}
-
-bool glsl_symbol_table::add_type_ast(const char *name, const class 
ast_type_specifier *a)
-{
-   symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(a);
-   char *ast_name = make_ast_name(name);
-   bool ret = _mesa_symbol_table_add_symbol(table, -1, ast_name, entry) == 0;
-   delete [] ast_name;
-   return ret;
-}
-
 bool glsl_symbol_table::add_interface(const char *name, const glsl_type *i,
                                       enum ir_variable_mode mode)
 {
@@ -230,14 +213,6 @@ const glsl_type *glsl_symbol_table::get_type(const char 
*name)
    return entry != NULL ? entry->t : NULL;
 }
 
-const class ast_type_specifier *glsl_symbol_table::get_type_ast(const char 
*name)
-{
-   char *ast_name = make_ast_name(name);
-   symbol_table_entry *entry = get_entry(ast_name);
-   delete [] ast_name;
-   return entry != NULL ? entry->a : NULL;
-}
-
 const glsl_type *glsl_symbol_table::get_interface(const char *name,
                                                   enum ir_variable_mode mode)
 {
diff --git a/src/glsl/glsl_symbol_table.h b/src/glsl/glsl_symbol_table.h
index 0e62448..f323fc3 100644
--- a/src/glsl/glsl_symbol_table.h
+++ b/src/glsl/glsl_symbol_table.h
@@ -98,7 +98,6 @@ public:
    /*@{*/
    bool add_variable(ir_variable *v);
    bool add_type(const char *name, const glsl_type *t);
-   bool add_type_ast(const char *name, const class ast_type_specifier *t);
    bool add_function(ir_function *f);
    bool add_interface(const char *name, const glsl_type *i,
                       enum ir_variable_mode mode);
@@ -115,7 +114,6 @@ public:
    /*@{*/
    ir_variable *get_variable(const char *name);
    const glsl_type *get_type(const char *name);
-   const class ast_type_specifier *get_type_ast(const char *name);
    ir_function *get_function(const char *name);
    const glsl_type *get_interface(const char *name,
                                   enum ir_variable_mode mode);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to