@@ -124,7 +124,7 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
124
124
}
125
125
126
126
const TermInst *getTerminator () const {
127
- return const_cast <SILBasicBlock*>(this )->getTerminator ();
127
+ return const_cast <SILBasicBlock *>(this )->getTerminator ();
128
128
}
129
129
130
130
// / \brief Splits a basic block into two at the specified instruction.
@@ -135,7 +135,9 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
135
135
SILBasicBlock *split (iterator I);
136
136
137
137
// / \brief Move the basic block to after the specified basic block in the IR.
138
- // / The basic blocks must reside in the same function.
138
+ // /
139
+ // / Assumes that the basic blocks must reside in the same function. In asserts
140
+ // / builds, an assert verifies that this is true.
139
141
void moveAfter (SILBasicBlock *After);
140
142
141
143
// ===--------------------------------------------------------------------===//
@@ -216,9 +218,7 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
216
218
}
217
219
218
220
const SILBasicBlock *getSingleSuccessor () const {
219
- if (succ_empty () || std::next (succ_begin ()) != succ_end ())
220
- return nullptr ;
221
- return *succ_begin ();
221
+ return const_cast <SILBasicBlock *>(this )->getSingleSuccessor ();
222
222
}
223
223
224
224
// / \brief Returns true if \p BB is a successor of this block.
@@ -273,7 +273,7 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
273
273
}
274
274
275
275
const SILBasicBlock *getSinglePredecessor () const {
276
- return const_cast <SILBasicBlock*>(this )->getSinglePredecessor ();
276
+ return const_cast <SILBasicBlock *>(this )->getSinglePredecessor ();
277
277
}
278
278
279
279
// / Pretty-print the SILBasicBlock.
@@ -319,8 +319,8 @@ namespace llvm {
319
319
// ===----------------------------------------------------------------------===//
320
320
321
321
template <>
322
- struct ilist_traits <::swift::SILBasicBlock> :
323
- public ilist_default_traits<::swift::SILBasicBlock> {
322
+ struct ilist_traits <::swift::SILBasicBlock>
323
+ : ilist_default_traits<::swift::SILBasicBlock> {
324
324
using SelfTy = ilist_traits<::swift::SILBasicBlock>;
325
325
using SILBasicBlock = ::swift::SILBasicBlock;
326
326
using SILFunction = ::swift::SILFunction;
@@ -333,19 +333,17 @@ public ilist_default_traits<::swift::SILBasicBlock> {
333
333
SILFunction *Parent;
334
334
335
335
public:
336
-
337
336
SILBasicBlock *createSentinel () const {
338
- return static_cast <SILBasicBlock*>(&Sentinel);
337
+ return static_cast <SILBasicBlock *>(&Sentinel);
339
338
}
340
339
void destroySentinel (SILBasicBlock *) const {}
341
340
342
341
SILBasicBlock *provideInitialHead () const { return createSentinel (); }
343
- SILBasicBlock *ensureHead (SILBasicBlock*) const { return createSentinel (); }
344
- static void noteHead (SILBasicBlock*, SILBasicBlock*) {}
342
+ SILBasicBlock *ensureHead (SILBasicBlock *) const { return createSentinel (); }
343
+ static void noteHead (SILBasicBlock *, SILBasicBlock *) {}
345
344
static void deleteNode (SILBasicBlock *BB) { BB->~SILBasicBlock (); }
346
345
347
- void addNodeToList (SILBasicBlock *BB) {
348
- }
346
+ void addNodeToList (SILBasicBlock *BB) {}
349
347
350
348
void transferNodesFromList (ilist_traits<SILBasicBlock> &SrcTraits,
351
349
ilist_iterator<SILBasicBlock> First,
0 commit comments