@@ -894,7 +894,7 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) {
894894 EmitStmt (S.getInit ());
895895
896896 if (S.getConditionVariable ())
897- EmitDecl (*S.getConditionVariable (), /* EvaluateConditionDecl= */ false );
897+ EmitDecl (*S.getConditionVariable ());
898898
899899 // If the condition constant folds and can be elided, try to avoid emitting
900900 // the condition and the dead arm of the if/else.
@@ -1100,7 +1100,7 @@ void CodeGenFunction::EmitWhileStmt(const WhileStmt &S,
11001100 RunCleanupsScope ConditionScope (*this );
11011101
11021102 if (S.getConditionVariable ())
1103- EmitDecl (*S.getConditionVariable (), /* EvaluateConditionDecl= */ false );
1103+ EmitDecl (*S.getConditionVariable ());
11041104
11051105 // Evaluate the conditional in the while header. C99 6.8.5.1: The
11061106 // evaluation of the controlling expression takes place before each
@@ -1319,7 +1319,7 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S,
13191319 // If the for statement has a condition scope, emit the local variable
13201320 // declaration.
13211321 if (S.getConditionVariable ()) {
1322- EmitDecl (*S.getConditionVariable (), /* EvaluateConditionDecl= */ false );
1322+ EmitDecl (*S.getConditionVariable ());
13231323
13241324 // We have entered the condition variable's scope, so we're now able to
13251325 // jump to the continue block.
@@ -1679,7 +1679,7 @@ void CodeGenFunction::EmitDeclStmt(const DeclStmt &S) {
16791679 EmitStopPoint (&S);
16801680
16811681 for (const auto *I : S.decls ())
1682- EmitDecl (*I);
1682+ EmitDecl (*I, /* EvaluateConditionDecl= */ true );
16831683}
16841684
16851685void CodeGenFunction::EmitBreakStmt (const BreakStmt &S) {
@@ -2244,7 +2244,7 @@ void CodeGenFunction::EmitSwitchStmt(const SwitchStmt &S) {
22442244 // Emit the condition variable if needed inside the entire cleanup scope
22452245 // used by this special case for constant folded switches.
22462246 if (S.getConditionVariable ())
2247- EmitDecl (*S.getConditionVariable (), /* EvaluateConditionDecl= */ false );
2247+ EmitDecl (*S.getConditionVariable ());
22482248
22492249 if (auto *DD =
22502250 dyn_cast_if_present<DecompositionDecl>(S.getConditionVariable ()))
@@ -2278,7 +2278,7 @@ void CodeGenFunction::EmitSwitchStmt(const SwitchStmt &S) {
22782278 EmitStmt (S.getInit ());
22792279
22802280 if (S.getConditionVariable ())
2281- EmitDecl (*S.getConditionVariable (), /* EvaluateConditionDecl= */ false );
2281+ EmitDecl (*S.getConditionVariable ());
22822282 llvm::Value *CondV = EmitScalarExpr (S.getCond ());
22832283
22842284 if (auto *DD =
0 commit comments