[PATCH] D68163: [analyzer][MallocChecker][NFC] Change the use of IdentifierInfo* to CallDescription
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 25 07:26:22 PST 2020
NoQ added inline comments.
================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:259
/// calls.
bool isCalled(const CallDescription &CD) const;
----------------
Szelethus wrote:
> Szelethus wrote:
> > NoQ wrote:
> > > I don't fully understand how does overload resolution work in this case, maybe rename the original function?
> > Well, `isCalled` may now have an arbitrary number of arguments. The single argument version is this function, and the //n//-argument ones call this //n// times: `isCalled(A, B, C)` -> `isCalled(A) || isCalled(B) || isCalled(B)`. I guess I could rename the other one to `isAnyCalled`, but I think its fine.
> But that would be super ugly imo :/ I think the current implementation is intuitive enough, but I'm happy to change it if you disagree.
Ok, so, maybe in such cases we should add a flag to our `CallDescriptionMap` and then write code like
```lang=c++
if (CDM.lookup(Call)->hasFlag) {
...
}
```
?
(or, maybe, make a separate map if these calls are never present in the rest of the code... do we want `CallDescriptionSet` for this purpose?)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68163/new/
https://reviews.llvm.org/D68163
More information about the cfe-commits
mailing list