martong created this revision. martong added reviewers: Szelethus, NoQ, baloghadamsoftware, balazske, steakhal. Herald added subscribers: cfe-commits, ASDenysPetrov, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity. Herald added a project: clang.
Adding a convenience function for makeing it easier to add the same summary for functions with different names. E.g. we are going to use the same summary for char * strchr(const char *cs, int c); char * strrchr(const char * str, int character); Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D79425 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp Index: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp @@ -665,6 +665,11 @@ for (const Summary &S : Summaries) operator()(Name, S); } + // Add the same summary for different names. + void operator()(std::vector<StringRef> Names, Summary S) { + for (StringRef Name : Names) + operator()(Name, S); + } } addToFunctionSummaryMap(ACtx, FunctionSummaryMap); // We are finally ready to define specifications for all supported functions.
Index: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp @@ -665,6 +665,11 @@ for (const Summary &S : Summaries) operator()(Name, S); } + // Add the same summary for different names. + void operator()(std::vector<StringRef> Names, Summary S) { + for (StringRef Name : Names) + operator()(Name, S); + } } addToFunctionSummaryMap(ACtx, FunctionSummaryMap); // We are finally ready to define specifications for all supported functions.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits