summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McCabe <[email protected]>2011-11-07 15:05:16 -0800
committerDan McCabe <[email protected]>2011-11-07 16:31:21 -0800
commit19daba54707b4ff90159850ce97faceba9c336c0 (patch)
tree3eb772198c5577296d48ba8a03fa650a0ec8b98e
parenta69da5c0ce3c932b310bca7cd5cce78961f9946b (diff)
glsl: Create AST data structures for switch statement and case label
Data structures for switch statement and case label are created that parallel the structure of other AST data. Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/glsl/ast.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 9fe6c41252e..208ffc4197a 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -629,13 +629,19 @@ public:
class ast_case_label : public ast_node {
public:
+ ast_case_label(ast_expression *test_value);
+ virtual void print(void) const;
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
/**
- * An expression of NULL means 'default'.
+ * An test value of NULL means 'default'.
*/
- ast_expression *expression;
+ ast_expression *test_value;
};
+
class ast_selection_statement : public ast_node {
public:
ast_selection_statement(ast_expression *condition,
@@ -654,8 +660,18 @@ public:
class ast_switch_statement : public ast_node {
public:
- ast_expression *expression;
- exec_list statements;
+ ast_switch_statement(ast_expression *test_expression,
+ ast_node *body);
+ virtual void print(void) const;
+
+ virtual ir_rvalue *hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+ ast_expression *test_expression;
+ ast_node *body;
+
+protected:
+ void test_to_hir(exec_list *, struct _mesa_glsl_parse_state *);
};
class ast_iteration_statement : public ast_node {