Small cleanup: allocate storage for the full mask in the FunctionEmitContext constructor

This commit is contained in:
Matt Pharr
2011-12-10 13:33:28 -08:00
parent 034507a35b
commit f6605ee465
3 changed files with 13 additions and 11 deletions

View File

@@ -189,10 +189,9 @@ lCopyInTaskParameter(int i, llvm::Value *structArgPtr, const std::vector<Symbol
void
Function::emitCode(FunctionEmitContext *ctx, llvm::Function *function,
SourcePos firstStmtPos) {
llvm::Value *maskPtr = ctx->AllocaInst(LLVMTypes::MaskType, "mask_memory");
ctx->StoreInst(LLVMMaskAllOn, maskPtr);
maskSymbol->storagePtr = maskPtr;
ctx->SetMaskPointer(maskPtr);
// Connect the __mask builtin to the location in memory that stores its
// value
maskSymbol->storagePtr = ctx->GetFullMaskPointer();
// add debugging info for __mask, programIndex, ...
maskSymbol->pos = firstStmtPos;