[clang] [clang][OpenMP] Diagnose badly-formed collapsed imperfect loop nests (#60678) (PR #101305)

Julian Brown via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 1 05:12:57 PDT 2024


================
@@ -7668,6 +7669,47 @@ struct LoopIterationSpace final {
   Expr *FinalCondition = nullptr;
 };
 
+class ForSubExprChecker : public RecursiveASTVisitor<ForSubExprChecker> {
+  const llvm::SmallSet<Decl *, 4> *CollapsedLoopVarDecls;
+  VarDecl *ForbiddenVar;
+  SourceRange ErrLoc;
+
+public:
+  explicit ForSubExprChecker(
+      const llvm::SmallSet<Decl *, 4> *CollapsedLoopVarDecls)
+      : CollapsedLoopVarDecls(CollapsedLoopVarDecls), ForbiddenVar(nullptr) {}
+
+  bool shouldVisitImplicitCode() const { return true; }
----------------
jtb20 wrote:

Which bit do you think is unused? The next revision includes a comment on the shouldVisitImplicitCode definition (which is needed).

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


More information about the cfe-commits mailing list