Use switch based on mode in ast_jump_statement::hir
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 5 Apr 2010 23:53:19 +0000 (16:53 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 7 Apr 2010 18:42:36 +0000 (11:42 -0700)
ast_to_hir.cpp

index 08e43a9aa69bf562d63f1327d5642fda006c32e0..823bab9dfa0da935e30caff6227d760b52643202 100644 (file)
@@ -1967,7 +1967,8 @@ ast_jump_statement::hir(exec_list *instructions,
                        struct _mesa_glsl_parse_state *state)
 {
 
-   if (mode == ast_return) {
+   switch (mode) {
+   case ast_return: {
       ir_return *inst;
       assert(state->current_function);
 
@@ -2005,9 +2006,10 @@ ast_jump_statement::hir(exec_list *instructions,
       }
 
       instructions->push_tail(inst);
+      break;
    }
 
-   if (mode == ast_discard) {
+   case ast_discard:
       /* FINISHME: discard support */
       if (state->target != fragment_shader) {
         YYLTYPE loc = this->get_location();
@@ -2015,6 +2017,11 @@ ast_jump_statement::hir(exec_list *instructions,
         _mesa_glsl_error(& loc, state,
                          "`discard' may only appear in a fragment shader");
       }
+      break;
+
+   case ast_break:
+   case ast_continue:
+      break;
    }
 
    /* Jump instructions do not have r-values.