clang-tools  15.0.0git
Classes | Functions
clang::tidy::mpi Namespace Reference

Classes

class  BufferDerefCheck
 This check verifies if a buffer passed to an MPI (Message Passing Interface) function is sufficiently dereferenced. More...
 
class  MPIModule
 
class  TypeMismatchCheck
 This check verifies if buffer type and MPI (Message Passing Interface) datatype pairs match. More...
 

Functions

static bool isMPITypeMatching (const std::multimap< BuiltinType::Kind, StringRef > &MultiMap, const BuiltinType::Kind Kind, StringRef MPIDatatype)
 Check if a BuiltinType::Kind matches the MPI datatype. More...
 
static bool isStandardMPIDatatype (StringRef MPIDatatype)
 Check if the MPI datatype is a standard type. More...
 
static bool isBuiltinTypeMatching (const BuiltinType *Builtin, std::string &BufferTypeName, StringRef MPIDatatype, const LangOptions &LO)
 Check if a BuiltinType matches the MPI datatype. More...
 
static bool isCComplexTypeMatching (const ComplexType *const Complex, std::string &BufferTypeName, StringRef MPIDatatype, const LangOptions &LO)
 Check if a complex float/double/long double buffer type matches the MPI datatype. More...
 
static bool isCXXComplexTypeMatching (const TemplateSpecializationType *const Template, std::string &BufferTypeName, StringRef MPIDatatype, const LangOptions &LO)
 Check if a complex<float/double/long double> templated buffer type matches the MPI datatype. More...
 
static bool isTypedefTypeMatching (const TypedefType *const Typedef, std::string &BufferTypeName, StringRef MPIDatatype)
 Check if a fixed size width buffer type matches the MPI datatype. More...
 
static const Type * argumentType (const CallExpr *const CE, const size_t Idx)
 Get the unqualified, dereferenced type of an argument. More...
 

Function Documentation

◆ argumentType()

static const Type* clang::tidy::mpi::argumentType ( const CallExpr *const  CE,
const size_t  Idx 
)
static

Get the unqualified, dereferenced type of an argument.

Parameters
CEcall expression
Idxargument index
Returns
type of the argument

Definition at line 230 of file TypeMismatchCheck.cpp.

References CE, and Type.

◆ isBuiltinTypeMatching()

static bool clang::tidy::mpi::isBuiltinTypeMatching ( const BuiltinType *  Builtin,
std::string &  BufferTypeName,
StringRef  MPIDatatype,
const LangOptions &  LO 
)
static

Check if a BuiltinType matches the MPI datatype.

Parameters
Builtinthe builtin type
BufferTypeNamebuffer type name, gets assigned
MPIDatatypename of the MPI datatype
LOlanguage options
Returns
true if the type matches

Definition at line 91 of file TypeMismatchCheck.cpp.

References isMPITypeMatching().

◆ isCComplexTypeMatching()

static bool clang::tidy::mpi::isCComplexTypeMatching ( const ComplexType *const  Complex,
std::string &  BufferTypeName,
StringRef  MPIDatatype,
const LangOptions &  LO 
)
static

Check if a complex float/double/long double buffer type matches the MPI datatype.

Parameters
Complexbuffer type
BufferTypeNamebuffer type name, gets assigned
MPIDatatypename of the MPI datatype
LOlanguage options
Returns
true if the type matches or the buffer type is unknown

Definition at line 144 of file TypeMismatchCheck.cpp.

References isMPITypeMatching().

◆ isCXXComplexTypeMatching()

static bool clang::tidy::mpi::isCXXComplexTypeMatching ( const TemplateSpecializationType *const  Template,
std::string &  BufferTypeName,
StringRef  MPIDatatype,
const LangOptions &  LO 
)
static

Check if a complex<float/double/long double> templated buffer type matches the MPI datatype.

Parameters
Templatebuffer type
BufferTypeNamebuffer type name, gets assigned
MPIDatatypename of the MPI datatype
LOlanguage options
Returns
true if the type matches or the buffer type is unknown

Definition at line 175 of file TypeMismatchCheck.cpp.

References isMPITypeMatching().

◆ isMPITypeMatching()

static bool clang::tidy::mpi::isMPITypeMatching ( const std::multimap< BuiltinType::Kind, StringRef > &  MultiMap,
const BuiltinType::Kind  Kind,
StringRef  MPIDatatype 
)
static

Check if a BuiltinType::Kind matches the MPI datatype.

Parameters
MultiMapdatatype group
Kindbuffer type kind
MPIDatatypename of the MPI datatype
Returns
true if the pair matches

Definition at line 29 of file TypeMismatchCheck.cpp.

References Kind.

Referenced by isBuiltinTypeMatching(), isCComplexTypeMatching(), and isCXXComplexTypeMatching().

◆ isStandardMPIDatatype()

static bool clang::tidy::mpi::isStandardMPIDatatype ( StringRef  MPIDatatype)
static

Check if the MPI datatype is a standard type.

Parameters
MPIDatatypename of the MPI datatype
Returns
true if the type is a standard type

Definition at line 45 of file TypeMismatchCheck.cpp.

◆ isTypedefTypeMatching()

static bool clang::tidy::mpi::isTypedefTypeMatching ( const TypedefType *const  Typedef,
std::string &  BufferTypeName,
StringRef  MPIDatatype 
)
static

Check if a fixed size width buffer type matches the MPI datatype.

Parameters
Typedefbuffer type
BufferTypeNamebuffer type name, gets assigned
MPIDatatypename of the MPI datatype
Returns
true if the type matches or the buffer type is unknown

Definition at line 206 of file TypeMismatchCheck.cpp.