@@ -123,28 +123,7 @@ class SILValueOwnershipChecker {
123
123
SILValueOwnershipChecker (SILValueOwnershipChecker &) = delete;
124
124
SILValueOwnershipChecker (SILValueOwnershipChecker &&) = delete;
125
125
126
- bool check () {
127
- if (result.hasValue ())
128
- return result.getValue ();
129
-
130
- LLVM_DEBUG (llvm::dbgs () << " Verifying ownership of: " << *value);
131
- result = checkUses ();
132
- if (!result.getValue ())
133
- return false ;
134
-
135
- SmallVector<BranchPropagatedUser, 32 > allLifetimeEndingUsers;
136
- llvm::copy (lifetimeEndingUsers, std::back_inserter (allLifetimeEndingUsers));
137
- SmallVector<BranchPropagatedUser, 32 > allRegularUsers;
138
- llvm::copy (regularUsers, std::back_inserter (allRegularUsers));
139
- llvm::copy (implicitRegularUsers, std::back_inserter (allRegularUsers));
140
-
141
- LinearLifetimeChecker checker (visitedBlocks, deadEndBlocks);
142
- auto linearLifetimeResult = checker.checkValue (
143
- value, allLifetimeEndingUsers, allRegularUsers, errorBehavior);
144
- result = !linearLifetimeResult.getFoundError ();
145
-
146
- return result.getValue ();
147
- }
126
+ bool check ();
148
127
149
128
private:
150
129
bool checkUses ();
@@ -182,6 +161,29 @@ class SILValueOwnershipChecker {
182
161
183
162
} // end anonymous namespace
184
163
164
+ bool SILValueOwnershipChecker::check () {
165
+ if (result.hasValue ())
166
+ return result.getValue ();
167
+
168
+ LLVM_DEBUG (llvm::dbgs () << " Verifying ownership of: " << *value);
169
+ result = checkUses ();
170
+ if (!result.getValue ())
171
+ return false ;
172
+
173
+ SmallVector<BranchPropagatedUser, 32 > allLifetimeEndingUsers;
174
+ llvm::copy (lifetimeEndingUsers, std::back_inserter (allLifetimeEndingUsers));
175
+ SmallVector<BranchPropagatedUser, 32 > allRegularUsers;
176
+ llvm::copy (regularUsers, std::back_inserter (allRegularUsers));
177
+ llvm::copy (implicitRegularUsers, std::back_inserter (allRegularUsers));
178
+
179
+ LinearLifetimeChecker checker (visitedBlocks, deadEndBlocks);
180
+ auto linearLifetimeResult = checker.checkValue (
181
+ value, allLifetimeEndingUsers, allRegularUsers, errorBehavior);
182
+ result = !linearLifetimeResult.getFoundError ();
183
+
184
+ return result.getValue ();
185
+ }
186
+
185
187
bool SILValueOwnershipChecker::gatherUsers (
186
188
SmallVectorImpl<Operand *> &lifetimeEndingUsers,
187
189
SmallVectorImpl<Operand *> &nonLifetimeEndingUsers,
0 commit comments