[all-commits] [llvm/llvm-project] 0f4c70: [clang-tidy] Add spuriously-wake-up-functions check

Kocsis Ábel via All-commits all-commits at lists.llvm.org
Sat Mar 21 04:04:39 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f4c70dd3ec6d7ee831f868e3e483273daec18f0
      https://github.com/llvm/llvm-project/commit/0f4c70dd3ec6d7ee831f868e3e483273daec18f0
  Author: abelkocsis <kocsis.abel.98 at gmail.com>
  Date:   2020-03-21 (Sat, 21 Mar 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
    M clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
    A clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.cpp
    A clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h
    M clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    A clang-tools-extra/docs/clang-tidy/checks/bugprone-spuriously-wake-up-functions.rst
    A clang-tools-extra/docs/clang-tidy/checks/cert-con36-c.rst
    A clang-tools-extra/docs/clang-tidy/checks/cert-con54-cpp.rst
    M clang-tools-extra/docs/clang-tidy/checks/list.rst
    A clang-tools-extra/test/clang-tidy/checkers/bugprone-spuriously-wake-up-functions.c
    A clang-tools-extra/test/clang-tidy/checkers/bugprone-spuriously-wake-up-functions.cpp

  Log Message:
  -----------
  [clang-tidy] Add spuriously-wake-up-functions check

Summary:
According to
https://wiki.sei.cmu.edu/confluence/display/cplusplus/CON54-CPP.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop
and
https://wiki.sei.cmu.edu/confluence/display/c/CON36-C.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop
misc-spuriously-wake-up-functions check is created. The check finds
`cnd_wait` or `wait` function calls in an `IfStmt` and  warns the user to
replace it with a `WhileStmt` or use it with a lambda parameter.

Reviewers: aaron.ballman, alexfh, hokein, jfb, Charusso

Reviewed By: aaron.ballman

Subscribers: sylvestre.ledru, whisperity, Eugene.Zelenko, mgorny, dexonsmith, cfe-commits, gerazo, xazax.hun, steakhal, Charusso

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D70876




More information about the All-commits mailing list