Distinguish between 'regular' foreach and foreach_unique in FunctionEmitContext

We need to do this since it's illegal to have nested foreach statements, but
nested foreach_unique, or foreach_unique inside foreach, etc., are all fine.
This commit is contained in:
Matt Pharr
2012-06-22 06:04:00 -07:00
parent 2b4a3b22bf
commit ed13dd066b
3 changed files with 41 additions and 24 deletions

7
ctx.h
View File

@@ -160,9 +160,10 @@ public:
finished. */
void EndLoop();
/** Indicates that code generation for a 'foreach' or 'foreach_tiled'
loop is about to start. */
void StartForeach();
/** Indicates that code generation for a 'foreach', 'foreach_tiled', or
'foreach_unique' loop is about to start. */
enum ForeachType { FOREACH_REGULAR, FOREACH_UNIQUE };
void StartForeach(ForeachType ft);
void EndForeach();
/** Emit code for a 'break' statement in a loop. If doCoherenceCheck