clang-tools 8.0.0

SIMDIntrinsicsCheck.h
Go to the documentation of this file.
1 //===--- SIMDIntrinsicsCheck.h - clang-tidy----------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SIMD_INTRINSICS_CHECK_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SIMD_INTRINSICS_CHECK_H
12
13 #include "../ClangTidy.h"
14
15 #include "llvm/ADT/SmallString.h"
16
17 namespace clang {
18 namespace tidy {
19 namespace portability {
20
21 /// Find SIMD intrinsics calls and suggest std::experimental::simd alternatives.
22 ///
23 /// For the user-facing documentation see:
24 /// http://clang.llvm.org/extra/clang-tidy/checks/portability-simd-intrinsics.html
25 class SIMDIntrinsicsCheck : public ClangTidyCheck {
26 public:
27 SIMDIntrinsicsCheck(StringRef Name, ClangTidyContext *Context);
28
29 void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
30 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
31 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
32
33 private:
34 llvm::SmallString<32> Std;
35 const bool Suggest;
36 };
37
38 } // namespace portability
39 } // namespace tidy
40 } // namespace clang
41
42 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SIMD_INTRINSICS_CHECK_H
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
clang::tidy::portability::SIMDIntrinsicsCheck::SIMDIntrinsicsCheck
SIMDIntrinsicsCheck(StringRef Name, ClangTidyContext *Context)
Definition: SIMDIntrinsicsCheck.cpp:85
clang::tidy::portability::SIMDIntrinsicsCheck
Find SIMD intrinsics calls and suggest std::experimental::simd alternatives.
Definition: SIMDIntrinsicsCheck.h:25
Name
static constexpr llvm::StringLiteral Name
Definition: UppercaseLiteralSuffixCheck.cpp:28
clang::tidy::ClangTidyOptions::OptionMap
std::map< std::string, std::string > OptionMap
Definition: ClangTidyOptions.h:98
Result
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
Definition: ClangdServer.cpp:60
clang::tidy::portability::SIMDIntrinsicsCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Definition: SIMDIntrinsicsCheck.cpp:95
clang::tidy::portability::SIMDIntrinsicsCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition: SIMDIntrinsicsCheck.cpp:111
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ChangeNamespace.cpp:18
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition: ClangTidyDiagnosticConsumer.h:100
clang::tidy::portability::SIMDIntrinsicsCheck::storeOptions
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
Definition: SIMDIntrinsicsCheck.cpp:90