Skip to content

Commit c90fb77

Browse files
committed
[Macros] Remove unnecessary 'setDeclContext' for expanded declarations.
1 parent 30145e9 commit c90fb77

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lib/Sema/TypeCheckMacros.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,6 @@ bool swift::expandMembers(CustomAttr *attr, MacroDecl *macro, Decl *decl) {
10641064
// Note that synthesized members are not considered implicit. They have
10651065
// proper source ranges that should be validated, and ASTScope does not
10661066
// expand implicit scopes to the parent scope tree.
1067-
member->setDeclContext(decl->getInnermostDeclContext());
10681067

10691068
if (auto *nominal = dyn_cast<NominalTypeDecl>(decl)) {
10701069
nominal->addMember(member);
@@ -1091,8 +1090,6 @@ bool swift::expandPeers(CustomAttr *attr, MacroDecl *macro, Decl *decl) {
10911090
auto *parent = decl->getDeclContext();
10921091
auto topLevelDecls = macroSourceFile->getTopLevelDecls();
10931092
for (auto peer : topLevelDecls) {
1094-
peer->setDeclContext(parent);
1095-
10961093
if (auto *nominal = dyn_cast<NominalTypeDecl>(parent)) {
10971094
nominal->addMember(peer);
10981095
} else if (auto *extension = dyn_cast<ExtensionDecl>(parent)) {

0 commit comments

Comments
 (0)