SILGenFunction::mergeCleanupBlocks.

Avoid emitting unnecessary basic block for cleanup chains. This is a
general approach that handles all cases while simplifying SILGen
emission and keeping the CFG in a valid state during SILGen.
This commit is contained in:
Andrew Trick
2018-10-13 21:02:46 -07:00
parent c8e4d2b014
commit 2ccc089b27
6 changed files with 103 additions and 12 deletions

View File

@@ -20,6 +20,11 @@ namespace swift {
class SILFunction;
class SILBasicBlock;
/// \brief Merge a basic block ending in a branch with its successor
/// if possible.
void mergeBasicBlockWithSingleSuccessor(SILBasicBlock *BB,
SILBasicBlock *succBB);
/// A utility for finding dead-end blocks.
///
/// Dead-end blocks are blocks from which there is no path to the function exit