[PATCH] D48027: [analyzer] Improve `CallDescription` to handle c++ method.

Henry Wong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 23 19:13:51 PDT 2018


MTC added a comment.

In https://reviews.llvm.org/D48027#1209844, @NoQ wrote:

> So i believe that one of the important remaining problems with `CallDescription` is to teach it to discriminate between global functions and methods. We can do it in a number of ways:
>
> 1. Make a special sub-class for `CallDescription` depending on the sort of the function (too verbose),
> 2. Tag all items in the list as "record" vs. "namespace" (too many tags),
> 3. Dunno, tons of other boring and verbose approaches,
> 4. Change our `PreCall`/`PostCall` callbacks to callback templates that let allow the user subscribe to specific sub-classes of `CallEvent` similarly to how he can subscribe to different kinds of statements in `PreStmt<Class>`/`PostStmt<Class>`, and then the user doesn't need to write any code to check it dynamically.


Personally, I prefer `4`. It is more checker developer friendly!


Repository:
  rC Clang

https://reviews.llvm.org/D48027





More information about the cfe-commits mailing list