Thread ForUnwind_t into emitCleanupsForReturn.

Some "return" edges are for unwinding due to errors and some aren't.
They'll need to be distinguished if we ever want to support throwing
cleanups.
This commit is contained in:
John McCall
2018-08-16 02:02:55 -04:00
parent 1c99f31f20
commit af1fbee3de
8 changed files with 15 additions and 12 deletions

View File

@@ -552,7 +552,7 @@ void SILGenFunction::emitArtificialTopLevel(ClassDecl *mainClass) {
if (r->getType() != rType)
r = B.createStruct(mainClass, rType, r);
Cleanups.emitCleanupsForReturn(mainClass);
Cleanups.emitCleanupsForReturn(mainClass, NotForUnwind);
B.createReturn(mainClass, r);
return;
}