@@ -363,10 +363,10 @@ class TreeTransform {
363
363
/// @}
364
364
365
365
/// The reason why the value of a statement is not discarded, if any.
366
- enum StmtDiscardKind {
367
- SDK_Discarded ,
368
- SDK_NotDiscarded ,
369
- SDK_StmtExprResult ,
366
+ enum class StmtDiscardKind {
367
+ Discarded ,
368
+ NotDiscarded ,
369
+ StmtExprResult ,
370
370
};
371
371
372
372
/// Transform the given statement.
@@ -378,7 +378,8 @@ class TreeTransform {
378
378
/// other mechanism.
379
379
///
380
380
/// \returns the transformed statement.
381
- StmtResult TransformStmt(Stmt *S, StmtDiscardKind SDK = SDK_Discarded);
381
+ StmtResult TransformStmt(Stmt *S,
382
+ StmtDiscardKind SDK = StmtDiscardKind::Discarded);
382
383
383
384
/// Transform the given statement.
384
385
///
@@ -4357,9 +4358,9 @@ StmtResult TreeTransform<Derived>::TransformStmt(Stmt *S, StmtDiscardKind SDK) {
4357
4358
{
4358
4359
ExprResult E = getDerived().TransformExpr(cast<Expr>(S));
4359
4360
4360
- if (SDK == SDK_StmtExprResult )
4361
+ if (SDK == StmtDiscardKind::StmtExprResult )
4361
4362
E = getSema().ActOnStmtExprResult(E);
4362
- return getSema().ActOnExprStmt(E, SDK == SDK_Discarded );
4363
+ return getSema().ActOnExprStmt(E, SDK == StmtDiscardKind::Discarded );
4363
4364
}
4364
4365
}
4365
4366
@@ -8256,7 +8257,8 @@ TreeTransform<Derived>::TransformCompoundStmt(CompoundStmt *S,
8256
8257
SmallVector<Stmt*, 8> Statements;
8257
8258
for (auto *B : S->body()) {
8258
8259
StmtResult Result = getDerived().TransformStmt(
8259
- B, IsStmtExpr && B == ExprResult ? SDK_StmtExprResult : SDK_Discarded);
8260
+ B, IsStmtExpr && B == ExprResult ? StmtDiscardKind::StmtExprResult
8261
+ : StmtDiscardKind::Discarded);
8260
8262
8261
8263
if (Result.isInvalid()) {
8262
8264
// Immediately fail if this was a DeclStmt, since it's very
@@ -9237,8 +9239,8 @@ StmtResult
9237
9239
TreeTransform<Derived>::TransformObjCForCollectionStmt(
9238
9240
ObjCForCollectionStmt *S) {
9239
9241
// Transform the element statement.
9240
- StmtResult Element =
9241
- getDerived().TransformStmt( S->getElement(), SDK_NotDiscarded );
9242
+ StmtResult Element = getDerived().TransformStmt(
9243
+ S->getElement(), StmtDiscardKind::NotDiscarded );
9242
9244
if (Element.isInvalid())
9243
9245
return StmtError();
9244
9246
0 commit comments