File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,17 @@ static SILInstruction *createDealloc(SILInstruction *Alloc,
219219 return B.createDeallocStackRef (Location, cast<AllocRefInstBase>(Alloc));
220220 case SILInstructionKind::AllocPackInst:
221221 return B.createDeallocPack (Location, cast<AllocPackInst>(Alloc));
222+ case SILInstructionKind::BuiltinInst: {
223+ auto *bi = cast<BuiltinInst>(Alloc);
224+ assert (bi->getBuiltinKind () == BuiltinValueKind::StackAlloc ||
225+ bi->getBuiltinKind () == BuiltinValueKind::UnprotectedStackAlloc);
226+ auto &context = Alloc->getFunction ()->getModule ().getASTContext ();
227+ auto identifier =
228+ context.getIdentifier (getBuiltinName (BuiltinValueKind::StackDealloc));
229+ return B.createBuiltin (Location, identifier,
230+ SILType::getEmptyTupleType (context),
231+ SubstitutionMap (), {bi});
232+ }
222233 default :
223234 llvm_unreachable (" unknown stack allocation" );
224235 }
You can’t perform that action at this time.
0 commit comments