mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Factor out InitializablePropertiesRequest
This serves as the backing request for both InitAccessorPropertiesRequest and MemberwiseInitPropertiesRequest, ensuring the former does not care about the init accessor is included in the memberwise initializer.
This commit is contained in:
@@ -1949,6 +1949,25 @@ public:
|
||||
bool isCached() const { return true; }
|
||||
};
|
||||
|
||||
/// Request to obtain a list of properties that can be initalized.
|
||||
class InitializablePropertiesRequest
|
||||
: public SimpleRequest<InitializablePropertiesRequest,
|
||||
ArrayRef<VarDecl *>(NominalTypeDecl *),
|
||||
RequestFlags::Cached> {
|
||||
public:
|
||||
using SimpleRequest::SimpleRequest;
|
||||
|
||||
private:
|
||||
friend SimpleRequest;
|
||||
|
||||
// Evaluation.
|
||||
ArrayRef<VarDecl *> evaluate(Evaluator &evaluator,
|
||||
NominalTypeDecl *decl) const;
|
||||
|
||||
public:
|
||||
bool isCached() const { return true; }
|
||||
};
|
||||
|
||||
/// Request to obtain a list of computed properties with init accesors
|
||||
/// in the given nominal type.
|
||||
class InitAccessorPropertiesRequest :
|
||||
|
||||
@@ -336,6 +336,8 @@ SWIFT_REQUEST(TypeChecker, StoredPropertiesAndMissingMembersRequest,
|
||||
ArrayRef<Decl *>(NominalTypeDecl *), Cached, NoLocationInfo)
|
||||
SWIFT_REQUEST(TypeChecker, StoredPropertiesRequest,
|
||||
ArrayRef<VarDecl *>(NominalTypeDecl *), Cached, NoLocationInfo)
|
||||
SWIFT_REQUEST(TypeChecker, InitializablePropertiesRequest,
|
||||
ArrayRef<VarDecl *>(NominalTypeDecl *), Cached, NoLocationInfo)
|
||||
SWIFT_REQUEST(TypeChecker, InitAccessorPropertiesRequest,
|
||||
ArrayRef<VarDecl *>(NominalTypeDecl *),
|
||||
Cached, NoLocationInfo)
|
||||
|
||||
Reference in New Issue
Block a user