abelkocsis updated this revision to Diff 235180.
abelkocsis added a comment.

Checker is moved to bugprone section, tests added. C checker is improved, and 
documentations are synchronised.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D70876

Files:
  clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
  clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
  clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h
  clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  
clang-tools-extra/docs/clang-tidy/checks/bugprone-spuriously-wake-up-functions.rst
  clang-tools-extra/docs/clang-tidy/checks/cert-con36-c.rst
  clang-tools-extra/docs/clang-tidy/checks/cert-con54-cpp.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  
clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/chrono.h
  
clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/condition_variable.h
  
clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/cstdint.h
  
clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/mutex.h
  
clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/ratio.h
  clang-tools-extra/test/clang-tidy/bugprone-spuriously-wake-up-functions.cpp

Index: clang-tools-extra/test/clang-tidy/bugprone-spuriously-wake-up-functions.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/bugprone-spuriously-wake-up-functions.cpp
@@ -0,0 +1,79 @@
+// RUN: %check_clang_tidy %s bugprone-spuriously-wake-up-functions %t -- -- -I %S/Inputs/bugprone-spuriously-wake-up-functions/
+#include "condition_variable.h"
+#define NULL 0
+
+struct Node1 {
+  void *Node1;
+  struct Node1 *next;
+};
+
+static Node1 list;
+static std::mutex m;
+static std::condition_variable condition;
+
+void consume_list_element(std::condition_variable &condition) {
+  std::unique_lock<std::mutex> lk(m);
+
+  if (list.next == nullptr) {
+    condition.wait(lk);
+    // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: 'wait' should be placed inside a while statement or used with a condition parameter [bugprone-spuriously-wake-up-functions]
+  }
+
+  while (list.next == nullptr) {
+    condition.wait(lk);
+  }
+
+  if (list.next == nullptr) {
+    while (list.next == nullptr) {
+      condition.wait(lk);
+    }
+  }
+  using durtype = std::chrono::duration<int, std::milli>;
+  durtype dur = std::chrono::duration<int, std::milli>();
+  if (list.next == nullptr) {
+    condition.wait_for(lk, dur);
+    // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: 'wait_for' should be placed inside a while statement or used with a condition parameter [bugprone-spuriously-wake-up-functions]
+  }
+  if (list.next == nullptr) {
+    condition.wait_for(lk, dur, [] { return 1; });
+  }
+  auto now = std::chrono::system_clock::now();
+  if (list.next == nullptr) {
+    condition.wait_until(lk, now);
+    // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: 'wait_until' should be placed inside a while statement or used with a condition parameter [bugprone-spuriously-wake-up-functions]
+  }
+  if (list.next == nullptr) {
+    condition.wait_until(lk, now, [] { return 1; });
+  }
+}
+
+typedef struct mtx_t {
+} mtx_t;
+typedef struct cnd_t {
+} cnd_t;
+
+int cnd_wait(cnd_t *cond, mtx_t *mutex){};
+
+struct Node1 list_c;
+static mtx_t lock;
+static cnd_t condition_c;
+
+void consume_list_element(void) {
+
+  if (list_c.next == NULL) {
+    if (0 != cnd_wait(&condition_c, &lock)) {
+      // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: 'cnd_wait' should be placed inside a while statement [bugprone-spuriously-wake-up-functions]
+    }
+  }
+  while (list_c.next == NULL) {
+    if (0 != cnd_wait(&condition_c, &lock)) {
+    }
+  }
+  if (list_c.next == NULL) {
+    cnd_wait(&condition_c, &lock);
+    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: 'cnd_wait' should be placed inside a while statement [bugprone-spuriously-wake-up-functions]
+  }
+  while (list.next == NULL) {
+    cnd_wait(&condition_c, &lock);
+  }
+}
Index: clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/ratio.h
===================================================================
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/ratio.h
@@ -0,0 +1,28 @@
+#include "cstdint.h"
+
+namespace std {
+
+template <intmax_t N, intmax_t D = 1>
+class ratio {
+public:
+  static constexpr intmax_t num = 0;
+  static constexpr intmax_t den = 0;
+  typedef ratio<num, den> type;
+};
+
+template <class R1, class R2>
+struct ratio_equal;
+template <class R1, class R2>
+struct ratio_not_equal;
+template <class R1, class R2>
+struct ratio_less;
+template <class R1, class R2>
+struct ratio_less_equal;
+template <class R1, class R2>
+struct ratio_greater;
+template <class R1, class R2>
+struct ratio_greater_equal;
+
+typedef ratio<1, 1000> milli;
+
+} // namespace std
\ No newline at end of file
Index: clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/mutex.h
===================================================================
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/mutex.h
@@ -0,0 +1,19 @@
+namespace std {
+class mutex;
+template <class Mutex>
+class unique_lock {
+public:
+  typedef Mutex mutex_type;
+
+  unique_lock() noexcept;
+  explicit unique_lock(mutex_type &m);
+};
+
+class mutex {
+public:
+  constexpr mutex() noexcept;
+  ~mutex();
+  mutex(const mutex &) = delete;
+  mutex &operator=(const mutex &) = delete;
+};
+} // namespace std
\ No newline at end of file
Index: clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/cstdint.h
===================================================================
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/cstdint.h
@@ -0,0 +1,3 @@
+namespace std {
+using intmax_t = int;
+}
\ No newline at end of file
Index: clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/condition_variable.h
===================================================================
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/condition_variable.h
@@ -0,0 +1,40 @@
+#include "chrono.h"
+#include "mutex.h"
+
+namespace std {
+
+enum class cv_status {
+  no_timeout,
+  timeout
+};
+
+class condition_variable {
+public:
+  condition_variable();
+  ~condition_variable();
+  condition_variable(const condition_variable &) = delete;
+  condition_variable &operator=(const condition_variable &) = delete;
+
+  void notify_one() noexcept;
+  void notify_all() noexcept;
+  void wait(unique_lock<mutex> &lock);
+  template <class Predicate>
+  void wait(unique_lock<mutex> &lock, Predicate pred);
+  template <class Clock, class Duration>
+  cv_status wait_until(unique_lock<mutex> &lock,
+                       const chrono::time_point<Clock, Duration> &abs_time){};
+  template <class Clock, class Duration, class Predicate>
+  bool wait_until(unique_lock<mutex> &lock,
+                  const chrono::time_point<Clock, Duration> &abs_time,
+                  Predicate pred){};
+  template <class Rep, class Period>
+  cv_status wait_for(unique_lock<mutex> &lock,
+                     const chrono::duration<Rep, Period> &rel_time){};
+  template <class Rep, class Period, class Predicate>
+  bool wait_for(unique_lock<mutex> &lock,
+                const chrono::duration<Rep, Period> &rel_time,
+                Predicate pred){};
+};
+class condition_variable_any;
+
+} // namespace std
\ No newline at end of file
Index: clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/chrono.h
===================================================================
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/Inputs/bugprone-spuriously-wake-up-functions/chrono.h
@@ -0,0 +1,48 @@
+#include "ratio.h"
+
+namespace std {
+namespace chrono {
+
+template <class Rep, class Period = ratio<1>>
+class duration {
+public:
+  using rep = Rep;
+  using period = Period;
+
+public:
+  constexpr duration() = default;
+  template <class Rep2>
+  constexpr explicit duration(const Rep2 &r);
+  template <class Rep2, class Period2>
+  constexpr duration(const duration<Rep2, Period2> &d);
+  ~duration() = default;
+  duration(const duration &) = default;
+};
+
+template <class Clock, class Duration = typename Clock::duration>
+class time_point {
+public:
+  using clock = Clock;
+  using duration = Duration;
+
+public:
+  constexpr time_point();
+  constexpr explicit time_point(const duration &d);
+  template <class Duration2>
+  constexpr time_point(const time_point<clock, Duration2> &t);
+};
+
+using milliseconds = duration<int, milli>;
+
+class system_clock {
+public:
+  typedef milliseconds duration;
+  typedef duration::rep rep;
+  typedef duration::period period;
+  typedef chrono::time_point<system_clock> time_point;
+
+  static time_point now() noexcept;
+};
+} // namespace chrono
+
+} // namespace std
\ No newline at end of file
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===================================================================
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -72,6 +72,7 @@
    `bugprone-posix-return <bugprone-posix-return.html>`_, "Yes", ""
    `bugprone-sizeof-container <bugprone-sizeof-container.html>`_, , "high"
    `bugprone-sizeof-expression <bugprone-sizeof-expression.html>`_, , "high"
