diff options
author | Ian Romanick <[email protected]> | 2010-08-27 15:41:20 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-09-03 11:55:22 -0700 |
commit | 3bcfafcf0320ee5407716ff67062e80d162760d4 (patch) | |
tree | 9e3b0591373f04c68da6d39dbc819257a9c96344 /src/glsl/loop_analysis.cpp | |
parent | 351525d534268b08c090f9ce42a67e9329a969ae (diff) |
glsl2: Track the number of ir_loop_jump instructions that are in a loop
Diffstat (limited to 'src/glsl/loop_analysis.cpp')
-rw-r--r-- | src/glsl/loop_analysis.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glsl/loop_analysis.cpp b/src/glsl/loop_analysis.cpp index 2ea2f3dbe39..f1268c04c4d 100644 --- a/src/glsl/loop_analysis.cpp +++ b/src/glsl/loop_analysis.cpp @@ -103,6 +103,7 @@ class loop_analysis : public ir_hierarchical_visitor { public: loop_analysis(); + virtual ir_visitor_status visit(ir_loop_jump *); virtual ir_visitor_status visit(ir_dereference_variable *); virtual ir_visitor_status visit_enter(ir_loop *); @@ -132,6 +133,22 @@ loop_analysis::loop_analysis() ir_visitor_status +loop_analysis::visit(ir_loop_jump *ir) +{ + (void) ir; + + assert(!this->state.is_empty()); + + loop_variable_state *const ls = + (loop_variable_state *) this->state.get_head(); + + ls->num_loop_jumps++; + + return visit_continue; +} + + +ir_visitor_status loop_analysis::visit(ir_dereference_variable *ir) { /* If we're not somewhere inside a loop, there's nothing to do. |