Provide mask at block entry for switch statements.

This fixes a crash if 'cbreak' was used in a 'switch'.  Renamed
FunctionEmitContext::SetLoopMask() to SetBlockEntryMask(), and
similarly the loopMask member variable.
This commit is contained in:
Matt Pharr
2012-07-06 11:08:05 -07:00
parent ac421f68e2
commit 73afab464f
3 changed files with 43 additions and 40 deletions

10
ctx.h
View File

@@ -158,8 +158,8 @@ public:
bool uniformControlFlow);
/** Informs FunctionEmitContext of the value of the mask at the start
of a loop body. */
void SetLoopMask(llvm::Value *mask);
of a loop body or switch statement. */
void SetBlockEntryMask(llvm::Value *mask);
/** Informs FunctionEmitContext that code generation for a loop is
finished. */
@@ -566,9 +566,9 @@ private:
for error messages and debugging symbols. */
SourcePos funcStartPos;
/** If currently in a loop body, the value of the mask at the start of
the loop. */
llvm::Value *loopMask;
/** If currently in a loop body or switch statement, the value of the
mask at the start of it. */
llvm::Value *blockEntryMask;
/** If currently in a loop body or switch statement, this is a pointer
to memory to store a mask value that represents which of the lanes