File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,40 @@ SwiftMangledName SwiftMangler::visitAnyFunctionType(const swift::AnyFunctionType
225225 ret << " ..." ;
226226 }
227227 }
228+
229+ if (type->hasLifetimeDependencies ()) {
230+ for (const auto & lifetime : type->getLifetimeDependencies ()) {
231+ auto addressable = lifetime.getAddressableIndices ();
232+ auto condAddressable = lifetime.getConditionallyAddressableIndices ();
233+ ret << " _lifetime" ;
234+
235+ auto addIndexes = [&](swift::IndexSubset* bitvector) {
236+ for (unsigned i = 0 ; i < bitvector->getCapacity (); ++i) {
237+ if (bitvector->contains (i)) {
238+ if (addressable && addressable->contains (i)) {
239+ ret << " _address" ;
240+ } else if (condAddressable && condAddressable->contains (i)) {
241+ ret << " _address_for_deps" ;
242+ }
243+ ret << " _" << i;
244+ }
245+ }
246+ };
247+
248+ if (lifetime.hasInheritLifetimeParamIndices ()) {
249+ ret << " _copy" ;
250+ addIndexes (lifetime.getInheritIndices ());
251+ }
252+ if (lifetime.hasScopeLifetimeParamIndices ()) {
253+ ret << " _borrow" ;
254+ addIndexes (lifetime.getScopeIndices ());
255+ }
256+ if (lifetime.isImmortal ()) {
257+ ret << " _immortal" ;
258+ }
259+ }
260+ }
261+
228262 ret << " ->" << fetch (type->getResult ());
229263 if (type->isAsync ()) {
230264 ret << " _async" ;
You can’t perform that action at this time.
0 commit comments