[clang] [CIR] Handle the 'before case' block of a switch statement. (PR #199752)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue May 26 17:51:33 PDT 2026


================
@@ -1165,10 +1165,35 @@ mlir::LogicalResult CIRGenFunction::emitSwitchBody(const Stmt *s) {
 
   auto *compoundStmt = cast<CompoundStmt>(s);
 
-  mlir::Block *swtichBlock = builder.getBlock();
-  for (auto *c : compoundStmt->body()) {
+  ArrayRef<Stmt *> body{compoundStmt->body_begin(), compoundStmt->body_end()};
----------------
erichkeane wrote:

No, thats an iterator_range.  I could use that instead of array-ref for the range, but it doesn't have a 'drop-front' type function.

https://github.com/llvm/llvm-project/pull/199752


More information about the cfe-commits mailing list