[clang] [CIR] Upstream support for break and continue statements (PR #134181)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 4 11:41:06 PDT 2025


================
@@ -569,6 +569,36 @@ def YieldOp : CIR_Op<"yield", [ReturnLike, Terminator,
   ];
 }
 
+//===----------------------------------------------------------------------===//
+// BreakOp
+//===----------------------------------------------------------------------===//
+
+def BreakOp : CIR_Op<"break", [Terminator]> {
+  let summary = "C/C++ `break` statement equivalent";
+  let description = [{
+    The `cir.break` operation is used to cease the execution of the current
+    loop or switch and transfer control to the parent operation. It is only
----------------
erichkeane wrote:

Oh, yeah, that was a thinko/misread from me.  I like the 'operation' word being there as I think it is an improvement, else LGTM.

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


More information about the cfe-commits mailing list