Allow SILBasicBlocks to be constructed after a specific

block, and do so when splitting a block.

Swift SVN r19076
This commit is contained in:
John McCall
2014-06-22 05:01:06 +00:00
parent 7b4700dc5d
commit cd6fc21900
3 changed files with 11 additions and 6 deletions

View File

@@ -105,8 +105,9 @@ void SILBuilder::emitBlock(SILBasicBlock *BB, SILLocation BranchLoc) {
/// continuation block.
SILBasicBlock *SILBuilder::splitBlockForFallthrough() {
// If we are concatenating, just create and return a new block.
if (insertingAtEndOfBlock())
return new (F.getModule()) SILBasicBlock(&F);
if (insertingAtEndOfBlock()) {
return new (F.getModule()) SILBasicBlock(&F, BB);
}
// Otherwise we need to split the current block at the insertion point.
auto *NewBB = BB->splitBasicBlock(InsertPt);