@@ -280,7 +280,6 @@ class ASTScopeImpl {
280280public:
281281 virtual NullablePtr<ClosureExpr> getClosureIfClosureScope () const ;
282282 virtual ASTContext &getASTContext () const ;
283- virtual NullablePtr<DeclContext> getDeclContext () const ;
284283 virtual NullablePtr<Decl> getDeclIfAny () const { return nullptr ; };
285284 virtual NullablePtr<Stmt> getStmtIfAny () const { return nullptr ; };
286285 virtual NullablePtr<Expr> getExprIfAny () const { return nullptr ; };
@@ -354,7 +353,7 @@ class ASTScopeImpl {
354353
355354 // / Entry point into ASTScopeImpl-land for lookups
356355 static void
357- unqualifiedLookup (SourceFile *, DeclNameRef, SourceLoc, DeclConsumer);
356+ unqualifiedLookup (SourceFile *, SourceLoc, DeclConsumer);
358357
359358 // / Entry point into ASTScopeImpl-land for labeled statement lookups.
360359 static llvm::SmallVector<LabeledStmt *, 4 >
@@ -366,7 +365,6 @@ class ASTScopeImpl {
366365#pragma mark - - lookup- starting point
367366private:
368367 static const ASTScopeImpl *findStartingScopeForLookup (SourceFile *,
369- const DeclNameRef name,
370368 const SourceLoc where);
371369
372370protected:
@@ -487,8 +485,6 @@ class ASTSourceFileScope final : public ASTScopeImpl {
487485 void printSpecifics (llvm::raw_ostream &out) const override ;
488486
489487public:
490- NullablePtr<DeclContext> getDeclContext () const override ;
491-
492488 void buildFullyExpandedTree ();
493489 void
494490 buildEnoughOfTreeForTopLevelExpressionsButDontRequestGenericsOrExtendedNominals ();
@@ -497,7 +493,8 @@ class ASTSourceFileScope final : public ASTScopeImpl {
497493
498494 const SourceFile *getSourceFile () const override ;
499495 NullablePtr<const void > addressForPrinting () const override { return SF; }
500- bool crossCheckWithAST ();
496+
497+ ASTContext &getASTContext () const override ;
501498
502499protected:
503500 ASTScopeImpl *expandSpecifically (ScopeCreator &scopeCreator) override ;
@@ -684,7 +681,6 @@ class GenericTypeOrExtensionScope : public ASTScopeImpl {
684681 // Returns the where clause scope, or the parent if none
685682 virtual ASTScopeImpl *createTrailingWhereClauseScope (ASTScopeImpl *parent,
686683 ScopeCreator &);
687- NullablePtr<DeclContext> getDeclContext () const override ;
688684 virtual NullablePtr<NominalTypeDecl> getCorrespondingNominalTypeDecl () const {
689685 return nullptr ;
690686 }
@@ -829,7 +825,6 @@ class GenericParamScope final : public ASTScopeImpl {
829825
830826 // / Actually holder is always a GenericContext, need to test if
831827 // / ProtocolDecl or SubscriptDecl but will refactor later.
832- NullablePtr<DeclContext> getDeclContext () const override ;
833828 NullablePtr<const void > getReferrent () const override ;
834829 std::string getClassName () const override ;
835830 SourceRange
@@ -870,8 +865,6 @@ class AbstractFunctionDeclScope final : public ASTScopeImpl {
870865 void printSpecifics (llvm::raw_ostream &out) const override ;
871866
872867public:
873- virtual NullablePtr<DeclContext> getDeclContext () const override ;
874-
875868 virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
876869 Decl *getDecl () const { return decl; }
877870
@@ -906,7 +899,6 @@ class ParameterListScope final : public ASTScopeImpl {
906899 std::string getClassName () const override ;
907900 SourceRange
908901 getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
909- virtual NullablePtr<DeclContext> getDeclContext () const override ;
910902
911903 NullablePtr<const void > addressForPrinting () const override { return params; }
912904};
@@ -929,9 +921,6 @@ class FunctionBodyScope : public ASTScopeImpl {
929921public:
930922 SourceRange
931923 getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
932- virtual NullablePtr<DeclContext> getDeclContext () const override {
933- return decl;
934- }
935924 virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
936925 Decl *getDecl () const { return decl; }
937926
@@ -959,7 +948,6 @@ class DefaultArgumentInitializerScope final : public ASTScopeImpl {
959948 std::string getClassName () const override ;
960949 SourceRange
961950 getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
962- virtual NullablePtr<DeclContext> getDeclContext () const override ;
963951 virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
964952 Decl *getDecl () const { return decl; }
965953};
@@ -1002,7 +990,6 @@ class AttachedPropertyWrapperScope final : public ASTScopeImpl {
1002990 SourceRange
1003991 getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1004992 NullablePtr<const void > addressForPrinting () const override { return decl; }
1005- virtual NullablePtr<DeclContext> getDeclContext () const override ;
1006993
1007994 NullablePtr<DeclAttribute> getDeclAttributeIfAny () const override {
1008995 return attr;
@@ -1101,7 +1088,6 @@ class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
11011088 std::string getClassName () const override ;
11021089 SourceRange
11031090 getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1104- virtual NullablePtr<DeclContext> getDeclContext () const override ;
11051091
11061092protected:
11071093 bool lookupLocalsOrMembers (DeclConsumer) const override ;
@@ -1189,7 +1175,6 @@ class CaptureListScope final : public ASTScopeImpl {
11891175 std::string getClassName () const override ;
11901176 SourceRange
11911177 getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1192- NullablePtr<DeclContext> getDeclContext () const override ;
11931178 NullablePtr<Expr> getExprIfAny () const override { return expr; }
11941179 Expr *getExpr () const { return expr; }
11951180 NullablePtr<const void > getReferrent () const override ;
@@ -1212,9 +1197,6 @@ class ClosureParametersScope final : public ASTScopeImpl {
12121197 NullablePtr<ClosureExpr> getClosureIfClosureScope () const override {
12131198 return closureExpr;
12141199 }
1215- NullablePtr<DeclContext> getDeclContext () const override {
1216- return closureExpr;
1217- }
12181200 NullablePtr<Expr> getExprIfAny () const override { return closureExpr; }
12191201 Expr *getExpr () const { return closureExpr; }
12201202 NullablePtr<const void > getReferrent () const override ;
@@ -1247,9 +1229,6 @@ class TopLevelCodeScope final : public ASTScopeImpl {
12471229 std::string getClassName () const override ;
12481230 SourceRange
12491231 getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1250- virtual NullablePtr<DeclContext> getDeclContext () const override {
1251- return decl;
1252- }
12531232 virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
12541233 Decl *getDecl () const { return decl; }
12551234 NullablePtr<const void > getReferrent () const override ;
@@ -1336,9 +1315,6 @@ class SubscriptDeclScope final : public ASTScopeImpl {
13361315 void printSpecifics (llvm::raw_ostream &out) const override ;
13371316
13381317public:
1339- virtual NullablePtr<DeclContext> getDeclContext () const override {
1340- return decl;
1341- }
13421318 virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
13431319 Decl *getDecl () const { return decl; }
13441320 NullablePtr<const void > getReferrent () const override ;
@@ -1358,7 +1334,6 @@ class EnumElementScope : public ASTScopeImpl {
13581334
13591335 std::string getClassName () const override ;
13601336 ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
1361- NullablePtr<DeclContext> getDeclContext () const override { return decl; }
13621337 NullablePtr<Decl> getDeclIfAny () const override { return decl; }
13631338 Decl *getDecl () const { return decl; }
13641339
@@ -1700,7 +1675,6 @@ class BraceStmtScope final : public AbstractStmtScope {
17001675 std::string getClassName () const override ;
17011676 SourceRange
17021677 getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1703- virtual NullablePtr<DeclContext> getDeclContext () const override ;
17041678
17051679 NullablePtr<ClosureExpr> parentClosureIfAny () const ; // public??
17061680 Stmt *getStmt () const override { return stmt; }
0 commit comments