Skip to content

Commit b6624d5

Browse files
author
David Ungar
committed
---
yaml --- r: 340599 b: refs/heads/rxwei-patch-1 c: 2b7b7cf h: refs/heads/master i: 340597: 2d84adc 340595: b449d21 340591: 6c16df8
1 parent a9ca023 commit b6624d5

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: f2035092504a0e1ad23473c3ba0b4005e34b4ead
1018+
refs/heads/rxwei-patch-1: 2b7b7cfec1963f09e818c40771d24d9a9001ff39
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/include/swift/AST/ASTScope.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ class TopLevelCodeScope final : public ASTScopeImpl {
11701170
ASTScopeImpl *expandMe(ScopeCreator &scopeCreator) override;
11711171

11721172
private:
1173-
void expandAScopeThatDoesNotCreateANewInsertionPoint(ScopeCreator &);
1173+
ASTScopeImpl *expandAScopeThatCreatesANewInsertionPoint(ScopeCreator &);
11741174

11751175
public:
11761176
std::string getClassName() const override;

branches/rxwei-patch-1/lib/AST/ASTScopeCreation.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,8 @@ CREATES_NEW_INSERTION_POINT(PatternEntryInitializerScope)
586586
CREATES_NEW_INSERTION_POINT(PatternEntryUseScope)
587587
CREATES_NEW_INSERTION_POINT(GenericTypeOrExtensionScope)
588588
CREATES_NEW_INSERTION_POINT(BraceStmtScope)
589+
CREATES_NEW_INSERTION_POINT(TopLevelCodeScope)
590+
589591

590592
NO_NEW_INSERTION_POINT(AbstractFunctionBodyScope)
591593
NO_NEW_INSERTION_POINT(AbstractFunctionDeclScope)
@@ -601,7 +603,6 @@ NO_NEW_INSERTION_POINT(IfStmtScope)
601603
NO_NEW_INSERTION_POINT(RepeatWhileScope)
602604
NO_NEW_INSERTION_POINT(SubscriptDeclScope)
603605
NO_NEW_INSERTION_POINT(SwitchStmtScope)
604-
NO_NEW_INSERTION_POINT(TopLevelCodeScope)
605606
NO_NEW_INSERTION_POINT(VarDeclScope)
606607
NO_NEW_INSERTION_POINT(WhileStmtScope)
607608
NO_NEW_INSERTION_POINT(WholeClosureScope)
@@ -715,6 +716,12 @@ ASTScopeImpl *BraceStmtScope::expandAScopeThatCreatesANewInsertionPoint(
715716
return scopeCreator.addScopesToTree(this, stmt->getElements());
716717
}
717718

719+
ASTScopeImpl *TopLevelCodeScope::expandAScopeThatCreatesANewInsertionPoint(
720+
ScopeCreator &scopeCreator) {
721+
return scopeCreator.createSubtree<BraceStmtScope>(this, decl->getBody());
722+
}
723+
724+
718725
#pragma mark expandAScopeThatDoesNotCreateANewInsertionPoint
719726

720727
void ASTSourceFileScope::expandAScopeThatDoesNotCreateANewInsertionPoint(
@@ -886,11 +893,6 @@ void ClosureBodyScope::expandAScopeThatDoesNotCreateANewInsertionPoint(
886893
scopeCreator.createSubtree<BraceStmtScope>(this, closureExpr->getBody());
887894
}
888895

889-
void TopLevelCodeScope::expandAScopeThatDoesNotCreateANewInsertionPoint(
890-
ScopeCreator &scopeCreator) {
891-
scopeCreator.createSubtree<BraceStmtScope>(this, decl->getBody());
892-
}
893-
894896
void DefaultArgumentInitializerScope::
895897
expandAScopeThatDoesNotCreateANewInsertionPoint(
896898
ScopeCreator &scopeCreator) {

0 commit comments

Comments
 (0)