@@ -2039,10 +2039,8 @@ namespace {
2039
2039
if (Impl.SwiftContext .LangOpts .hasFeature (Feature::LifetimeDependence)) {
2040
2040
fd->getAttrs ().add (new (Impl.SwiftContext )
2041
2041
UnsafeNonEscapableResultAttr (/* Implicit=*/ true ));
2042
- if (Impl.SwiftContext .LangOpts .hasFeature (
2043
- Feature::StrictMemorySafety))
2044
- fd->getAttrs ().add (new (Impl.SwiftContext )
2045
- UnsafeAttr (/* Implicit=*/ true ));
2042
+ fd->getAttrs ().add (new (Impl.SwiftContext )
2043
+ UnsafeAttr (/* Implicit=*/ true ));
2046
2044
}
2047
2045
}
2048
2046
@@ -4179,19 +4177,19 @@ namespace {
4179
4177
LifetimeDependenceInfoRequest{result},
4180
4178
Impl.SwiftContext .AllocateCopy (lifetimeDependencies));
4181
4179
}
4182
- if (ASTContext.LangOpts .hasFeature (Feature::StrictMemorySafety)) {
4183
- for (auto [idx, param] : llvm::enumerate (decl->parameters ())) {
4184
- if (swiftParams->get (idx)->getInterfaceType ()->isEscapable ())
4185
- continue ;
4186
- if (param->hasAttr <clang::NoEscapeAttr>() || paramHasAnnotation[idx])
4187
- continue ;
4188
- // We have a nonescapable parameter that does not have its lifetime
4189
- // annotated nor is it marked noescape.
4190
- auto attr = new (ASTContext) UnsafeAttr (/* implicit=*/ true );
4191
- result->getAttrs ().add (attr);
4192
- break ;
4193
- }
4180
+
4181
+ for (auto [idx, param] : llvm::enumerate (decl->parameters ())) {
4182
+ if (swiftParams->get (idx)->getInterfaceType ()->isEscapable ())
4183
+ continue ;
4184
+ if (param->hasAttr <clang::NoEscapeAttr>() || paramHasAnnotation[idx])
4185
+ continue ;
4186
+ // We have a nonescapable parameter that does not have its lifetime
4187
+ // annotated nor is it marked noescape.
4188
+ auto attr = new (ASTContext) UnsafeAttr (/* implicit=*/ true );
4189
+ result->getAttrs ().add (attr);
4190
+ break ;
4194
4191
}
4192
+
4195
4193
Impl.diagnoseTargetDirectly (decl);
4196
4194
}
4197
4195
0 commit comments