[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 07:56:33 PDT 2019


Szelethus added a comment.

Its becoming a bit difficult to navigate inlines, could you please mark them as done as you address them?



================
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:61
+  using FnCheck = bool (StreamChecker::*)(const CallEvent &,
+                                          CheckerContext &) const;
+
----------------
Charusso wrote:
> I prefer `std::function`, because it is modern.
> ```
>   using StreamCheck = 
>       std::function<void(const StreamChecker *, const CallEvent &,
>                          CheckerContext &)>;
> ```
> I think it is fine with pointers, but at some point we need to modernize this.
But its also a lot more expensive. https://blog.demofox.org/2015/02/25/avoiding-the-performance-hazzards-of-stdfunction/

`std::function` is able to wrap lambdas with different captures and all sorts of things like that, which comes at a cost.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67706





More information about the cfe-commits mailing list