Skip to content

Commit 48b8ba3

Browse files
committed
Remove DeclValidationRAII
The last real client was precedence group validation.
1 parent 6bb0e49 commit 48b8ba3

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class alignas(1 << DeclAlignInBits) Decl {
285285
protected:
286286
union { uint64_t OpaqueBits;
287287

288-
SWIFT_INLINE_BITFIELD_BASE(Decl, bitmax(NumDeclKindBits,8)+1+1+1+1+2+1,
288+
SWIFT_INLINE_BITFIELD_BASE(Decl, bitmax(NumDeclKindBits,8)+1+1+1+1+1,
289289
Kind : bitmax(NumDeclKindBits,8),
290290

291291
/// Whether this declaration is invalid.

lib/AST/Decl.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2783,8 +2783,13 @@ bool ValueDecl::hasInterfaceType() const {
27832783
return !TypeAndAccess.getPointer().isNull();
27842784
}
27852785

2786+
static bool isComputingInterfaceType(const ValueDecl *VD) {
2787+
return VD->getASTContext().evaluator.hasActiveRequest(
2788+
InterfaceTypeRequest{const_cast<ValueDecl *>(VD)});
2789+
}
2790+
27862791
bool ValueDecl::isRecursiveValidation() const {
2787-
if (hasValidationStarted() && !hasInterfaceType())
2792+
if (isComputingInterfaceType(this) && !hasInterfaceType())
27882793
return true;
27892794

27902795
if (auto *vd = dyn_cast<VarDecl>(this))

lib/Sema/TypeCheckDecl.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4242,7 +4242,6 @@ InterfaceTypeRequest::evaluate(Evaluator &eval, ValueDecl *D) const {
42424242
case DeclKind::Constructor:
42434243
case DeclKind::Destructor: {
42444244
auto *AFD = cast<AbstractFunctionDecl>(D);
4245-
DeclValidationRAII IBV(AFD);
42464245

42474246
auto sig = AFD->getGenericSignature();
42484247
bool hasSelf = AFD->hasImplicitSelfDecl();
@@ -4295,7 +4294,6 @@ InterfaceTypeRequest::evaluate(Evaluator &eval, ValueDecl *D) const {
42954294

42964295
case DeclKind::Subscript: {
42974296
auto *SD = cast<SubscriptDecl>(D);
4298-
DeclValidationRAII IBV(SD);
42994297

43004298
auto elementTy = SD->getElementInterfaceType();
43014299

@@ -4313,7 +4311,6 @@ InterfaceTypeRequest::evaluate(Evaluator &eval, ValueDecl *D) const {
43134311

43144312
case DeclKind::EnumElement: {
43154313
auto *EED = cast<EnumElementDecl>(D);
4316-
DeclValidationRAII IBV(EED);
43174314

43184315
auto *ED = EED->getParentEnum();
43194316

0 commit comments

Comments
 (0)