Skip to content

Commit de7f2f7

Browse files
committed
[ASTScope] Eliminate isRealTopLevelCodeDecl function
Now that, all TopLevelCodeDecl is real. Just don't need this.
1 parent 6fa8415 commit de7f2f7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/AST/ASTScope.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ static bool hasAccessors(AbstractStorageDecl *asd) {
188188
llvm_unreachable("Unhandled ContinuationKind in switch.");
189189
}
190190

191-
/// Determine whether this is a top-level code declaration.
192-
static bool isRealTopLevelCodeDecl(Decl *decl) {
193-
return isa<TopLevelCodeDecl>(decl);
194-
}
195-
196191
void ASTScope::expand() const {
197192
assert(!isExpanded() && "Already expanded the children of this node");
198193
ASTContext &ctx = getASTContext();
@@ -300,7 +295,7 @@ void ASTScope::expand() const {
300295

301296
// If the declaration is a top-level code declaration, turn the source
302297
// file into a continuation. We're done.
303-
if (isRealTopLevelCodeDecl(decl)) {
298+
if (isa<TopLevelCodeDecl>(decl)) {
304299
addActiveContinuation(this);
305300
break;
306301
}
@@ -937,7 +932,6 @@ ASTScope *ASTScope::createIfNeeded(const ASTScope *parent, Decl *decl) {
937932
}
938933

939934
case DeclKind::TopLevelCode:
940-
if (!isRealTopLevelCodeDecl(decl)) return nullptr;
941935
return new (ctx) ASTScope(parent, cast<TopLevelCodeDecl>(decl));
942936

943937
case DeclKind::Protocol:

0 commit comments

Comments
 (0)