[Sema] Requestify memberwise init synthesis

This commit adds two requests, one to compute
whether or not a decl should have a memberwise
initializer, and another to synthesize it.
This commit is contained in:
Hamish Knight
2019-10-22 15:26:39 -07:00
parent d8477d51f2
commit ffd5a9cfd6
7 changed files with 112 additions and 24 deletions

View File

@@ -3464,6 +3464,13 @@ public:
});
}
/// Whether this declaration has a synthesized memberwise initializer.
bool hasMemberwiseInitializer() const;
/// Retrieves the synthesized memberwise initializer for this declaration,
/// or \c nullptr if it does not have one.
ConstructorDecl *getMemberwiseInitializer() const;
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) {
return D->getKind() >= DeclKind::First_NominalTypeDecl &&