vector<Node *> saved_refs;
swap(loop_ext_refs, saved_refs);
{
+ if(iter.init_statement)
+ iter.init_statement->visit(*this);
SetForScope<unsigned> set_loop(in_loop, in_loop+1);
- TraversingVisitor::visit(iter);
+ if(iter.condition)
+ iter.condition->visit(*this);
+ iter.body.visit(*this);
+ if(iter.loop_expression)
+ iter.loop_expression->visit(*this);
}
swap(loop_ext_refs, saved_refs);
--- /dev/null
+#pragma MSP stage(vertex)
+void main()
+{
+ int n = 0;
+ for(int i=10; i!=1; )
+ {
+ if((i&1)==0)
+ i /= 2;
+ else
+ i = 3*i+1;
+ ++n;
+ }
+ gl_Position = vec4(n);
+}
+
+/* Expected output: vertex
+void main()
+{
+ int n = 0;
+ for(int i = 10; i!=1;)
+ {
+ if((i&1)==0)
+ i /= 2;
+ else
+ i = 3*i+1;
+ ++n;
+ }
+ gl_Position = vec4(0.0);
+}
+*/