[PATCH] D92039: [-Wcalled-once-parameter] Introduce 'called_once' attribute

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 24 00:07:05 PST 2020


NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Amazing, thank you. I'm happy with the analysis and i have nothing more to say really :)



================
Comment at: clang/lib/Analysis/CalledOnceCheck.cpp:822
+  /// calling the parameter itself, but rather uses it as the argument.
+  template <class CallLikeExpr>
+  void checkIndirectCall(const CallLikeExpr *CallOrMessage) {
----------------
vsavchenko wrote:
> NoQ wrote:
> > Did you consider `AnyCall`? That's a universal wrapper for all kinds of AST calls for exactly these cases. It's not super compile-time but it adds a lot of convenience. (Also uh-oh, its doxygen page seems to be broken). It's ok if you find it unsuitable but i kind of still want to popularize it.
> It doesn't seem to have iteration over arguments.
If you see some actual benefits and that's the only thing that's holding you back, you should add it. Or is it hard to add for whatever reason?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92039/new/

https://reviews.llvm.org/D92039



More information about the cfe-commits mailing list