@@ -2399,7 +2399,7 @@ bool swift::diagnoseExplicitUnavailability(
2399
2399
}
2400
2400
2401
2401
namespace {
2402
- class AvailabilityWalker : public ASTWalker {
2402
+ class ExprAvailabilityWalker : public ASTWalker {
2403
2403
// / Describes how the next member reference will be treated as we traverse
2404
2404
// / the AST.
2405
2405
enum class MemberAccessContext : unsigned {
@@ -2423,7 +2423,7 @@ class AvailabilityWalker : public ASTWalker {
2423
2423
ExportContext Where;
2424
2424
2425
2425
public:
2426
- AvailabilityWalker (ExportContext Where)
2426
+ explicit ExprAvailabilityWalker (ExportContext Where)
2427
2427
: Context(Where.getDeclContext()->getASTContext()), Where(Where) {}
2428
2428
2429
2429
bool shouldWalkIntoSeparatelyCheckedClosure (ClosureExpr *expr) override {
@@ -2694,7 +2694,7 @@ class AvailabilityWalker : public ASTWalker {
2694
2694
// / Diagnose uses of unavailable declarations. Returns true if a diagnostic
2695
2695
// / was emitted.
2696
2696
bool
2697
- AvailabilityWalker ::diagnoseDeclRefAvailability (
2697
+ ExprAvailabilityWalker ::diagnoseDeclRefAvailability (
2698
2698
ConcreteDeclRef declRef, SourceRange R, const ApplyExpr *call,
2699
2699
DeclAvailabilityFlags Flags) const {
2700
2700
if (!declRef)
@@ -2806,8 +2806,8 @@ static bool isIntegerOrFloatingPointType(Type ty, DeclContext *DC,
2806
2806
// / If this is a call to an unavailable ++ / -- operator, try to diagnose it
2807
2807
// / with a fixit hint and return true. If not, or if we fail, return false.
2808
2808
bool
2809
- AvailabilityWalker ::diagnoseIncDecRemoval (const ValueDecl *D, SourceRange R,
2810
- const AvailableAttr *Attr) const {
2809
+ ExprAvailabilityWalker ::diagnoseIncDecRemoval (const ValueDecl *D, SourceRange R,
2810
+ const AvailableAttr *Attr) const {
2811
2811
// We can only produce a fixit if we're talking about ++ or --.
2812
2812
bool isInc = D->getBaseName () == " ++" ;
2813
2813
if (!isInc && D->getBaseName () != " --" )
@@ -2870,10 +2870,10 @@ AvailabilityWalker::diagnoseIncDecRemoval(const ValueDecl *D, SourceRange R,
2870
2870
// / If this is a call to an unavailable sizeof family function, diagnose it
2871
2871
// / with a fixit hint and return true. If not, or if we fail, return false.
2872
2872
bool
2873
- AvailabilityWalker ::diagnoseMemoryLayoutMigration (const ValueDecl *D,
2874
- SourceRange R,
2875
- const AvailableAttr *Attr,
2876
- const ApplyExpr *call) const {
2873
+ ExprAvailabilityWalker ::diagnoseMemoryLayoutMigration (const ValueDecl *D,
2874
+ SourceRange R,
2875
+ const AvailableAttr *Attr,
2876
+ const ApplyExpr *call) const {
2877
2877
2878
2878
if (!D->getModuleContext ()->isStdlibModule ())
2879
2879
return false ;
@@ -2946,7 +2946,7 @@ void swift::diagnoseExprAvailability(const Expr *E, DeclContext *DC) {
2946
2946
auto where = ExportContext::forFunctionBody (DC);
2947
2947
if (where.isImplicit ())
2948
2948
return ;
2949
- AvailabilityWalker walker (where);
2949
+ ExprAvailabilityWalker walker (where);
2950
2950
const_cast <Expr*>(E)->walk (walker);
2951
2951
}
2952
2952
0 commit comments