[PATCH] D68163: [analyzer][MallocChecker][NFC] Change the use of IdentifierInfo* to CallDescription

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 25 10:19:01 PST 2020


Szelethus marked an inline comment as done.
Szelethus added inline comments.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:259
   /// calls.
   bool isCalled(const CallDescription &CD) const;
 
----------------
NoQ wrote:
> 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?)
Well, the followup patch where the map is deployed uses nothing fancy. Lets wait until we actually need such a thing.

What do you mean under "calls that are never present in the code"?


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