Skip to content

Commit 44ec753

Browse files
committed
Remove outdated documentation
1 parent 70b6bbc commit 44ec753

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

lib/AST/Decl.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5813,6 +5813,10 @@ StaticSpellingKind AbstractStorageDecl::getCorrectStaticSpelling() const {
58135813

58145814
llvm::TinyPtrVector<CustomAttr *> VarDecl::getAttachedPropertyWrappers() const {
58155815
auto &ctx = getASTContext();
5816+
if (!ctx.areLegacySemanticQueriesEnabled()) {
5817+
return { };
5818+
}
5819+
58165820
auto mutableThis = const_cast<VarDecl *>(this);
58175821
return evaluateOrDefault(ctx.evaluator,
58185822
AttachedPropertyWrappersRequest{mutableThis},
@@ -6782,7 +6786,7 @@ ObjCSelector
67826786
AbstractFunctionDecl::getObjCSelector(DeclName preferredName,
67836787
bool skipIsObjCResolution) const {
67846788
// FIXME: Forces computation of the Objective-C selector.
6785-
if (!skipIsObjCResolution)
6789+
if (getASTContext().areLegacySemanticQueriesEnabled() && !skipIsObjCResolution)
67866790
(void)isObjC();
67876791

67886792
// If there is an @objc attribute with a name, use that name.

lib/Sema/TypeChecker.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ bool swift::performTypeLocChecking(ASTContext &Ctx, TypeLoc &T,
528528
Optional<DiagnosticSuppression> suppression;
529529
if (!ProduceDiagnostics)
530530
suppression.emplace(Ctx.Diags);
531+
assert(Ctx.areLegacySemanticQueriesEnabled());
531532
return TypeChecker::validateType(Ctx, T, resolution, options);
532533
}
533534

@@ -634,15 +635,15 @@ swift::getTypeOfCompletionOperator(DeclContext *DC, Expr *LHS,
634635
ConcreteDeclRef &referencedDecl) {
635636
auto &ctx = DC->getASTContext();
636637
DiagnosticSuppression suppression(ctx.Diags);
637-
Ctx.setLegacySemanticQueriesEnabled();
638+
ctx.setLegacySemanticQueriesEnabled();
638639
return TypeChecker::getTypeOfCompletionOperator(DC, LHS, opName, refKind,
639640
referencedDecl);
640641
}
641642

642643
bool swift::typeCheckExpression(DeclContext *DC, Expr *&parsedExpr) {
643644
auto &ctx = DC->getASTContext();
644645
DiagnosticSuppression suppression(ctx.Diags);
645-
Ctx.setLegacySemanticQueriesEnabled();
646+
ctx.setLegacySemanticQueriesEnabled();
646647
auto resultTy = TypeChecker::typeCheckExpression(parsedExpr, DC, TypeLoc(),
647648
CTP_Unused);
648649
return !resultTy;

lib/Sema/TypeChecker.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,6 @@ enum class CheckedCastContextKind {
401401
EnumElementPattern,
402402
};
403403

404-
/// The Swift type checker, which takes a parsed AST and performs name binding,
405-
/// type checking, and semantic analysis to produce a type-annotated AST.
406404
namespace TypeChecker {
407405
Type getArraySliceType(SourceLoc loc, Type elementType);
408406
Type getDictionaryType(SourceLoc loc, Type keyType, Type valueType);

0 commit comments

Comments
 (0)