Skip to content

Commit 3d7cf92

Browse files
committed
[silgen] Tell prepareEpilog to emit a rethrow block instead of calling prepareRethrowEpilog.
The code inside of prepareEpilog that does this just calls prepareRethrowEpilog, so this code is not needed. rdar://34222540
1 parent 9e9c953 commit 3d7cf92

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lib/SILGen/SILGen.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,23 +1252,19 @@ class SourceFileScope {
12521252

12531253
sgm.TopLevelSGF = new SILGenFunction(sgm, *toplevel);
12541254
sgm.TopLevelSGF->MagicFunctionName = sgm.SwiftModule->getName();
1255-
sgm.TopLevelSGF->prepareEpilog(Type(), false,
1256-
CleanupLocation::getModuleCleanupLocation());
1257-
1258-
sgm.TopLevelSGF->prepareRethrowEpilog(
1259-
CleanupLocation::getModuleCleanupLocation());
1255+
auto moduleCleanupLoc = CleanupLocation::getModuleCleanupLocation();
1256+
sgm.TopLevelSGF->prepareEpilog(Type(), true, moduleCleanupLoc);
12601257

12611258
// Create the argc and argv arguments.
1262-
auto PrologueLoc = RegularLocation::getModuleLocation();
1263-
PrologueLoc.markAsPrologue();
1259+
auto prologueLoc = RegularLocation::getModuleLocation();
1260+
prologueLoc.markAsPrologue();
12641261
auto entry = sgm.TopLevelSGF->B.getInsertionBB();
12651262
auto paramTypeIter =
12661263
sgm.TopLevelSGF->F.getConventions().getParameterSILTypes().begin();
12671264
entry->createFunctionArgument(*paramTypeIter);
12681265
entry->createFunctionArgument(*std::next(paramTypeIter));
12691266

1270-
scope.emplace(sgm.TopLevelSGF->Cleanups,
1271-
CleanupLocation::getModuleCleanupLocation());
1267+
scope.emplace(sgm.TopLevelSGF->Cleanups, moduleCleanupLoc);
12721268
}
12731269
}
12741270

0 commit comments

Comments
 (0)