steakhal added inline comments.

================
Comment at: 
clang-tools-extra/clang-tidy/bugprone/SignalInMultithreadedProgramCheck.cpp:33-50
+void SignalInMultithreadedProgramCheck::registerMatchers(MatchFinder *Finder) {
+  auto signalCall =
+      callExpr(
+          ignoringImpCasts(hasDescendant(declRefExpr(hasDeclaration(
+              functionDecl(allOf(hasName("signal"), parameterCountIs(2),
+                                 hasParameter(0, hasType(isInteger())))))))))
+          .bind("signal");
----------------
I apologize for interrupting the review.
Should we use `hasDescendant` for matching like everything in translation unit?

Wouldn't it be more performant to collect all the `signal` calls in a set and 
set a bool variable if a `ThreadList` function seen? 
At the end of the analysis of the translation unit, emit warnings for each 
recorded `signal` call if the variable was set //(aka. we are in multithreaded 
environment)//.

Treat this comment rather a question since I'm not really familiar with 
`clang-tidy`.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D75229



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to