Skip to content

Commit 9417651

Browse files
committed
[Test] Ensourced find-borrow-introducers.
Moved the test next to the code it calls.
1 parent 8f0378c commit 9417651

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,23 @@ bool swift::visitBorrowIntroducers(SILValue value,
20882088
.visitBorrowIntroducers(value, visitor);
20892089
}
20902090

2091+
namespace swift::test {
2092+
// Arguments:
2093+
// - SILValue: value
2094+
// Dumps:
2095+
// - function
2096+
// - the borrow introducers
2097+
static FunctionTest FindBorrowIntroducers(
2098+
"find-borrow-introducers", [](auto &function, auto &arguments, auto &test) {
2099+
function.dump();
2100+
llvm::dbgs() << "Introducers:\n";
2101+
visitBorrowIntroducers(arguments.takeValue(), [](SILValue def) {
2102+
def->dump();
2103+
return true;
2104+
});
2105+
});
2106+
} // end namespace swift::test
2107+
20912108
/// Return true of the lifetime of \p innerPhiVal depends on \p outerPhiVal.
20922109
///
20932110
/// This handles SIL values with nested lifetimes that cross a control flow

lib/SILOptimizer/UtilityPasses/TestRunner.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -311,21 +311,6 @@ static FunctionTest FieldSensitiveMultiDefUseLiveRangeTest(
311311
boundary.print(llvm::errs());
312312
});
313313

314-
// Arguments:
315-
// - SILValue: value
316-
// Dumps:
317-
// - function
318-
// - the borrow introducers
319-
static FunctionTest FindBorrowIntroducers(
320-
"find-borrow-introducers", [](auto &function, auto &arguments, auto &test) {
321-
function.dump();
322-
llvm::dbgs() << "Introducers:\n";
323-
visitBorrowIntroducers(arguments.takeValue(), [](SILValue def) {
324-
def->dump();
325-
return true;
326-
});
327-
});
328-
329314
// Arguments:
330315
// - SILValue: value
331316
// Dumps:

0 commit comments

Comments
 (0)