[PATCH] D64356: [OPENMP]Initial fix PR42392: Improve -Wuninitialized warnings for OpenMP programs.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 8 19:04:41 PDT 2019


NoQ added a subscriber: rsmith.
NoQ added a comment.

Ok, so i think i more or less understand where this is going and i like it! My only concern about making sure that used-expressions don't appear in both CFGs; and, even then, it's likely that i'm wrong.

+ at rsmith just in case he has any immediate thoughts on this.



================
Comment at: include/clang/AST/StmtOpenMP.h:292
+  /// reduction, linear and firstprivate clauses, etc.
+  void for_each_used_expr(llvm::function_ref<void(Expr *)> Fn) const;
 };
----------------
This whole `X.for_each(λ)` idiom doesn't seem to be popular in LLVM; people seem to prefer to write an iterator and then use the generic `for_each(X, λ)` over it.

(i don't really care)


================
Comment at: lib/Analysis/CFG.cpp:2063
 
+  if (Context->getLangOpts().OpenMP && isa<OMPExecutableDirective>(S))
+    return VisitOMPExecutableDirective(cast<OMPExecutableDirective>(S), asc);
----------------
The first check looks redundant. I don't think it wins much performance either.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64356/new/

https://reviews.llvm.org/D64356





More information about the cfe-commits mailing list