Skip to content

Commit b3b033b

Browse files
authored
[CIR][NFC] Fix bad switch fallthroughs in emitStmt (#171224)
This moves a couple of statement emitters that were incorrectly implemented in the middle of a switch statement where all cases in the final group are intended to fall through to a handler that emits an NYI error message. The placement of these implementations was causing some statement types that should have emitted the NYI error to instead go to a handler for a different statement type.
1 parent 632cbee commit b3b033b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/CIR/CodeGen/CIRGenStmt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s,
159159
return emitCXXTryStmt(cast<CXXTryStmt>(*s));
160160
case Stmt::CXXForRangeStmtClass:
161161
return emitCXXForRangeStmt(cast<CXXForRangeStmt>(*s), attr);
162+
case Stmt::CoroutineBodyStmtClass:
163+
return emitCoroutineBody(cast<CoroutineBodyStmt>(*s));
164+
case Stmt::IndirectGotoStmtClass:
165+
return emitIndirectGotoStmt(cast<IndirectGotoStmt>(*s));
162166
case Stmt::OpenACCComputeConstructClass:
163167
return emitOpenACCComputeConstruct(cast<OpenACCComputeConstruct>(*s));
164168
case Stmt::OpenACCLoopConstructClass:
@@ -199,11 +203,7 @@ mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s,
199203
case Stmt::CaseStmtClass:
200204
case Stmt::SEHLeaveStmtClass:
201205
case Stmt::SYCLKernelCallStmtClass:
202-
case Stmt::CoroutineBodyStmtClass:
203-
return emitCoroutineBody(cast<CoroutineBodyStmt>(*s));
204206
case Stmt::CoreturnStmtClass:
205-
case Stmt::IndirectGotoStmtClass:
206-
return emitIndirectGotoStmt(cast<IndirectGotoStmt>(*s));
207207
case Stmt::OMPParallelDirectiveClass:
208208
case Stmt::OMPTaskwaitDirectiveClass:
209209
case Stmt::OMPTaskyieldDirectiveClass:

0 commit comments

Comments
 (0)