clang  6.0.0svn
MPITypes.h
Go to the documentation of this file.
1 //===-- MPITypes.h - Functionality to model MPI concepts --------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// This file provides definitions to model concepts of MPI. The mpi::Request
12 /// class defines a wrapper class, in order to make MPI requests trackable for
13 /// path-sensitive analysis.
14 ///
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_MPICHECKER_MPITYPES_H
18 #define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_MPICHECKER_MPITYPES_H
19 
22 #include "llvm/ADT/SmallSet.h"
23 
24 namespace clang {
25 namespace ento {
26 namespace mpi {
27 
28 class Request {
29 public:
30  enum State : unsigned char { Nonblocking, Wait };
31 
33 
34  void Profile(llvm::FoldingSetNodeID &Id) const {
35  Id.AddInteger(CurrentState);
36  }
37 
38  bool operator==(const Request &ToCompare) const {
39  return CurrentState == ToCompare.CurrentState;
40  }
41 
43 };
44 
45 // The RequestMap stores MPI requests which are identified by their memory
46 // region. Requests are used in MPI to complete nonblocking operations with wait
47 // operations. A custom map implementation is used, in order to make it
48 // available in an arbitrary amount of translation units.
49 struct RequestMap {};
53 
54 } // end of namespace: mpi
55 
56 template <>
57 struct ProgramStateTrait<mpi::RequestMap>
58  : public ProgramStatePartialTrait<mpi::RequestMapImpl> {
59  static void *GDMIndex() {
60  static int index = 0;
61  return &index;
62  }
63 };
64 
65 } // end of namespace: ento
66 } // end of namespace: clang
67 #endif
MemRegion - The root abstract class for all memory regions.
Definition: MemRegion.h:79
llvm::ImmutableMap< const clang::ento::MemRegion *, clang::ento::mpi::Request > RequestMapImpl
Definition: MPITypes.h:52
int Id
Definition: ASTDiff.cpp:191
const State CurrentState
Definition: MPITypes.h:42
bool operator==(const Request &ToCompare) const
Definition: MPITypes.h:38
This file defines functionality to identify and classify MPI functions.
void Profile(llvm::FoldingSetNodeID &Id) const
Definition: MPITypes.h:34
Dataflow Directional Tag Classes.