Skip to content

Commit 7d73aab

Browse files
committed
Remove the now-unused NonErrorHandlingBlocks
1 parent 447ae96 commit 7d73aab

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

include/swift/SILOptimizer/Utils/BasicBlockOptUtils.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,6 @@ class ReachingReturnBlocks {
6969
}
7070
};
7171

72-
/// Computes the set of blocks which are not used for error handling, i.e. not
73-
/// (exclusively) reachable from the error-block of a try_apply.
74-
class NonErrorHandlingBlocks {
75-
BasicBlockWorklist worklist;
76-
77-
public:
78-
NonErrorHandlingBlocks(SILFunction *function);
79-
80-
/// Returns true if there exists a path from \p block to the return-block.
81-
bool isNonErrorHandling(SILBasicBlock *block) const {
82-
return worklist.isVisited(block);
83-
}
84-
};
85-
8672
/// Remove all unreachable blocks in a function.
8773
bool removeUnreachableBlocks(SILFunction &f);
8874

lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ bool PerformanceDiagnostics::visitFunctionEmbeddedSwift(
213213
return false;
214214
visitedFuncs[function] = PerformanceConstraints::None;
215215

216-
NonErrorHandlingBlocks neBlocks(function);
217-
218216
for (SILBasicBlock &block : *function) {
219217
for (SILInstruction &inst : block) {
220218
if (visitInst(&inst, PerformanceConstraints::None, parentLoc)) {
@@ -283,8 +281,6 @@ bool PerformanceDiagnostics::visitFunction(SILFunction *function,
283281
if (!function->isDefinition())
284282
return false;
285283

286-
NonErrorHandlingBlocks neBlocks(function);
287-
288284
for (SILBasicBlock &block : *function) {
289285
// Exclude fatal-error blocks.
290286
if (isa<UnreachableInst>(block.getTerminator()))

lib/SILOptimizer/Utils/BasicBlockOptUtils.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,6 @@ ReachingReturnBlocks::ReachingReturnBlocks(SILFunction *function)
5555
}
5656
}
5757

58-
NonErrorHandlingBlocks::NonErrorHandlingBlocks(SILFunction *function)
59-
: worklist(function->getEntryBlock()) {
60-
while (SILBasicBlock *block = worklist.pop()) {
61-
if (auto ta = dyn_cast<TryApplyInst>(block->getTerminator())) {
62-
worklist.pushIfNotVisited(ta->getNormalBB());
63-
} else {
64-
for (SILBasicBlock *succ : block->getSuccessorBlocks()) {
65-
worklist.pushIfNotVisited(succ);
66-
}
67-
}
68-
}
69-
}
70-
7158
bool swift::removeUnreachableBlocks(SILFunction &f) {
7259
ReachableBlocks reachable(&f);
7360
// Visit all the blocks without doing any extra work.

0 commit comments

Comments
 (0)