summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-11-17 07:09:58 -0800
committerGitHub <noreply@github.com>2017-11-17 07:09:58 -0800
commit0298a0427bbfe19700169c4e239a1b9e91baa410 (patch)
tree659dfa11e5bc687bf8baab2a7b9f39708922671e /tools/render-test
parent0e3d9ba255b86c11521a951183d38bffae008559 (diff)
IR: support `CompileTimeForStmt` (#286)
This statement type is a bit of a hack, to support loops that *must* be unrolled. The AST-to-AST pass handles them by cloning the AST for the loop body N times, and it was easy enough to do the same thing for the IR: emit the instructions for the body N times. The only thing that requires a bit of care is that now we might see the same variable declarations multiple times, so we need to play it safe and overwrite existing entries in our map from declarations to their IR values. Of course a better answer long-term would be to do the actual unrolling in the IR. This is especially true because we might some day want to support compile-time/must-unroll loops in functions, where the loop counter comes in as a parameter (but must still be compile-time-constant at every call site).
Diffstat (limited to 'tools/render-test')
0 files changed, 0 insertions, 0 deletions