mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: New ASTContext::addSynthesizedDecl() method
This adds the declaration to the external declarations list only if it was part of an imported declaration, eliminating some boilerplate.
This commit is contained in:
@@ -183,11 +183,7 @@ static ValueDecl *deriveInitDecl(TypeChecker &tc, Decl *parentDecl,
|
||||
initDecl->setAccess(enumDecl->getFormalAccess());
|
||||
initDecl->setValidationStarted();
|
||||
|
||||
// If the enum was not imported, the derived conformance is either from the
|
||||
// enum itself or an extension, in which case we will emit the declaration
|
||||
// normally.
|
||||
if (enumDecl->hasClangNode())
|
||||
tc.Context.addExternalDecl(initDecl);
|
||||
tc.Context.addSynthesizedDecl(initDecl);
|
||||
|
||||
cast<IterableDeclContext>(parentDecl)->addMember(initDecl);
|
||||
return initDecl;
|
||||
|
||||
Reference in New Issue
Block a user