Mesa (master): glsl2: Remove unnecessary glsl_symbol_table:: get_function parameter return_constructors

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Sep 2 03:40:10 UTC 2010


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Sep  1 14:16:53 2010 -0700

glsl2: Remove unnecessary glsl_symbol_table::get_function parameter return_constructors

Now that constructors are not generated as functions or stored in the
symbol table, there is no need to flag whether or not constructors
should be returned.

---

 src/glsl/ast_to_hir.cpp        |    2 +-
 src/glsl/glsl_symbol_table.cpp |    9 ++-------
 src/glsl/glsl_symbol_table.h   |    2 +-
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 970ac08..5bdf3da 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2257,7 +2257,7 @@ ast_function::hir(exec_list *instructions,
     * seen signature for a function with the same name, or, if a match is found,
     * that the previously seen signature does not have an associated definition.
     */
-   f = state->symbols->get_function(name, false);
+   f = state->symbols->get_function(name);
    if (f != NULL && !f->is_builtin) {
       sig = f->exact_matching_signature(&hir_parameters);
       if (sig != NULL) {
diff --git a/src/glsl/glsl_symbol_table.cpp b/src/glsl/glsl_symbol_table.cpp
index b56b087..e9bf89b 100644
--- a/src/glsl/glsl_symbol_table.cpp
+++ b/src/glsl/glsl_symbol_table.cpp
@@ -147,15 +147,10 @@ const glsl_type *glsl_symbol_table::get_type(const char *name)
    return entry != NULL ? entry->t : NULL;
 }
 
-ir_function *glsl_symbol_table::get_function(const char *name,
-					     bool return_constructors)
+ir_function *glsl_symbol_table::get_function(const char *name)
 {
    symbol_table_entry *entry = get_entry(name);
-   // If there's a type, the function is a constructor; caller may not want it.
-   if (entry != NULL && (return_constructors || entry->t == NULL))
-      return entry->f;
-
-   return NULL;
+   return entry != NULL ? entry->f : NULL;
 }
 
 symbol_table_entry *glsl_symbol_table::get_entry(const char *name)
diff --git a/src/glsl/glsl_symbol_table.h b/src/glsl/glsl_symbol_table.h
index f1369b5..f26de52 100644
--- a/src/glsl/glsl_symbol_table.h
+++ b/src/glsl/glsl_symbol_table.h
@@ -108,7 +108,7 @@ public:
    /*@{*/
    ir_variable *get_variable(const char *name);
    const glsl_type *get_type(const char *name);
-   ir_function *get_function(const char *name, bool return_constructors = true);
+   ir_function *get_function(const char *name);
    /*@}*/
 
 private:




More information about the mesa-commit mailing list