[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 15:19:18 PDT 2019


NoQ added a comment.

I don't know much about OpenMP, but i guess i can help with the CFG a bit.

I strongly recommend adding a few direct tests for the CFG so that to check that the order of statements and the overall topology of the CFG is as you intended. Currently those tests are routed through the Static Analyzer because nobody else seems to care; see `test/Analysis/cfg.cpp` as an example (there are a few more such tests, grep for `DumpCFG`).

I tried to apply the patch and accidentally noticed that none of the newly added tests actually pass for me. Is this the right patch? Or is it just me?



================
Comment at: lib/Analysis/CFG.cpp:4746-4750
+  D->for_each_used_expr([this, &B](Expr *E) {
+    assert(E && "Expected expression.");
+    if (CFGBlock *R = Visit(E))
+      B = R;
+  });
----------------
Not sure, are these expressions actually evaluated in run-time when the directive is hit? When i looked at a few AST dumps it seemed to me as if these are just a few `DeclRefExpr`s that refer back to the captured variables; they don't really do anything.


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