+   `bugprone-spuriously-wake-up-functions <bugprone-spuriously-wake-up-functions.html>`_, , ""
    `bugprone-string-constructor <bugprone-string-constructor.html>`_, "Yes", "high"
    `bugprone-string-integer-assignment <bugprone-string-integer-assignment.html>`_, "Yes", "low"
    `bugprone-string-literal-with-embedded-nul <bugprone-string-literal-with-embedded-nul.html>`_, , "medium"
@@ -91,6 +92,8 @@
    `bugprone-unused-return-value <bugprone-unused-return-value.html>`_, , "medium"
    `bugprone-use-after-move <bugprone-use-after-move.html>`_, , "high"
    `bugprone-virtual-near-miss <bugprone-virtual-near-miss.html>`_, "Yes", "medium"
+   `cert-con36-c <cert-con36-c.html>`_, , ""
+   `cert-con54-cpp <cert-con54-cpp.html>`_, , ""
    `cert-dcl21-cpp <cert-dcl21-cpp.html>`_, , "low"
    `cert-dcl50-cpp <cert-dcl50-cpp.html>`_, , "low"
    `cert-dcl58-cpp <cert-dcl58-cpp.html>`_, , "high"
Index: clang-tools-extra/docs/clang-tidy/checks/cert-con54-cpp.rst
===================================================================
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/cert-con54-cpp.rst
@@ -0,0 +1,10 @@
+.. title:: clang-tidy - cert-con54-cpp
+.. meta::
+:http-equiv=refresh: 5;URL=bugprone-spuriously-wake-up-functions.html
+	
+cert-con54-cpp
+==============
+
+The cert-con54-cpp check is an alias, please see
+`bugprone-spuriously-wake-up-functions <bugprone-spuriously-wake-up-functions.html>`_ 
+for more information.
Index: clang-tools-extra/docs/clang-tidy/checks/cert-con36-c.rst
===================================================================
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/cert-con36-c.rst
@@ -0,0 +1,10 @@
+.. title:: clang-tidy - cert-con36-c
+.. meta::
+:http-equiv=refresh: 5;URL=bugprone-spuriously-wake-up-functions.html
+	
+cert-con36-c
+============
+
+The cert-con36-c check is an alias, please see
+`bugprone-spuriously-wake-up-functions <bugprone-spuriously-wake-up-functions.html>`_ 
+for more information.
Index: clang-tools-extra/docs/clang-tidy/checks/bugprone-spuriously-wake-up-functions.rst
===================================================================
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/bugprone-spuriously-wake-up-functions.rst
@@ -0,0 +1,28 @@
+.. title:: clang-tidy - bugprone-spuriously-wake-up-functions
+
+bugprone-spuriously-wake-up-functions
+=================================
+
+Finds ``cnd_wait``, ``wait``, ``wait_for``, or ``wait_until`` function calls
+when the function is not invoked from a loop that checks whether a condition
+predicate holds or the function has a condition parameter.
+
+.. code-block: c++
+
+    if (condition_predicate) {
+        condition.wait(lk);
+    }
+
+.. code-block: c
+
+    if (condition_predicate) {
+        if (thrd_success != cnd_wait(&condition, &lock)) {
+        }
+    }
+
+This check corresponds to the CERT C++ Coding Standard rule
+`CON54-CPP. Wrap functions that can spuriously wake up in a loop
+<https://wiki.sei.cmu.edu/confluence/display/cplusplus/CON54-CPP.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop>`_.
+and CERT C Coding Standard rule
+`CON36-C. Wrap functions that can spuriously wake up in a loop
+<https://wiki.sei.cmu.edu/confluence/display/c/CON36-C.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop>`_.
Index: clang-tools-extra/docs/ReleaseNotes.rst
===================================================================
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -94,6 +94,13 @@
   Without the null terminator it can result in undefined behaviour when the
   string is read.
 
