SpuriouslyWakeUpFunctionsCheck.h 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. //===--- SpuriouslyWakeUpFunctionsCheck.h - clang-tidy ----------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SPURIOUSLYWAKEUPFUNCTIONSCHECK_H
  9. #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SPURIOUSLYWAKEUPFUNCTIONSCHECK_H
  10. #include "../ClangTidyCheck.h"
  11. namespace clang::tidy::bugprone {
  12. /// Finds ``cnd_wait``, ``cnd_timedwait``, ``wait``, ``wait_for``, or
  13. /// ``wait_until`` function calls when the function is not invoked from a loop
  14. /// that checks whether a condition predicate holds or the function has a
  15. /// condition parameter.
  16. ///
  17. /// For the user-facing documentation see:
  18. /// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/spuriously-wake-up-functions.html
  19. class SpuriouslyWakeUpFunctionsCheck : public ClangTidyCheck {
  20. public:
  21. SpuriouslyWakeUpFunctionsCheck(StringRef Name, ClangTidyContext *Context)
  22. : ClangTidyCheck(Name, Context) {}
  23. void registerMatchers(ast_matchers::MatchFinder *Finder) override;
  24. void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
  25. };
  26. } // namespace clang::tidy::bugprone
  27. #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SPURIOUSLYWAKEUPFUNCTIONSCHECK_H