[ClangTidy] Add new performance-type-promotion-in-math-fn check.
authorJustin Lebar <jlebar@google.com>
Wed, 14 Dec 2016 03:15:01 +0000 (03:15 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 14 Dec 2016 03:15:01 +0000 (03:15 +0000)
commitecb10f4a9af046a5bfb9094e023d122469673649
treec461c0235ea7dc505298b7fd52d82a89b385d063
parent76a00b51f061f13b2b9b8dc0faca4f54f22b0ebb
[ClangTidy] Add new performance-type-promotion-in-math-fn check.

Summary:
This checks for calls to double-precision math.h with single-precision
arguments.  For example, it suggests replacing ::sin(0.f) with
::sinf(0.f).

Subscribers: mgorny, cfe-commits

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

llvm-svn: 289627
clang-tools-extra/clang-tidy/performance/CMakeLists.txt
clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/docs/clang-tidy/checks/performance-type-promotion-in-math-fn.rst [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/performance-type-promotion-in-math-fn.cpp [new file with mode: 0644]