summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-12-14 03:15:01 +0000
committerJustin Lebar <jlebar@google.com>2016-12-14 03:15:01 +0000
commitecb10f4a9af046a5bfb9094e023d122469673649 (patch)
treec461c0235ea7dc505298b7fd52d82a89b385d063 /clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
parent76a00b51f061f13b2b9b8dc0faca4f54f22b0ebb (diff)
downloadbcm5719-llvm-ecb10f4a9af046a5bfb9094e023d122469673649.tar.gz
bcm5719-llvm-ecb10f4a9af046a5bfb9094e023d122469673649.zip
[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
Diffstat (limited to 'clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp b/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
index a722ffb14aa..90255c5e2b6 100644
--- a/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp
@@ -10,11 +10,11 @@
#include "../ClangTidy.h"
#include "../ClangTidyModule.h"
#include "../ClangTidyModuleRegistry.h"
-#include "InefficientStringConcatenationCheck.h"
-
#include "FasterStringFindCheck.h"
#include "ForRangeCopyCheck.h"
#include "ImplicitCastInLoopCheck.h"
+#include "InefficientStringConcatenationCheck.h"
+#include "TypePromotionInMathFnCheck.h"
#include "UnnecessaryCopyInitialization.h"
#include "UnnecessaryValueParamCheck.h"
@@ -33,6 +33,8 @@ public:
"performance-implicit-cast-in-loop");
CheckFactories.registerCheck<InefficientStringConcatenationCheck>(
"performance-inefficient-string-concatenation");
+ CheckFactories.registerCheck<TypePromotionInMathFnCheck>(
+ "performance-type-promotion-in-math-fn");
CheckFactories.registerCheck<UnnecessaryCopyInitialization>(
"performance-unnecessary-copy-initialization");
CheckFactories.registerCheck<UnnecessaryValueParamCheck>(
OpenPOWER on IntegriCloud