================ @@ -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); ---------------- shafik wrote:
Why not just create another constructor in `LoopControlStmt` and pass `LabelLoc` and `Target` there? Same for `BreakStmt`. https://github.com/llvm/llvm-project/pull/152870 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits