File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,6 @@ inline bool isForwardingConsume(SILValue value) {
90
90
// Ownership Def-Use Utilities
91
91
// ===----------------------------------------------------------------------===//
92
92
93
- bool findPointerEscape (BorrowedValue value);
94
-
95
93
// / Whether the specified OSSA-lifetime introducer has a pointer escape.
96
94
// /
97
95
// / precondition: \p value introduces an OSSA-lifetime, either a BorrowedValue
Original file line number Diff line number Diff line change @@ -850,24 +850,10 @@ void BorrowedValue::print(llvm::raw_ostream &os) const {
850
850
851
851
void BorrowedValue::getLocalScopeEndingInstructions (
852
852
SmallVectorImpl<SILInstruction *> &scopeEndingInsts) const {
853
- assert (isLocalScope () && " Should only call this given a local scope" );
854
-
855
- switch (kind) {
856
- case BorrowedValueKind::Invalid:
857
- llvm_unreachable (" Using invalid case?!" );
858
- case BorrowedValueKind::SILFunctionArgument:
859
- llvm_unreachable (" Should only call this with a local scope" );
860
- case BorrowedValueKind::BeginBorrow:
861
- case BorrowedValueKind::LoadBorrow:
862
- case BorrowedValueKind::Phi:
863
- for (auto *use : value->getUses ()) {
864
- if (use->isLifetimeEnding ()) {
865
- scopeEndingInsts.push_back (use->getUser ());
866
- }
867
- }
868
- return ;
869
- }
870
- llvm_unreachable (" Covered switch isn't covered?!" );
853
+ visitLocalScopeEndingUses ([&](auto *use) {
854
+ scopeEndingInsts.push_back (use->getUser ());
855
+ return true ;
856
+ });
871
857
}
872
858
873
859
// Note: BorrowedLifetimeExtender assumes no intermediate values between a
You can’t perform that action at this time.
0 commit comments