Skip to content

Commit a998d98

Browse files
committed
[gardening] SILBasicBlock::splitBasicBlock() => *::split().
The BasicBlock suffix is redundant.
1 parent e936de7 commit a998d98

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

include/swift/SIL/SILBasicBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
132132
/// Note that all the instructions BEFORE the specified iterator
133133
/// stay as part of the original basic block. The old basic block is left
134134
/// without a terminator.
135-
SILBasicBlock *splitBasicBlock(iterator I);
135+
SILBasicBlock *split(iterator I);
136136

137137
/// \brief Move the basic block to after the specified basic block in the IR.
138138
/// The basic blocks must reside in the same function.

lib/SIL/SILBasicBlock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void SILBasicBlock::eraseArgument(int Index) {
146146
/// Note that all the instructions BEFORE the specified iterator
147147
/// stay as part of the original basic block. The old basic block is left
148148
/// without a terminator.
149-
SILBasicBlock *SILBasicBlock::splitBasicBlock(iterator I) {
149+
SILBasicBlock *SILBasicBlock::split(iterator I) {
150150
SILBasicBlock *New = new (Parent->getModule()) SILBasicBlock(Parent);
151151
SILFunction::iterator Where = std::next(SILFunction::iterator(this));
152152
SILFunction::iterator First = SILFunction::iterator(New);

lib/SIL/SILBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ SILBasicBlock *SILBuilder::splitBlockForFallthrough() {
142142
}
143143

144144
// Otherwise we need to split the current block at the insertion point.
145-
auto *NewBB = BB->splitBasicBlock(InsertPt);
145+
auto *NewBB = BB->split(InsertPt);
146146
InsertPt = BB->end();
147147
return NewBB;
148148
}

lib/SILOptimizer/IPO/EagerSpecializer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ static void addReturnValueImpl(SILBasicBlock *RetBB, SILBasicBlock *NewRetBB,
106106
TupleI = TupleI->clone(RetInst);
107107
RetInst->setOperand(0, TupleI);
108108
}
109-
MergedBB = RetBB->splitBasicBlock(TupleI->getIterator());
109+
MergedBB = RetBB->split(TupleI->getIterator());
110110
Builder.setInsertionPoint(RetBB);
111111
Builder.createBranch(Loc, MergedBB);
112112
} else {
113113
// Forward the existing return argument to a new BBArg.
114-
MergedBB = RetBB->splitBasicBlock(RetInst->getIterator());
114+
MergedBB = RetBB->split(RetInst->getIterator());
115115
SILValue OldRetVal = RetInst->getOperand(0);
116116
RetInst->setOperand(0, MergedBB->createArgument(OldRetVal->getType()));
117117
Builder.setInsertionPoint(RetBB);
@@ -255,7 +255,7 @@ void EagerDispatch::emitDispatchTo(SILFunction *NewFunc) {
255255

256256
// First split the entry BB, moving all instructions to the FailedTypeCheckBB.
257257
auto &EntryBB = GenericFunc->front();
258-
SILBasicBlock *FailedTypeCheckBB = EntryBB.splitBasicBlock(EntryBB.begin());
258+
SILBasicBlock *FailedTypeCheckBB = EntryBB.split(EntryBB.begin());
259259
Builder.setInsertionPoint(&EntryBB, EntryBB.begin());
260260

261261
// Iterate over all dependent types in the generic signature, which will match

lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ static void InsertCFGDiamond(SILValue Cond, SILLocation Loc, SILBuilder &B,
127127
SILBasicBlock *StartBB = B.getInsertionBB();
128128

129129
// Start by splitting the current block.
130-
ContBB = StartBB->splitBasicBlock(B.getInsertionPoint());
131-
130+
ContBB = StartBB->split(B.getInsertionPoint());
131+
132132
// Create the true block if requested.
133133
SILBasicBlock *TrueDest;
134134
if (!createTrueBB) {

lib/SILOptimizer/Transforms/SpeculativeDevirtualizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static FullApplySite speculateMonomorphicTarget(FullApplySite AI,
109109
SILBasicBlock *Virt = F->createBasicBlock();
110110
Iden->createArgument(SubType);
111111

112-
SILBasicBlock *Continue = Entry->splitBasicBlock(It);
112+
SILBasicBlock *Continue = Entry->split(It);
113113

114114
SILBuilderWithScope Builder(Entry, AI.getInstruction());
115115
// Create the checked_cast_branch instruction that checks at runtime if the

lib/SILOptimizer/Utils/CFG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ SILBasicBlock *swift::splitBasicBlockAndBranch(SILBuilder &B,
548548
DominanceInfo *DT,
549549
SILLoopInfo *LI) {
550550
auto *OrigBB = SplitBeforeInst->getParent();
551-
auto *NewBB = OrigBB->splitBasicBlock(SplitBeforeInst->getIterator());
551+
auto *NewBB = OrigBB->split(SplitBeforeInst->getIterator());
552552
B.setInsertionPoint(OrigBB);
553553
B.createBranch(SplitBeforeInst->getLoc(), NewBB);
554554

lib/SILOptimizer/Utils/Local.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ Optional<SILValue> swift::castValueToABICompatibleType(SILBuilder *B, SILLocatio
580580
auto *SomeBB = B->getFunction().createBasicBlock();
581581
auto *CurBB = B->getInsertionPoint()->getParent();
582582

583-
auto *ContBB = CurBB->splitBasicBlock(B->getInsertionPoint());
583+
auto *ContBB = CurBB->split(B->getInsertionPoint());
584584
ContBB->createArgument(DestTy, nullptr);
585585

586586
SmallVector<std::pair<EnumElementDecl *, SILBasicBlock *>, 1> CaseBBs;

lib/SILOptimizer/Utils/SILInliner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ bool SILInliner::inlineFunction(FullApplySite AI, ArrayRef<SILValue> Args) {
127127
SILBasicBlock *CallerBB = AI.getParent();
128128
// Split the BB and do NOT create a branch between the old and new
129129
// BBs; we will create the appropriate terminator manually later.
130-
ReturnToBB = CallerBB->splitBasicBlock(InsertPoint);
130+
ReturnToBB = CallerBB->split(InsertPoint);
131131
// Place the return-to BB after all the other mapped BBs.
132132
if (InsertBeforeBB)
133133
F.getBlocks().splice(SILFunction::iterator(InsertBeforeBB), F.getBlocks(),

tools/sil-extract/SILExtract.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ removeUnwantedFunctions(SILModule *M, llvm::StringRef Name) {
116116
SILBasicBlock &BB = F.front();
117117

118118
SILLocation Loc = BB.back().getLoc();
119-
BB.splitBasicBlock(BB.begin());
119+
BB.split(BB.begin());
120120
// Make terminator unreachable.
121121
SILBuilder(&BB).createUnreachable(Loc);
122122

0 commit comments

Comments
 (0)