[clang] [clang-tools-extra] [Clang] [C2y] Implement N3355 ‘NamedLoops’ (PR #152870)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 2 08:23:48 PDT 2025


================
@@ -3056,26 +3053,53 @@ class IndirectGotoStmt : public Stmt {
   }
 };
 
-/// ContinueStmt - This represents a continue.
-class ContinueStmt : public Stmt {
-public:
-  ContinueStmt(SourceLocation CL) : Stmt(ContinueStmtClass) {
-    setContinueLoc(CL);
+/// Base class for BreakStmt and ContinueStmt.
+class LoopControlStmt : public Stmt {
+  /// If this is a named break/continue, the label whose statement we're
+  /// targeting, as well as the source location of the label after the
+  /// keyword; for example:
+  ///
+  ///   a: // <-- TargetLabel
+  ///   for (;;)
+  ///     break a; // <-- Label
+  ///
+  LabelDecl *TargetLabel = nullptr;
+  SourceLocation Label;
----------------
erichkeane wrote:

Think this still needs to be `LabelLoc`.

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


More information about the cfe-commits mailing list