================
@@ -3084,35 +3090,48 @@ class ContinueStmt : public Stmt {
const_child_range children() const {
return const_child_range(const_child_iterator(), const_child_iterator());
}
+
+ static bool classof(const Stmt *T) {
+ StmtClass Class = T->getStmtClass();
+ return Class == ContinueStmtClass || Class == BreakStmtClass;
+ }
};
-/// BreakStmt - This represents a break.
-class BreakStmt : public Stmt {
+/// ContinueStmt - This represents a continue.
+class ContinueStmt : public LoopControlStmt {
public:
- BreakStmt(SourceLocation BL) : Stmt(BreakStmtClass) {
- setBreakLoc(BL);
+ ContinueStmt(SourceLocation CL) : LoopControlStmt(ContinueStmtClass, CL) {}
+ ContinueStmt(SourceLocation CL, SourceLocation LabelLoc, LabelDecl *Target)
+ : LoopControlStmt(ContinueStmtClass, CL) {
+ setLabelLoc(LabelLoc);
----------------
Sirraide wrote:
> Why not just create another constructor in `LoopControlStmt` and pass
> `LabelLoc` and `Target` there? Same for `BreakStmt`.
I didn’t think it was worth it adding an additional constructor just for that
but we can do that if you prefer.
https://github.com/llvm/llvm-project/pull/152870
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits