@@ -41,39 +41,39 @@ isMPITypeMatching(const std::multimap<BuiltinType::Kind, StringRef> &MultiMap,
4141// /
4242// / \returns true if the type is a standard type
4343static bool isStandardMPIDatatype (StringRef MPIDatatype) {
44- static llvm::StringSet<> AllTypes = {" MPI_C_BOOL" ,
45- " MPI_CHAR" ,
46- " MPI_SIGNED_CHAR" ,
47- " MPI_UNSIGNED_CHAR" ,
48- " MPI_WCHAR" ,
49- " MPI_INT" ,
50- " MPI_LONG" ,
51- " MPI_SHORT" ,
52- " MPI_LONG_LONG" ,
53- " MPI_LONG_LONG_INT" ,
54- " MPI_UNSIGNED" ,
55- " MPI_UNSIGNED_SHORT" ,
56- " MPI_UNSIGNED_LONG" ,
57- " MPI_UNSIGNED_LONG_LONG" ,
58- " MPI_FLOAT" ,
59- " MPI_DOUBLE" ,
60- " MPI_LONG_DOUBLE" ,
61- " MPI_C_COMPLEX" ,
62- " MPI_C_FLOAT_COMPLEX" ,
63- " MPI_C_DOUBLE_COMPLEX" ,
64- " MPI_C_LONG_DOUBLE_COMPLEX" ,
65- " MPI_INT8_T" ,
66- " MPI_INT16_T" ,
67- " MPI_INT32_T" ,
68- " MPI_INT64_T" ,
69- " MPI_UINT8_T" ,
70- " MPI_UINT16_T" ,
71- " MPI_UINT32_T" ,
72- " MPI_UINT64_T" ,
73- " MPI_CXX_BOOL" ,
74- " MPI_CXX_FLOAT_COMPLEX" ,
75- " MPI_CXX_DOUBLE_COMPLEX" ,
76- " MPI_CXX_LONG_DOUBLE_COMPLEX" };
44+ static const llvm::StringSet<> AllTypes = {" MPI_C_BOOL" ,
45+ " MPI_CHAR" ,
46+ " MPI_SIGNED_CHAR" ,
47+ " MPI_UNSIGNED_CHAR" ,
48+ " MPI_WCHAR" ,
49+ " MPI_INT" ,
50+ " MPI_LONG" ,
51+ " MPI_SHORT" ,
52+ " MPI_LONG_LONG" ,
53+ " MPI_LONG_LONG_INT" ,
54+ " MPI_UNSIGNED" ,
55+ " MPI_UNSIGNED_SHORT" ,
56+ " MPI_UNSIGNED_LONG" ,
57+ " MPI_UNSIGNED_LONG_LONG" ,
58+ " MPI_FLOAT" ,
59+ " MPI_DOUBLE" ,
60+ " MPI_LONG_DOUBLE" ,
61+ " MPI_C_COMPLEX" ,
62+ " MPI_C_FLOAT_COMPLEX" ,
63+ " MPI_C_DOUBLE_COMPLEX" ,
64+ " MPI_C_LONG_DOUBLE_COMPLEX" ,
65+ " MPI_INT8_T" ,
66+ " MPI_INT16_T" ,
67+ " MPI_INT32_T" ,
68+ " MPI_INT64_T" ,
69+ " MPI_UINT8_T" ,
70+ " MPI_UINT16_T" ,
71+ " MPI_UINT32_T" ,
72+ " MPI_UINT64_T" ,
73+ " MPI_CXX_BOOL" ,
74+ " MPI_CXX_FLOAT_COMPLEX" ,
75+ " MPI_CXX_DOUBLE_COMPLEX" ,
76+ " MPI_CXX_LONG_DOUBLE_COMPLEX" };
7777
7878 return AllTypes.contains (MPIDatatype);
7979}
@@ -90,7 +90,7 @@ static bool isBuiltinTypeMatching(const BuiltinType *Builtin,
9090 std::string &BufferTypeName,
9191 StringRef MPIDatatype,
9292 const LangOptions &LO) {
93- static std::multimap<BuiltinType::Kind, StringRef> BuiltinMatches = {
93+ static const std::multimap<BuiltinType::Kind, StringRef> BuiltinMatches = {
9494 // On some systems like PPC or ARM, 'char' is unsigned by default which is
9595 // why distinct signedness for the buffer and MPI type is tolerated.
9696 {BuiltinType::SChar, " MPI_CHAR" },
@@ -143,7 +143,7 @@ static bool isCComplexTypeMatching(const ComplexType *const Complex,
143143 std::string &BufferTypeName,
144144 StringRef MPIDatatype,
145145 const LangOptions &LO) {
146- static std::multimap<BuiltinType::Kind, StringRef> ComplexCMatches = {
146+ static const std::multimap<BuiltinType::Kind, StringRef> ComplexCMatches = {
147147 {BuiltinType::Float, " MPI_C_COMPLEX" },
148148 {BuiltinType::Float, " MPI_C_FLOAT_COMPLEX" },
149149 {BuiltinType::Double, " MPI_C_DOUBLE_COMPLEX" },
@@ -173,7 +173,7 @@ static bool
173173isCXXComplexTypeMatching (const TemplateSpecializationType *const Template,
174174 std::string &BufferTypeName, StringRef MPIDatatype,
175175 const LangOptions &LO) {
176- static std::multimap<BuiltinType::Kind, StringRef> ComplexCXXMatches = {
176+ static const std::multimap<BuiltinType::Kind, StringRef> ComplexCXXMatches = {
177177 {BuiltinType::Float, " MPI_CXX_FLOAT_COMPLEX" },
178178 {BuiltinType::Double, " MPI_CXX_DOUBLE_COMPLEX" },
179179 {BuiltinType::LongDouble, " MPI_CXX_LONG_DOUBLE_COMPLEX" }};
@@ -264,7 +264,7 @@ void TypeMismatchCheck::check(const MatchFinder::MatchResult &Result) {
264264 " MPI_IN_PLACE" )
265265 return ;
266266
267- StringRef MPIDatatype =
267+ const StringRef MPIDatatype =
268268 tooling::fixit::getText (*CE->getArg (DatatypeIdx), *Result.Context );
269269
270270 const Type *ArgType = argumentType (CE, BufferIdx);
0 commit comments