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

Alexander Droste via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 21 09:53:21 PDT 2015


Alexander_Droste added inline comments.

================
Comment at: tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp:137
@@ +136,3 @@
+
+  // This is never reached...
+  llvm::outs() << "////////////////"
----------------
Alexander_Droste wrote:
> I figured out what the problem about the request retrieval is:
> `REGISTER_MAP_WITH_PROGRAMSTATE(RequestMap, const clang::ento::clang::mpi::Request)`
> The documentation states: "The macro should not be used inside namespaces, or for traits that must
> be accessible from more than one translation unit." I think I need some advice here, how to make the  
> same RequestMap accessible in multiple translation units.
How about this: 
We could capture the `PathDiagnosticLocation` of the LastUser in each `mpi::Request` as a member. The `RequestMap` could then be local to `MPICheckerPathSensitive.cpp` and no visitors would be needed. The bug reporter class would then not need to know anything about the request map. The only function I can't find to realise this concept would be something like: `Report->addPathDiagnosticLocation()`.


http://reviews.llvm.org/D12761





More information about the cfe-commits mailing list