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 {
530
530
ScopeCreator *const scopeCreator;
531
531
ASTScopeImpl *insertionPoint;
532
532
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
-
539
533
ASTSourceFileScope (SourceFile *SF, ScopeCreator *scopeCreator);
540
534
541
535
std::string getClassName () const override ;
@@ -560,8 +554,6 @@ class ASTSourceFileScope final : public ASTScopeImpl {
560
554
561
555
protected:
562
556
ASTScopeImpl *expandSpecifically (ScopeCreator &scopeCreator) override ;
563
- bool isCurrentIfWasExpanded () const override ;
564
- void beCurrent () override ;
565
557
bool doesExpansionOnlyAddNewDeclsAtEnd () const override ;
566
558
567
559
ScopeCreator &getScopeCreator () override ;
Original file line number Diff line number Diff line change @@ -1056,8 +1056,7 @@ ASTSourceFileScope::expandAScopeThatCreatesANewInsertionPoint(
1056
1056
ASTScopeAssert (SF, " Must already have a SourceFile." );
1057
1057
ArrayRef<Decl *> decls = SF->getTopLevelDecls ();
1058
1058
// 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 ());
1061
1060
insertionPoint =
1062
1061
scopeCreator.addSiblingsToScopeTree (insertionPoint, this , newNodes);
1063
1062
// Too slow to perform all the time:
@@ -1688,13 +1687,6 @@ bool ASTScopeImpl::isCurrent() const {
1688
1687
void ASTScopeImpl::beCurrent () {}
1689
1688
bool ASTScopeImpl::isCurrentIfWasExpanded () const { return true ; }
1690
1689
1691
- void ASTSourceFileScope::beCurrent () {
1692
- numberOfDeclsAlreadySeen = SF->getTopLevelDecls ().size ();
1693
- }
1694
- bool ASTSourceFileScope::isCurrentIfWasExpanded () const {
1695
- return SF->getTopLevelDecls ().size () == numberOfDeclsAlreadySeen;
1696
- }
1697
-
1698
1690
#pragma mark getParentOfASTAncestorScopesToBeRescued
1699
1691
NullablePtr<ASTScopeImpl>
1700
1692
ASTScopeImpl::getParentOfASTAncestorScopesToBeRescued () {
You can’t perform that action at this time.
0 commit comments