diff options
author | Brian <[email protected]> | 2007-03-23 17:48:42 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-03-23 17:48:42 -0600 |
commit | d1934c2065751e2c594316c5abd2c49c47bfc1b8 (patch) | |
tree | 68ad68ce76c79017b80ce67d8012e2b33b8bac4f /src/mesa/shader/slang/slang_ir.h | |
parent | 81767eead9e1b1b5d5dfd274c0875fa1332a5983 (diff) |
Fix issues related to the 'continue' statement.
IR_LOOP now has two children: the body code, and the tail code.
Tail code is the "i++" part of a for-loop, or the expression at the end
of a "do {} while(expr);" loop.
"continue" translates into: "execute tail code; CONT;"
Also, the test for infinite do/while loops was incorrect.
Diffstat (limited to 'src/mesa/shader/slang/slang_ir.h')
-rw-r--r-- | src/mesa/shader/slang/slang_ir.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h index cc9df69e722..37dd38eaa5d 100644 --- a/src/mesa/shader/slang/slang_ir.h +++ b/src/mesa/shader/slang/slang_ir.h @@ -53,6 +53,9 @@ typedef enum IR_COND, /* conditional expression/predicate */ IR_IF, /* high-level IF/then/else */ + /* Children[0] = conditional expression */ + /* Children[1] = if-true part */ + /* Children[2] = if-else part, or NULL */ IR_BEGIN_SUB, /* begin subroutine */ IR_END_SUB, /* end subroutine */ @@ -60,13 +63,18 @@ typedef enum IR_CALL, /* call subroutine */ IR_LOOP, /* high-level loop-begin / loop-end */ + /* Children[0] = loop body */ + /* Children[1] = loop tail code, or NULL */ + IR_CONT, /* continue loop */ + /* n->Parent = ptr to parent IR_LOOP Node */ IR_BREAK, /* break loop */ IR_BREAK_IF_TRUE, IR_BREAK_IF_FALSE, IR_CONT_IF_TRUE, IR_CONT_IF_FALSE, + /* Children[0] = the condition expression */ IR_MOVE, @@ -161,7 +169,8 @@ typedef struct slang_ir_node_ GLuint Writemask; /**< If Opcode == IR_MOVE */ GLfloat Value[4]; /**< If Opcode == IR_FLOAT */ slang_variable *Var; /**< If Opcode == IR_VAR or IR_VAR_DECL */ - struct slang_ir_node_ *BranchNode; /**< Used for branching instructions */ + struct slang_ir_node_ *List; /**< For various linked lists */ + struct slang_ir_node_ *Parent; /**< Pointer to logical parent (ie. loop) */ slang_label *Label; /**< Used for branches */ } slang_ir_node; |