Skip to content

Commit 3753a96

Browse files
committed
Add CompareDeclSpecializationRequest
1 parent a5b8c64 commit 3753a96

File tree

7 files changed

+303
-291
lines changed

7 files changed

+303
-291
lines changed

include/swift/AST/TypeCheckRequests.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,26 @@ class SynthesizeDefaultInitRequest
16271627
bool isCached() const { return true; }
16281628
};
16291629

1630+
class CompareDeclSpecializationRequest
1631+
: public SimpleRequest<CompareDeclSpecializationRequest,
1632+
bool(DeclContext *, ValueDecl *, ValueDecl *, bool),
1633+
CacheKind::Cached> {
1634+
public:
1635+
using SimpleRequest::SimpleRequest;
1636+
1637+
private:
1638+
friend SimpleRequest;
1639+
1640+
// Evaluation.
1641+
llvm::Expected<bool> evaluate(Evaluator &evaluator, DeclContext *DC,
1642+
ValueDecl *VD1, ValueDecl *VD2,
1643+
bool dynamic) const;
1644+
1645+
public:
1646+
// Caching.
1647+
bool isCached() const { return true; }
1648+
};
1649+
16301650
// Allow AnyValue to compare two Type values, even though Type doesn't
16311651
// support ==.
16321652
template<>

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ SWIFT_REQUEST(TypeChecker, AttachedPropertyWrappersRequest,
2929
NoLocationInfo)
3030
SWIFT_REQUEST(TypeChecker, ClassAncestryFlagsRequest,
3131
AncestryFlags(ClassDecl *), Cached, NoLocationInfo)
32+
SWIFT_REQUEST(TypeChecker, CompareDeclSpecializationRequest,
33+
bool (DeclContext *, ValueDecl *, ValueDecl *, bool), Cached,
34+
NoLocationInfo)
3235
SWIFT_REQUEST(TypeChecker, DefaultDefinitionTypeRequest,
3336
Type(AssociatedTypeDecl *), Cached, NoLocationInfo)
3437
SWIFT_REQUEST(TypeChecker, DefaultTypeRequest,

0 commit comments

Comments
 (0)