+- New :doc:`bugprone-spuriously-wake-up-functions
+  <clang-tidy/checks/bugprone-spuriously-wake-up-functions>` check.
+
+  Finds ``cnd_wait``, ``wait``, ``wait_for``, or ``wait_until`` function calls
+  when the function is not invoked from a loop that checks whether a condition
+  predicate holds or the function has a condition parameter.
+
 - New :doc:`cert-mem57-cpp
   <clang-tidy/checks/cert-mem57-cpp>` check.
 
@@ -216,6 +223,16 @@
   added to address situations where the existing fix-it logic would sometimes generate
   code that no longer compiles.
 
+- New alias :doc:`cert-con36-c
+  <clang-tidy/checks/cert-con36-c>` to
+  :doc:`bugprone-spuriously-wake-up-functions
+  <clang-tidy/checks/bugprone-spuriously-wake-up-functions>` was added.
+
+- New alias :doc:`cert-con54-cpp
+  <clang-tidy/checks/cert-con54-cpp>` to
+  :doc:`bugprone-spuriously-wake-up-functions
+  <clang-tidy/checks/bugprone-spuriously-wake-up-functions>` was added.
+
 Improvements to include-fixer
 -----------------------------
 
Index: clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
===================================================================
--- clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
+++ clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
@@ -11,6 +11,7 @@
 #include "../ClangTidyModuleRegistry.h"
 #include "../bugprone/UnhandledSelfAssignmentCheck.h"
 #include "../bugprone/BadSignalToKillThreadCheck.h"
