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

Alexander Droste via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 07:41:16 PDT 2015


Alexander_Droste created this revision.
Alexander_Droste added reviewers: zaks.anna, hfinkel.
Alexander_Droste added subscribers: cfe-commits, krememek, gribozavr, dcoughlin.

This is a patch to add static analysis functionality for MPI code written in C
to Clang's Static Analyzer in form of a checker. In comparison to the code
currently published on GitHub https://github.com/0ax1/MPI-Checker
I excluded the
unmatched point-to-point call check,
unreachable call check &
collective call in rank branch check
as I do not consider them to be solid enough, to be included in the patch. These
will be rewritten. I'm aware that the invalid argument type check, checking for
expressions that evaluate to a non-integer type at specific indices, in some way
is redundant to the compiler warning produced by -Wfloat-conversion. My thought
about this is that it might be nice to get informed about this in context of
other MPI related bugs. Further, the -Wfloat-conversion flag seems a little bit
hidden, as it is neither included in -Wall nor in -Wextra which is why some
users might not have enabled it by default.

The patch consists of three parts: The actual code for static analysis contained
in tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/, unit tests in
tools/clang/unittests/StaticAnalyzer/MPI-Checker/ and the integration tests I
put into tools/clang/test/Analysis/MPIChecker.c.

http://reviews.llvm.org/D12761

Files:
  tools/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
  tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/Container.hpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.hpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIChecker.cpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPICheckerAST.cpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPICheckerAST.hpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPICheckerPathSensitive.cpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPICheckerPathSensitive.hpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIFunctionClassifier.cpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIFunctionClassifier.hpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPITypes.hpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/TranslationUnitVisitor.cpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/TranslationUnitVisitor.hpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/TypeVisitor.hpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/Utility.cpp
  tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/Utility.hpp
  tools/clang/test/Analysis/MPIChecker.c
  tools/clang/unittests/StaticAnalyzer/CMakeLists.txt
  tools/clang/unittests/StaticAnalyzer/MPI-Checker/CMakeLists.txt
  tools/clang/unittests/StaticAnalyzer/MPI-Checker/ContainerTest.cpp
  tools/clang/unittests/StaticAnalyzer/MPI-Checker/UtilityTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12761.34438.patch
Type: text/x-patch
Size: 108498 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150910/ac9cc1d8/attachment-0001.bin>


More information about the cfe-commits mailing list