Sometimes we only want to decide if some function is called, and we
don't care which of the set.
This CallDescriptionSet will have the same behavior, except
instead of lookup() returning a pointer to the mapped value,
the contains() returns bool.
Internally, it uses the CallDescriptionMap<bool> for implementing the
behavior. It is preferred, to reuse the generic
CallDescriptionMap::lookup() logic, instead of duplicating it.
The generic version might be improved by implementing a hash lookup or
something along those lines.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I was thinking about that perhaps a higher level of abstraction would be useful.
Something like.
auto FM = FunctionMatcher{"foo", "bar"}; //.... if (FM.matches(CallEvent)) //...
using FunctionMatcher = CallDescriptionMap<void>;
?
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h | ||
---|---|---|
123 | Could you please add some documentation that this could be used if the user only want to decide if some function is called/matched? |
Comment Actions
I don't know. I don't really want to introduce yet another entity. They do the same basically. You can convince me though.
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h | ||
---|---|---|
123 | Great point! I'll. |
Comment Actions
I recognize the problem, but don't agree with the solution: this is a CallDescriptionSet at this point, not a CallDescriptionMap. Also, I just don't think this is the place to use template specialization, nor do I think we should keep the function name lookup, if we only care about whether the call is in the set or not.
Comment Actions
- define the CallDescriptionSet class, by wrapping a CallDescriptionMap
- add doc comments about the class
Could you please add some documentation that this could be used if the user only want to decide if some function is called/matched?