summaryrefslogtreecommitdiffstats
path: root/ast.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-04-05 18:07:27 -0700
committerIan Romanick <[email protected]>2010-04-07 11:42:36 -0700
commit8c46ed24906ee10dd2f2cfaf4cf9803eca1ba523 (patch)
tree71eac354c7f81b6811f2dbbbc471e9b7353881f2 /ast.h
parent4cf20cd37c12c6243a09d52739d3d47f030a1799 (diff)
Generate correct IR for do-while loops
Previously the same code was generated for a while loop and a do-while loop. This pulls the code that generates the conditional break into a separate method. This method is called either at the beginning or the end depending on the loop type. Reported-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'ast.h')
-rw-r--r--ast.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ast.h b/ast.h
index ba500dc773a..d899fb1d090 100644
--- a/ast.h
+++ b/ast.h
@@ -572,6 +572,15 @@ public:
ast_expression *rest_expression;
ast_node *body;
+
+private:
+ /**
+ * Generate IR from the condition of a loop
+ *
+ * This is factored out of ::hir because some loops have the condition
+ * test at the top (for and while), and others have it at the end (do-while).
+ */
+ void condition_to_hir(class ir_loop *, struct _mesa_glsl_parse_state *);
};