File tree Expand file tree Collapse file tree 2 files changed +1
-17
lines changed
Expand file tree Collapse file tree 2 files changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -530,12 +530,6 @@ class ASTSourceFileScope final : public ASTScopeImpl {
530530 ScopeCreator *const scopeCreator;
531531 ASTScopeImpl *insertionPoint;
532532
533- // / The number of \c Decls in the \c SourceFile that were already seen.
534- // / Since parsing can be interleaved with type-checking, on every
535- // / lookup, look at creating scopes for any \c Decls beyond this number.
536- // / TODO: Unify with numberOfChildrenWhenLastExpanded
537- size_t numberOfDeclsAlreadySeen = 0 ;
538-
539533 ASTSourceFileScope (SourceFile *SF, ScopeCreator *scopeCreator);
540534
541535 std::string getClassName () const override ;
@@ -560,8 +554,6 @@ class ASTSourceFileScope final : public ASTScopeImpl {
560554
561555protected:
562556 ASTScopeImpl *expandSpecifically (ScopeCreator &scopeCreator) override ;
563- bool isCurrentIfWasExpanded () const override ;
564- void beCurrent () override ;
565557 bool doesExpansionOnlyAddNewDeclsAtEnd () const override ;
566558
567559 ScopeCreator &getScopeCreator () override ;
Original file line number Diff line number Diff line change @@ -1056,8 +1056,7 @@ ASTSourceFileScope::expandAScopeThatCreatesANewInsertionPoint(
10561056 ASTScopeAssert (SF, " Must already have a SourceFile." );
10571057 ArrayRef<Decl *> decls = SF->getTopLevelDecls ();
10581058 // Assume that decls are only added at the end, in source order
1059- ArrayRef<Decl *> newDecls = decls.slice (numberOfDeclsAlreadySeen);
1060- std::vector<ASTNode> newNodes (newDecls.begin (), newDecls.end ());
1059+ std::vector<ASTNode> newNodes (decls.begin (), decls.end ());
10611060 insertionPoint =
10621061 scopeCreator.addSiblingsToScopeTree (insertionPoint, this , newNodes);
10631062 // Too slow to perform all the time:
@@ -1688,13 +1687,6 @@ bool ASTScopeImpl::isCurrent() const {
16881687void ASTScopeImpl::beCurrent () {}
16891688bool ASTScopeImpl::isCurrentIfWasExpanded () const { return true ; }
16901689
1691- void ASTSourceFileScope::beCurrent () {
1692- numberOfDeclsAlreadySeen = SF->getTopLevelDecls ().size ();
1693- }
1694- bool ASTSourceFileScope::isCurrentIfWasExpanded () const {
1695- return SF->getTopLevelDecls ().size () == numberOfDeclsAlreadySeen;
1696- }
1697-
16981690#pragma mark getParentOfASTAncestorScopesToBeRescued
16991691NullablePtr<ASTScopeImpl>
17001692ASTScopeImpl::getParentOfASTAncestorScopesToBeRescued () {
You can’t perform that action at this time.
0 commit comments