From c0e768df9050133466695f3a8f3bf0b3bb343987 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 7 Mar 2018 16:57:42 +0000 Subject: [clang-tidy] Add "portability" module and rename readability-simd-intrinsics to portability-simd-intrinsics Reviewers: alexfh Subscribers: klimek, nemanjai, mgorny, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D44173 llvm-svn: 326909 --- .../portability/PortabilityTidyModule.cpp | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp (limited to 'clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp') diff --git a/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp b/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp new file mode 100644 index 00000000000..013cbcfeae9 --- /dev/null +++ b/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp @@ -0,0 +1,38 @@ +//===--- PortabilityTidyModule.cpp - clang-tidy ---------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "../ClangTidy.h" +#include "../ClangTidyModule.h" +#include "../ClangTidyModuleRegistry.h" +#include "SIMDIntrinsicsCheck.h" + +namespace clang { +namespace tidy { +namespace portability { + +class PortabilityModule : public ClangTidyModule { +public: + void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { + CheckFactories.registerCheck( + "portability-simd-intrinsics"); + } +}; + +// Register the PortabilityModule using this statically initialized variable. +static ClangTidyModuleRegistry::Add + X("portability-module", "Adds portability-related checks."); + +} // namespace portability + +// This anchor is used to force the linker to link in the generated object file +// and thus register the PortabilityModule. +volatile int PortabilityModuleAnchorSource = 0; + +} // namespace tidy +} // namespace clang -- cgit v1.2.3