Skip to content

Commit 07eec26

Browse files
committed
Move the isImplicitDynamicEnabled into addImplicitDynamicAttribute
1 parent 24b8766 commit 07eec26

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,6 +2451,9 @@ TypeChecker::diagnosticIfDeclCannotBePotentiallyUnavailable(const Decl *D) {
24512451
}
24522452

24532453
void TypeChecker::addImplicitDynamicAttribute(Decl *D) {
2454+
if (!decl->getModuleContext()->isImplicitDynamicEnabled())
2455+
return;
2456+
24542457
// Add the attribute if the decl kind allows it and it is not an accessor
24552458
// decl. Accessor decls should always infer the var/subscript's attribute.
24562459
if (!DeclAttribute::canAttributeAppearOnDecl(DAK_Dynamic, D) ||

lib/Sema/TypeCheckDecl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,9 +1215,7 @@ IsDynamicRequest::evaluate(Evaluator &evaluator, ValueDecl *decl) const {
12151215
return false;
12161216

12171217
// Add dynamic if -enable-implicit-dynamic was requested.
1218-
if (decl->getModuleContext()->isImplicitDynamicEnabled()) {
1219-
TypeChecker::addImplicitDynamicAttribute(decl);
1220-
}
1218+
TypeChecker::addImplicitDynamicAttribute(decl);
12211219

12221220
// If 'dynamic' was explicitly specified, check it.
12231221
if (decl->getAttrs().hasAttribute<DynamicAttr>()) {

0 commit comments

Comments
 (0)