Skip to content

Commit ad42d47

Browse files
committed
[AST] Remove some pointless uses of hasSingleExpressionBody().
1 parent f55e764 commit ad42d47

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,11 +2496,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
24962496
}
24972497

24982498
OS << '\n';
2499-
if (E->hasSingleExpressionBody()) {
2500-
printRec(E->getSingleExpressionBody());
2501-
} else {
2502-
printRec(E->getBody(), E->getASTContext());
2503-
}
2499+
printRec(E->getBody(), E->getASTContext());
25042500
PrintWithColorRAII(OS, ParenthesisColor) << ')';
25052501
}
25062502
void visitAutoClosureExpr(AutoClosureExpr *E) {

lib/AST/Expr.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,11 +2365,7 @@ void swift::simple_display(llvm::raw_ostream &out, const ClosureExpr *CE) {
23652365
return;
23662366
}
23672367

2368-
if (CE->hasSingleExpressionBody()) {
2369-
out << "single expression closure";
2370-
} else {
2371-
out << "closure";
2372-
}
2368+
out << "closure";
23732369
}
23742370

23752371
void swift::simple_display(llvm::raw_ostream &out,

0 commit comments

Comments
 (0)