@@ -38,8 +38,9 @@ class SILResultInfo;
38
38
39
39
enum class ParsedLifetimeDependenceKind : uint8_t {
40
40
Default = 0 ,
41
- Scope,
42
- Inherit // Only used with deserialized decls
41
+ Borrow,
42
+ Inherit, // Only used with deserialized decls
43
+ Inout
43
44
};
44
45
45
46
enum class LifetimeDependenceKind : uint8_t { Inherit = 0 , Scope };
@@ -182,6 +183,7 @@ class LifetimeEntry final
182
183
ArrayRef<LifetimeDescriptor> sources,
183
184
std::optional<LifetimeDescriptor> targetDescriptor = std::nullopt);
184
185
186
+ std::string getString () const ;
185
187
SourceLoc getLoc () const { return startLoc; }
186
188
SourceLoc getStartLoc () const { return startLoc; }
187
189
SourceLoc getEndLoc () const { return endLoc; }
@@ -193,35 +195,6 @@ class LifetimeEntry final
193
195
std::optional<LifetimeDescriptor> getTargetDescriptor () const {
194
196
return targetDescriptor;
195
197
}
196
-
197
- std::string getString () const {
198
- std::string result = " @lifetime(" ;
199
- if (targetDescriptor.has_value ()) {
200
- result += targetDescriptor->getString ();
201
- result += " : " ;
202
- }
203
-
204
- bool firstElem = true ;
205
- for (auto source : getSources ()) {
206
- if (!firstElem) {
207
- result += " , " ;
208
- }
209
- switch (source.getParsedLifetimeDependenceKind ()) {
210
- case ParsedLifetimeDependenceKind::Scope:
211
- result += " borrow " ;
212
- break ;
213
- case ParsedLifetimeDependenceKind::Inherit:
214
- result += " copy " ;
215
- break ;
216
- default :
217
- break ;
218
- }
219
- result += source.getString ();
220
- firstElem = false ;
221
- }
222
- result += " )" ;
223
- return result;
224
- }
225
198
};
226
199
227
200
class LifetimeDependenceInfo {
@@ -361,6 +334,9 @@ filterEscapableLifetimeDependencies(GenericSignature sig,
361
334
SmallVectorImpl<LifetimeDependenceInfo> &outputs,
362
335
llvm::function_ref<Type (unsigned targetIndex)> getSubstTargetType);
363
336
337
+ StringRef
338
+ getNameForParsedLifetimeDependenceKind (ParsedLifetimeDependenceKind kind);
339
+
364
340
} // namespace swift
365
341
366
342
#endif
0 commit comments