File tree Expand file tree Collapse file tree 2 files changed +17
-14
lines changed
SILOptimizer/UtilityPasses Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change 52
52
#include " swift/SIL/OSSALifetimeCompletion.h"
53
53
#include " swift/SIL/SILBuilder.h"
54
54
#include " swift/SIL/SILInstruction.h"
55
+ #include " swift/SIL/Test.h"
55
56
56
57
using namespace swift ;
57
58
@@ -166,6 +167,22 @@ bool OSSALifetimeCompletion::analyzeAndUpdateLifetime(
166
167
return changed;
167
168
}
168
169
170
+ namespace swift ::test {
171
+ // Arguments:
172
+ // - SILValue: value
173
+ // Dumps:
174
+ // - function
175
+ static FunctionTest OSSALifetimeCompletionTest (
176
+ " ossa-lifetime-completion" ,
177
+ [](auto &function, auto &arguments, auto &test) {
178
+ SILValue value = arguments.takeValue ();
179
+ llvm::dbgs () << " OSSA lifetime completion: " << value;
180
+ OSSALifetimeCompletion completion (&function, /* domInfo*/ nullptr );
181
+ completion.completeOSSALifetime (value);
182
+ function.dump ();
183
+ });
184
+ } // end namespace swift::test
185
+
169
186
// TODO: create a fast check for 'mayEndLifetime(SILInstruction *)'. Verify that
170
187
// it returns true for every instruction that has a lifetime-ending operand.
171
188
void UnreachableLifetimeCompletion::visitUnreachableInst (
Original file line number Diff line number Diff line change @@ -311,20 +311,6 @@ static FunctionTest FieldSensitiveMultiDefUseLiveRangeTest(
311
311
boundary.print (llvm::errs ());
312
312
});
313
313
314
- // Arguments:
315
- // - SILValue: value
316
- // Dumps:
317
- // - function
318
- static FunctionTest OSSALifetimeCompletionTest (
319
- " ossa-lifetime-completion" ,
320
- [](auto &function, auto &arguments, auto &test) {
321
- SILValue value = arguments.takeValue ();
322
- llvm::dbgs () << " OSSA lifetime completion: " << value;
323
- OSSALifetimeCompletion completion (&function, /* domInfo*/ nullptr );
324
- completion.completeOSSALifetime (value);
325
- function.dump ();
326
- });
327
-
328
314
// ===----------------------------------------------------------------------===//
329
315
// MARK: SimplifyCFG Unit Tests
330
316
// ===----------------------------------------------------------------------===//
You can’t perform that action at this time.
0 commit comments