summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-31 17:39:10 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-31 17:43:33 -0700
commit25711a85c22bed305c9b52b89feb9c600d1892df (patch)
tree775bca79f691f5b3c5979a13037293142cc54999
parent00aa173c9cbc1d6c50bcb5caf569558759ce26d8 (diff)
Minor cleanups in ast_function_definition::hir
-rw-r--r--ast_to_hir.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index e6031ae004..627d932182 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -1513,7 +1513,7 @@ ast_function_definition::hir(exec_list *instructions,
/* Verify the return type of main() */
if (strcmp(name, "main") == 0) {
- if (return_type != glsl_type::get_instance(GLSL_TYPE_VOID, 0, 0)) {
+ if (! return_type->is_void()) {
YYLTYPE loc = this->get_location();
_mesa_glsl_error(& loc, state, "main() must return void");
@@ -1551,7 +1551,6 @@ ast_function_definition::hir(exec_list *instructions,
ast_function_parameters_to_hir(& this->prototype->parameters,
& signature->parameters,
state);
- /* FINISHME: Set signature->return_type */
label = new ir_label(name);
if (signature->definition == NULL) {
@@ -1566,9 +1565,9 @@ ast_function_definition::hir(exec_list *instructions,
*/
state->symbols->push_scope();
foreach_iter(exec_list_iterator, iter, parameters) {
- ir_variable *const var = (ir_variable *) iter.get();
+ ir_variable *const var = ((ir_instruction *) iter.get())->as_variable();
- assert(((ir_instruction *) var)->as_variable() != NULL);
+ assert(var != NULL);
iter.remove();
instructions->push_tail(var);