@@ -357,10 +357,10 @@ class TreeTransform {
357
357
/// @}
358
358
359
359
/// The reason why the value of a statement is not discarded, if any.
360
- enum StmtDiscardKind {
361
- SDK_Discarded ,
362
- SDK_NotDiscarded ,
363
- SDK_StmtExprResult ,
360
+ enum class StmtDiscardKind {
361
+ Discarded ,
362
+ NotDiscarded ,
363
+ StmtExprResult ,
364
364
};
365
365
366
366
/// Transform the given statement.
@@ -372,7 +372,8 @@ class TreeTransform {
372
372
/// other mechanism.
373
373
///
374
374
/// \returns the transformed statement.
375
- StmtResult TransformStmt(Stmt *S, StmtDiscardKind SDK = SDK_Discarded);
375
+ StmtResult TransformStmt(Stmt *S,
376
+ StmtDiscardKind SDK = StmtDiscardKind::Discarded);
376
377
377
378
/// Transform the given statement.
378
379
///
@@ -4292,9 +4293,9 @@ StmtResult TreeTransform<Derived>::TransformStmt(Stmt *S, StmtDiscardKind SDK) {
4292
4293
{
4293
4294
ExprResult E = getDerived().TransformExpr(cast<Expr>(S));
4294
4295
4295
- if (SDK == SDK_StmtExprResult )
4296
+ if (SDK == StmtDiscardKind::StmtExprResult )
4296
4297
E = getSema().ActOnStmtExprResult(E);
4297
- return getSema().ActOnExprStmt(E, SDK == SDK_Discarded );
4298
+ return getSema().ActOnExprStmt(E, SDK == StmtDiscardKind::Discarded );
4298
4299
}
4299
4300
}
4300
4301
@@ -8086,7 +8087,8 @@ TreeTransform<Derived>::TransformCompoundStmt(CompoundStmt *S,
8086
8087
SmallVector<Stmt*, 8> Statements;
8087
8088
for (auto *B : S->body()) {
8088
8089
StmtResult Result = getDerived().TransformStmt(
8089
- B, IsStmtExpr && B == ExprResult ? SDK_StmtExprResult : SDK_Discarded);
8090
+ B, IsStmtExpr && B == ExprResult ? StmtDiscardKind::StmtExprResult
8091
+ : StmtDiscardKind::Discarded);
8090
8092
8091
8093
if (Result.isInvalid()) {
8092
8094
// Immediately fail if this was a DeclStmt, since it's very
@@ -9067,8 +9069,8 @@ StmtResult
9067
9069
TreeTransform<Derived>::TransformObjCForCollectionStmt(
9068
9070
ObjCForCollectionStmt *S) {
9069
9071
// Transform the element statement.
9070
- StmtResult Element =
9071
- getDerived().TransformStmt( S->getElement(), SDK_NotDiscarded );
9072
+ StmtResult Element = getDerived().TransformStmt(
9073
+ S->getElement(), StmtDiscardKind::NotDiscarded );
9072
9074
if (Element.isInvalid())
9073
9075
return StmtError();
9074
9076
0 commit comments