summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_symbol_table.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-08-25 17:10:16 -0700
committerIan Romanick <[email protected]>2010-08-26 09:19:48 -0700
commitac2376e6f51677ab321930b0200a79d1683cfbba (patch)
tree2894ed6e3488c17cf8b0a511fc01c50aa3a04856 /src/glsl/glsl_symbol_table.cpp
parente09591317b2470fe9c104606577d4e10255727c0 (diff)
glsl: Don't add overloads to existing structure constructors.
Instead, make a new ir_function and try to add it to the symbol table. Fixes piglit test redeclaration-08.vert.
Diffstat (limited to 'src/glsl/glsl_symbol_table.cpp')
-rw-r--r--src/glsl/glsl_symbol_table.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/glsl/glsl_symbol_table.cpp b/src/glsl/glsl_symbol_table.cpp
index 76c440c3420..11e16713351 100644
--- a/src/glsl/glsl_symbol_table.cpp
+++ b/src/glsl/glsl_symbol_table.cpp
@@ -147,10 +147,15 @@ 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)
+ir_function *glsl_symbol_table::get_function(const char *name,
+ bool return_constructors)
{
symbol_table_entry *entry = get_entry(name);
- return entry != NULL ? entry->f : NULL;
+ // 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;
}
symbol_table_entry *glsl_symbol_table::get_entry(const char *name)