================
@@ -3056,26 +3045,51 @@ 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 labeled break/continue, the label whose statement we're
+  /// targeting.
+  LabelDecl *TargetLabel = nullptr;
+
+  /// Location of the label, if any.
+  SourceLocation Label;
----------------
Sirraide wrote:

Ah, no, we need this because the `LabelDecl*` that is looked up when we parse a 
labeled break/continue specifically finds an existing label decl which points 
to the label that names the loop, i.e.
```c++
a: // <-- LabelDecl
for (;;)
    break a; <-- Label
```
So we still need the source location to keep track of where the label after the 
break/continue is in source.

https://github.com/llvm/llvm-project/pull/152870
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to