summaryrefslogtreecommitdiff
path: root/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-04-05 16:53:19 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-07 11:42:36 -0700
commitc0e76d8352fbe96efb0338e9d98b08494671e504 (patch)
treefe9a5e277d59592efac9ce3ddbf61c957423c652 /ast_to_hir.cpp
parentd6313d7a01d842483ae8e5bd1f5dcd20ace1b6f1 (diff)
Use switch based on mode in ast_jump_statement::hir
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r--ast_to_hir.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 08e43a9..823bab9 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -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.