@@ -38,8 +38,9 @@ class SILResultInfo;
3838
3939enum class ParsedLifetimeDependenceKind : uint8_t {
4040 Default = 0 ,
41- Scope,
42- Inherit // Only used with deserialized decls
41+ Borrow,
42+ Inherit, // Only used with deserialized decls
43+ Inout
4344};
4445
4546enum class LifetimeDependenceKind : uint8_t { Inherit = 0 , Scope };
@@ -182,6 +183,7 @@ class LifetimeEntry final
182183 ArrayRef<LifetimeDescriptor> sources,
183184 std::optional<LifetimeDescriptor> targetDescriptor = std::nullopt );
184185
186+ std::string getString () const ;
185187 SourceLoc getLoc () const { return startLoc; }
186188 SourceLoc getStartLoc () const { return startLoc; }
187189 SourceLoc getEndLoc () const { return endLoc; }
@@ -193,35 +195,6 @@ class LifetimeEntry final
193195 std::optional<LifetimeDescriptor> getTargetDescriptor () const {
194196 return targetDescriptor;
195197 }
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- }
225198};
226199
227200class LifetimeDependenceInfo {
@@ -361,6 +334,9 @@ filterEscapableLifetimeDependencies(GenericSignature sig,
361334 SmallVectorImpl<LifetimeDependenceInfo> &outputs,
362335 llvm::function_ref<Type (unsigned targetIndex)> getSubstTargetType);
363336
337+ StringRef
338+ getNameForParsedLifetimeDependenceKind (ParsedLifetimeDependenceKind kind);
339+
364340} // namespace swift
365341
366342#endif
0 commit comments