1c0e768dfSFangrui Song //===--- SIMDIntrinsicsCheck.h - clang-tidy----------------------*- C++ -*-===// 2c0e768dfSFangrui Song // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6c0e768dfSFangrui Song // 7c0e768dfSFangrui Song //===----------------------------------------------------------------------===// 8c0e768dfSFangrui Song 9c0e768dfSFangrui Song #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SIMD_INTRINSICS_CHECK_H 10c0e768dfSFangrui Song #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SIMD_INTRINSICS_CHECK_H 11c0e768dfSFangrui Song 12478fc5c8SAlexander Kornienko #include "../ClangTidyCheck.h" 13c0e768dfSFangrui Song 14c0e768dfSFangrui Song #include "llvm/ADT/SmallString.h" 15c0e768dfSFangrui Song 16*4718da50SCarlos Galvez namespace clang::tidy::portability { 17c0e768dfSFangrui Song 18c0e768dfSFangrui Song /// Find SIMD intrinsics calls and suggest std::experimental::simd alternatives. 19c0e768dfSFangrui Song /// 20c0e768dfSFangrui Song /// For the user-facing documentation see: 216e566bc5SRichard /// http://clang.llvm.org/extra/clang-tidy/checks/portability/simd-intrinsics.html 22c0e768dfSFangrui Song class SIMDIntrinsicsCheck : public ClangTidyCheck { 23c0e768dfSFangrui Song public: 24c0e768dfSFangrui Song SIMDIntrinsicsCheck(StringRef Name, ClangTidyContext *Context); 25c0e768dfSFangrui Song isLanguageVersionSupported(const LangOptions & LangOpts)26e40a742aSNathan James bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { 27e40a742aSNathan James return LangOpts.CPlusPlus11; 28e40a742aSNathan James } 29c0e768dfSFangrui Song void storeOptions(ClangTidyOptions::OptionMap &Opts) override; 30c0e768dfSFangrui Song void registerMatchers(ast_matchers::MatchFinder *Finder) override; 31c0e768dfSFangrui Song void check(const ast_matchers::MatchFinder::MatchResult &Result) override; 32c0e768dfSFangrui Song 33c0e768dfSFangrui Song private: 34c0e768dfSFangrui Song llvm::SmallString<32> Std; 35c0e768dfSFangrui Song const bool Suggest; 36c0e768dfSFangrui Song }; 37c0e768dfSFangrui Song 38*4718da50SCarlos Galvez } // namespace clang::tidy::portability 39c0e768dfSFangrui Song 40c0e768dfSFangrui Song #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SIMD_INTRINSICS_CHECK_H 41