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);
Differential D79425
[analyzer] StdLibraryFunctionsChecker: Add overload for adding the same summary for different names martong on May 5 2020, 8:52 AM. Authored by
Details Adding a convenience function for makeing it easier to add the same summary for functions with different names. char * strchr(const char *cs, int c); char * strrchr(const char * str, int character);
Diff Detail
Event Timeline
Comment Actions I'd prefer to have this functionality committed together its first actual use with tests. I also agree with @balazske, we should diagnose the cases when we have multiple summaries for the same function. Comment Actions Okay, at the current state we add a summary individually for each name, that makes it easier to modify a summary for each function without effecting other functions.
We already handle these cases with an assertion: auto Res = Map.insert({FD->getCanonicalDecl(), S}); assert(Res.second && "Function already has a summary set!"); (void)Res;
Comment Actions At the current state we add a summary individually for each name, that makes it easier to modify a summary for each function without effecting other functions. I'll add this functionality in the future when a real use cases comes up, if that really comes up. |
Theoretically it is possible to have a multiple names-multiple summaries case (multiple function names that have the same overloads)?