Maybe use `stmt == nullptr || isa<BreakStmt>(stmt) || isa<ContinueStmt>(stmt)` ...