File tree Expand file tree Collapse file tree 3 files changed +4
-21
lines changed Expand file tree Collapse file tree 3 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,6 @@ class ASTScopeImpl : public ASTAllocated<ASTScopeImpl> {
237
237
NullablePtr<Decl> getDeclIfAny () const ;
238
238
NullablePtr<Stmt> getStmtIfAny () const ;
239
239
NullablePtr<Expr> getExprIfAny () const ;
240
- NullablePtr<DeclAttribute> getDeclAttributeIfAny () const ;
241
240
242
241
#pragma mark - debugging and printing
243
242
Original file line number Diff line number Diff line change @@ -170,22 +170,6 @@ NullablePtr<Expr> ASTScopeImpl::getExprIfAny() const {
170
170
}
171
171
}
172
172
173
- NullablePtr<DeclAttribute> ASTScopeImpl::getDeclAttributeIfAny () const {
174
- switch (getKind ()) {
175
- // Statement scope nodes extract the statement directly.
176
- #define DECL_ATTRIBUTE_SCOPE_NODE (Name ) \
177
- case ScopeKind::Name: return cast<Name##Scope>(this )->getDeclAttr ();
178
- #define SCOPE_NODE (Name )
179
- #include " swift/AST/ASTScopeNodes.def"
180
-
181
- // Everything else returns nullptr.
182
- #define DECL_ATTRIBUTE_SCOPE_NODE (Name )
183
- #define SCOPE_NODE (Name ) case ScopeKind::Name:
184
- #include " swift/AST/ASTScopeNodes.def"
185
- return nullptr ;
186
- }
187
- }
188
-
189
173
SourceManager &ASTScopeImpl::getSourceManager () const {
190
174
return getASTContext ().SourceMgr ;
191
175
}
Original file line number Diff line number Diff line change @@ -649,10 +649,10 @@ void ASTScopeImpl::lookupEnclosingMacroScope(
649
649
return ;
650
650
}
651
651
652
- auto *attr = scope-> getDeclAttributeIfAny (). getPtrOrNull ();
653
- auto *potentialAttached = dyn_cast_or_null<CustomAttr>( attr);
654
- if (potentialAttached && consume (potentialAttached))
655
- return ;
652
+ if ( auto customAttrScope = dyn_cast<CustomAttributeScope>(scope)) {
653
+ if ( consume (customAttrScope-> attr ))
654
+ return ;
655
+ }
656
656
657
657
// If we've reached a source file scope, we can't be inside of
658
658
// a macro argument. Either this is a top-level source file, or
You can’t perform that action at this time.
0 commit comments