Add instructions to allocate and deallocate packs.

Having added these, I'm not entirely sure we couldn't just use
alloc_stack and dealloc_stack.  Well, if we find ourselves adding
a lot of redundancy with those instructions (e.g. around DI), we
can always go back and rip these out.
This commit is contained in:
John McCall
2023-01-31 22:39:34 -05:00
parent c491d25d06
commit 6bf9ac858b
18 changed files with 174 additions and 2 deletions

View File

@@ -4613,6 +4613,14 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
break;
}
case SILInstructionKind::AllocPackInst: {
SILType Ty;
if (parseSILType(Ty))
return true;
ResultVal = B.createAllocPack(InstLoc, Ty);
break;
}
case SILInstructionKind::AllocStackInst: {
bool hasDynamicLifetime = false;
bool isLexical = false;
@@ -4732,6 +4740,11 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
return true;
ResultVal = B.createDeallocStackRef(InstLoc, Val);
break;
case SILInstructionKind::DeallocPackInst:
if (parseTypedValueRef(Val, B) || parseSILDebugLocation(InstLoc, B))
return true;
ResultVal = B.createDeallocPack(InstLoc, Val);
break;
case SILInstructionKind::DeallocRefInst: {
if (parseTypedValueRef(Val, B) || parseSILDebugLocation(InstLoc, B))
return true;