[PATCH] D83717: [clang-tidy] Add check fo SEI CERT item ENV32-C

Endre Fülöp via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 05:55:01 PDT 2020


gamesh411 marked 10 inline comments as done.
gamesh411 added a comment.

Thanks @njames93 :) I have extended the check with notes, but I have to figure out how to appease file-check, so its still WIP until I do.



================
Comment at: clang-tools-extra/clang-tidy/cert/ExitHandlerCheck.cpp:72
+void ExitHandlerCheck::registerMatchers(MatchFinder *Finder) {
+  // clang-format off
+  Finder->addMatcher(
----------------
njames93 wrote:
> Is there a reason  for disabling format here? How messy is the matcher code when formatted?
It is not that bad after all. Especially with the `hasAnyName` predicate.


================
Comment at: clang-tools-extra/clang-tidy/cert/ExitHandlerCheck.cpp:120-122
+    if (SeenFunctions.count(Current))
+      continue;
+    SeenFunctions.insert(Current);
----------------
njames93 wrote:
> nit:
> ```
> if (!SeenFunctions.insert(Current).second)
>   continue;
> ```
Neat!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83717





More information about the llvm-commits mailing list