mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -409,6 +409,11 @@ public:
|
||||
wasMoved));
|
||||
}
|
||||
|
||||
AllocPackInst *createAllocPack(SILLocation loc, SILType packType) {
|
||||
return insert(AllocPackInst::create(getSILDebugLocation(loc), packType,
|
||||
getFunction()));
|
||||
}
|
||||
|
||||
AllocRefInst *createAllocRef(SILLocation Loc, SILType ObjectType,
|
||||
bool objc, bool canAllocOnStack,
|
||||
ArrayRef<SILType> ElementTypes,
|
||||
@@ -2108,6 +2113,10 @@ public:
|
||||
return insert(new (getModule())
|
||||
DeallocStackInst(getSILDebugLocation(Loc), operand));
|
||||
}
|
||||
DeallocPackInst *createDeallocPack(SILLocation loc, SILValue operand) {
|
||||
return insert(new (getModule())
|
||||
DeallocPackInst(getSILDebugLocation(loc), operand));
|
||||
}
|
||||
DeallocStackRefInst *createDeallocStackRef(SILLocation Loc,
|
||||
SILValue operand) {
|
||||
return insert(new (getModule())
|
||||
|
||||
Reference in New Issue
Block a user