Skip to content

Commit 10e7611

Browse files
authored
Merge pull request #22107 from gottesmm/pr-bebfdb036c1c8906044e4a712fd37987f04c6c51
2 parents bad30a5 + 6f767f8 commit 10e7611

File tree

2 files changed

+0
-58
lines changed

2 files changed

+0
-58
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -67,35 +67,6 @@ struct ErrorBehaviorKind {
6767

6868
} // end namespace ownership
6969

70-
/// This class is a higher level interface to the ownership checker meant for
71-
/// use with SILPasses. It uses the actual checker as an internal PImpl detail
72-
/// so types/etc do not leak.
73-
struct OwnershipChecker {
74-
/// The list of regular users from the last run of the checker.
75-
SmallVector<SILInstruction *, 16> regularUsers;
76-
77-
/// The list of regular users from the last run of the checker.
78-
SmallVector<SILInstruction *, 16> lifetimeEndingUsers;
79-
80-
/// The live blocks for the SILValue we processed. This can be used to
81-
/// determine if a block is in the "live" region of our SILInstruction.
82-
SmallPtrSet<SILBasicBlock *, 32> liveBlocks;
83-
84-
/// The list of implicit regular users from the last run of the checker.
85-
///
86-
/// This is used to encode end of scope like instructions.
87-
SmallVector<SILInstruction *, 4> endScopeRegularUsers;
88-
89-
/// The module that we are in.
90-
SILModule &mod;
91-
92-
/// A cache of dead-end basic blocks that we use to determine if we can
93-
/// ignore "leaks".
94-
DeadEndBlocks &deadEndBlocks;
95-
96-
bool checkValue(SILValue Value);
97-
};
98-
9970
/// Returns true if:
10071
///
10172
/// 1. No consuming uses are reachable from any other consuming use, from any

lib/SIL/SILOwnershipVerifier.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -724,32 +724,3 @@ void SILValue::verifyOwnership(SILModule &mod,
724724
}
725725
#endif
726726
}
727-
728-
bool OwnershipChecker::checkValue(SILValue value) {
729-
regularUsers.clear();
730-
lifetimeEndingUsers.clear();
731-
liveBlocks.clear();
732-
733-
// Since we do not have SILUndef, we now know that getFunction() should return
734-
// a real function. Assert in case this assumption is no longer true.
735-
SILFunction *f = value->getFunction();
736-
assert(f && "Instructions and arguments should have a function");
737-
738-
// If the given function has unqualified ownership, there is nothing further
739-
// to verify.
740-
if (!f->hasOwnership())
741-
return false;
742-
743-
ErrorBehaviorKind errorBehavior(ErrorBehaviorKind::ReturnFalse);
744-
SILValueOwnershipChecker checker(mod, deadEndBlocks, value, errorBehavior,
745-
liveBlocks);
746-
if (!checker.check()) {
747-
return false;
748-
}
749-
750-
// TODO: Make this more efficient.
751-
copy(checker.getRegularUsers(), std::back_inserter(regularUsers));
752-
copy(checker.getLifetimeEndingUsers(),
753-
std::back_inserter(lifetimeEndingUsers));
754-
return true;
755-
}

0 commit comments

Comments
 (0)