summaryrefslogtreecommitdiff
path: root/ast_to_hir.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-04-28 11:49:12 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-28 15:34:52 -0700
commitabd40b15210c17b2a3ba8fcffc868fda203efa01 (patch)
treed5f78a55ee20488e0102a7ce1a6d2ac94d5d9fc3 /ast_to_hir.cpp
parent0e385196f65d0f8dc3238e7eedb6f2d6c0a79a5d (diff)
Factor out qualifier checking code for later reuse.
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r--ast_to_hir.cpp28
1 files changed, 7 insertions, 21 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 7b4a855f57..0e7ab1ab3a 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -1952,27 +1952,13 @@ ast_function::hir(exec_list *instructions,
* definition.
*/
if (parameter_lists_match(& hir_parameters, & sig->parameters)) {
- exec_list_iterator iter_a = hir_parameters.iterator();
- exec_list_iterator iter_b = sig->parameters.iterator();
-
- /* check that the qualifiers match. */
- while (iter_a.has_next()) {
- ir_variable *a = (ir_variable *)iter_a.get();
- ir_variable *b = (ir_variable *)iter_b.get();
-
- if (a->read_only != b->read_only ||
- a->interpolation != b->interpolation ||
- a->centroid != b->centroid) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(& loc, state,
- "function `%s' parameter `%s' qualifiers "
- "don't match prototype",
- name, a->name);
- }
-
- iter_a.next();
- iter_b.next();
+ const char *mismatch = sig->qualifiers_match(&hir_parameters);
+ if (mismatch != NULL) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(&loc, state, "function `%s' parameter `%s' "
+ "qualifiers don't match prototype",
+ name, mismatch);
}
if (sig->return_type != return_type) {