+#include "../bugprone/SpuriouslyWakeUpFunctionsCheck.h"
 #include "../google/UnnamedNamespaceInHeaderCheck.h"
 #include "../misc/NewDeleteOverloadsCheck.h"
 #include "../misc/NonCopyableObjects.h"
@@ -40,6 +41,9 @@
 public:
   void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
     // C++ checkers
+    // CON
+    CheckFactories.registerCheck<bugprone::SpuriouslyWakeUpFunctionsCheck>(
+        "cert-con54-cpp");
     // DCL
     CheckFactories.registerCheck<PostfixOperatorCheck>(
         "cert-dcl21-cpp");
@@ -74,6 +78,9 @@
         "cert-oop58-cpp");
 
     // C checkers
+    // CON
+    CheckFactories.registerCheck<bugprone::SpuriouslyWakeUpFunctionsCheck>(
+        "cert-con36-c");
     // DCL
     CheckFactories.registerCheck<misc::StaticAssertCheck>("cert-dcl03-c");
     CheckFactories.registerCheck<readability::UppercaseLiteralSuffixCheck>(
Index: clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h
===================================================================
--- /dev/null
+++ clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h
@@ -0,0 +1,36 @@
+//===--- SpuriouslyWakeUpFunctionsCheck.h - clang-tidy ----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SPURIOUSLYWAKEUPFUNCTIONSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SPURIOUSLYWAKEUPFUNCTIONSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds ``cnd_wait``, ``wait``, ``wait_for``, or ``wait_until`` function 
+/// calls when the function is not invoked from a loop that checks whether a 
+/// condition predicate holds or the function has a condition parameter.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-spuriously-wake-up-functions.html
+class SpuriouslyWakeUpFunctionsCheck : public ClangTidyCheck {
+public:
+  SpuriouslyWakeUpFunctionsCheck(StringRef Name, ClangTidyContext *Context)
+      : ClangTidyCheck(Name, Context) {}
+  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SPURIOUSLYWAKEUPFUNCTIONSCHECK_H
Index: clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.cpp
@@ -0,0 +1,84 @@
+//===--- SpuriouslyWakeUpFunctionsCheck.cpp - clang-tidy ------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "SpuriouslyWakeUpFunctionsCheck.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+
+using namespace clang::ast_matchers;
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+void SpuriouslyWakeUpFunctionsCheck::registerMatchers(MatchFinder *Finder) {
+
+  auto hasUniqueLock = hasDescendant(declRefExpr(hasDeclaration(
+      varDecl(hasType(asString("std::unique_lock<std::mutex>"))))));
+
+  auto hasWaitDescendantCPP = hasDescendant(
+      cxxMemberCallExpr(
+          anyOf(allOf(hasDescendant(memberExpr(hasDeclaration(functionDecl(
+                          allOf(hasName("std::condition_variable::wait"),
+                                parameterCountIs(1)))))),
+                      onImplicitObjectArgument(declRefExpr(to(varDecl(
+                          hasType(asString("std::condition_variable &")))))),
+                      hasUniqueLock),
+                allOf(hasDescendant(memberExpr(hasDeclaration(functionDecl(
+                          allOf(hasName("std::condition_variable::wait_for"),
+                                parameterCountIs(2)))))),
+                      onImplicitObjectArgument(declRefExpr(to(varDecl(
+                          hasType(asString("std::condition_variable &")))))),
+                      hasUniqueLock),
+                allOf(hasDescendant(memberExpr(hasDeclaration(functionDecl(
+                          allOf(hasName("std::condition_variable::wait_until"),
+                                parameterCountIs(2)))))),
+                      onImplicitObjectArgument(declRefExpr(to(varDecl(
+                          hasType(asString("std::condition_variable &")))))),
+                      hasUniqueLock)
+
+                    ))
+          .bind("wait"));
+
+  auto hasWaitDescendantC = hasDescendant(
+      callExpr(callee(functionDecl(hasName("cnd_wait")))).bind("wait"));
+  Finder->addMatcher(
+      ifStmt(anyOf(
+          // Check for `CON54-CPP`
+          allOf(hasWaitDescendantCPP,
+                unless(anyOf(hasDescendant(ifStmt(hasWaitDescendantCPP)),
+                             hasDescendant(whileStmt(hasWaitDescendantCPP)),
+                             hasDescendant(forStmt(hasWaitDescendantCPP)),
+                             hasDescendant(doStmt(hasWaitDescendantCPP))))),
+          // Check for `CON36-C`
+          hasDescendant(compoundStmt(allOf(
+              hasWaitDescendantC,
+              unless(anyOf(hasDescendant(ifStmt(hasDescendant(
+                               compoundStmt(hasWaitDescendantC)))),
+                           hasDescendant(whileStmt(hasWaitDescendantC)),
+                           hasDescendant(forStmt(hasWaitDescendantC)),
+                           hasDescendant(doStmt(hasWaitDescendantC))))))))),
+      this);
+}
+
+void SpuriouslyWakeUpFunctionsCheck::check(
+    const MatchFinder::MatchResult &Result) {
+  const auto *MatchedWait = Result.Nodes.getNodeAs<CallExpr>("wait");
+  SmallString<128> Buffer;
+  llvm::raw_svector_ostream Str(Buffer);
+  Str << "'%0' should be placed inside a while statement";
+  if (MatchedWait->getDirectCallee()->getName() != "cnd_wait")
+    Str << " or used with a condition parameter";
+  diag(MatchedWait->getExprLoc(), Str.str().str()
+
+           )
+      << MatchedWait->getDirectCallee()->getName();
+}
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
Index: clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
+++ clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
@@ -30,6 +30,7 @@
   PosixReturnCheck.cpp
   SizeofContainerCheck.cpp
   SizeofExpressionCheck.cpp
+  SpuriouslyWakeUpFunctionsCheck.cpp
   StringConstructorCheck.cpp
   StringIntegerAssignmentCheck.cpp
   StringLiteralWithEmbeddedNulCheck.cpp
Index: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
+++ clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
@@ -38,6 +38,7 @@
 #include "PosixReturnCheck.h"
 #include "SizeofContainerCheck.h"
 #include "SizeofExpressionCheck.h"
+#include "SpuriouslyWakeUpFunctionsCheck.h"
 #include "StringConstructorCheck.h"
 #include "StringIntegerAssignmentCheck.h"
 #include "StringLiteralWithEmbeddedNulCheck.h"
@@ -123,6 +124,8 @@
         "bugprone-sizeof-container");
     CheckFactories.registerCheck<SizeofExpressionCheck>(
         "bugprone-sizeof-expression");
+    CheckFactories.registerCheck<SpuriouslyWakeUpFunctionsCheck>(
+        "bugprone-spuriously-wake-up-functions");
     CheckFactories.registerCheck<StringConstructorCheck>(
         "bugprone-string-constructor");
     CheckFactories.registerCheck<StringIntegerAssignmentCheck>(
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to