clang-tools 19.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.
 
static bool isStandardMPIDatatype (StringRef MPIDatatype)
 Check if the MPI datatype is a standard type.
 
static bool isBuiltinTypeMatching (const BuiltinType *Builtin, std::string &BufferTypeName, StringRef MPIDatatype, const LangOptions &LO)
 Check if a BuiltinType matches the MPI datatype.
 
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.
 
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.
 
static bool isTypedefTypeMatching (const TypedefType *const Typedef, std::string &BufferTypeName, StringRef MPIDatatype)
 Check if a fixed size width buffer type matches the MPI datatype.
 
static const TypeargumentType (const CallExpr *const CE, const size_t Idx)
 Get the unqualified, dereferenced type of an argument.
 

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.

Referenced by clang::tidy::mpi::TypeMismatchCheck::check().

◆ 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 89 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 142 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 173 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 27 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 43 of file TypeMismatchCheck.cpp.

Referenced by clang::tidy::mpi::TypeMismatchCheck::check().

◆ 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.