| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | #ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_MPICHECKER_MPITYPES_H |
| 17 | #define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_MPICHECKER_MPITYPES_H |
| 18 | |
| 19 | #include "clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h" |
| 20 | #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" |
| 21 | #include "llvm/ADT/SmallSet.h" |
| 22 | |
| 23 | namespace clang { |
| 24 | namespace ento { |
| 25 | namespace mpi { |
| 26 | |
| 27 | class Request { |
| 28 | public: |
| 29 | enum State : unsigned char { Nonblocking, Wait }; |
| 30 | |
| 31 | Request(State S) : CurrentState{S} {} |
| 32 | |
| 33 | void Profile(llvm::FoldingSetNodeID &Id) const { |
| 34 | Id.AddInteger(CurrentState); |
| 35 | } |
| 36 | |
| 37 | bool operator==(const Request &ToCompare) const { |
| 38 | return CurrentState == ToCompare.CurrentState; |
| 39 | } |
| 40 | |
| 41 | const State CurrentState; |
| 42 | }; |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | struct RequestMap {}; |
| 49 | typedef llvm::ImmutableMap<const clang::ento::MemRegion *, |
| 50 | clang::ento::mpi::Request> |
| 51 | RequestMapImpl; |
| 52 | |
| 53 | } |
| 54 | |
| 55 | template <> |
| 56 | struct ProgramStateTrait<mpi::RequestMap> |
| 57 | : public ProgramStatePartialTrait<mpi::RequestMapImpl> { |
| 58 | static void *GDMIndex() { |
| 59 | static int index = 0; |
| 60 | return &index; |
| 61 | } |
| 62 | }; |
| 63 | |
| 64 | } |
| 65 | } |
| 66 | #endif |
| 67 | |