[PATCH] D12761: MPI-Checker patch for Clang Static Analyzer

Alexander Droste via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 25 01:45:35 PST 2016

Alexander_Droste marked 36 inline comments as done.

Comment at: tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPICheckerPathSensitive.cpp:79
@@ +78,3 @@
+  if (!ReqRegions.empty()) {
+    Ctx.addTransition(State);
+  }
Alexander_Droste wrote:
> zaks.anna wrote:
> > Don't forget to specify a predecessor here once the code above changes.
> Will do.
Changed this to the same ErrorNode/State pattern like in `checkMissingWaits`.

Comment at: tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIFunctionClassifier.h:45
@@ +44,3 @@
+  bool isAllgatherType(const clang::IdentifierInfo *const IdentInfo) const;
+  bool isAlltoallType(const clang::IdentifierInfo *const IdentInfo) const;
+  bool isReduceType(const clang::IdentifierInfo *const IdentInfo) const;
Alexander_Droste wrote:
> zaks.anna wrote:
> > Some of these classifier functions are not used either..
> These model distinct MPI function classes. I agree that it would be better to remove the unused ones, in order to keep the interface as narrow as possible.
I'd like to keep some of the classes/identifiers that are not used in this patch 
but will be in the clang-tidy patch, as discussed with Alexander Kornienko.

Comment at: tools/clang/test/Analysis/MPIChecker.cpp:112
@@ +111,3 @@
+              &sendReq1); // Request is previously used by nonblocking call here.
+} // expected-warning{{Request 'sendReq1' has no matching wait.}}
Alexander_Droste wrote:
> zaks.anna wrote:
> > This is not testing the extra information provided by bug reporter visitor; you should use "// expected-note {...}"
> I didn't know about `expected-note`, thanks!
I changed the plain comments to `// expected-note{{..}}` but all tests using an expected note fail by claiming:

```error: 'note' diagnostics expected but not seen:
File .../MPIChecker.cpp Line 112: Request is previously used by nonblocking call here.```

Though, running the MPI-Checker on this function, the HTML report contains this exact note 
at the expected position. The output is produced at the end of `MPIBugReporter::RequestNodeVisitor::VisitNode`.

Is there something missing, in order to make this an expected note?


More information about the cfe-commits mailing list