[PATCH] D72035: [analyzer][NFC] Use CallEvent checker callback in GenericTaintChecker

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 24 07:35:45 PST 2020


Szelethus accepted this revision.
Szelethus added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: martong.

Wow. Its a joy to see you do C++. LGTM. Are you planning to introduce `CallDescriptionMap` at one point? :)



================
Comment at: clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp:492-509
+    const auto OneOf = [FDecl](const auto &... Name) {
+      // FIXME: use fold expression in C++17
+      using unused = int[];
+      bool ret = false;
+      static_cast<void>(unused{
+          0, (ret |= CheckerContext::isCLibraryFunction(FDecl, Name), 0)...});
+      return ret;
----------------
Whoa, this is amazing, but looks like a google interview question or something -- is this a technique I should know about it? I feel like we kinda sacrificed readability for coolness.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72035





More information about the cfe-commits mailing list