clang-tools 3.8.0

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

IntegerTypesCheck.h
Go to the documentation of this file.
1 //===--- IntegerTypesCheck.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_GOOGLE_INTEGERTYPESCHECK_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_INTEGERTYPESCHECK_H
12
13 #include "../ClangTidy.h"
14
15 namespace clang {
16 namespace tidy {
17 namespace google {
18 namespace runtime {
19
20 /// Finds uses of `short`, `long` and `long long` and suggest replacing them
21 /// with `u?intXX(_t)?`.
22 ///
23 /// Correspondig cpplint.py check: 'runtime/int'.
24 class IntegerTypesCheck : public ClangTidyCheck {
25 public:
26 IntegerTypesCheck(StringRef Name, ClangTidyContext *Context);
27 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
28 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
29 void storeOptions(ClangTidyOptions::OptionMap &Options) override;
30
31 private:
32 const std::string UnsignedTypePrefix;
33 const std::string SignedTypePrefix;
34 const std::string TypeSuffix;
35 };
36
37 } // namespace runtime
38 } // namespace google
39 } // namespace tidy
40 } // namespace clang
41
42 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_INTEGERTYPESCHECK_H
Name
StringHandle Name
Definition: PreprocessorTracker.cpp:525
Finder
std::unique_ptr< ast_matchers::MatchFinder > Finder
Definition: ClangTidy.cpp:188
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition: ClangTidy.h:102
clang::tidy::google::runtime::IntegerTypesCheck::IntegerTypesCheck
IntegerTypesCheck(StringRef Name, ClangTidyContext *Context)
Definition: IntegerTypesCheck.cpp:24
clang::tidy::ClangTidyCheck::Options
OptionsView Options
Definition: ClangTidy.h:158
clang::tidy::google::runtime::IntegerTypesCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register ASTMatchers with Finder.
Definition: IntegerTypesCheck.cpp:36
clang::tidy::google::runtime::IntegerTypesCheck
Finds uses of short, long and long long and suggest replacing them with u?intXX(_t)?.
Definition: IntegerTypesCheck.h:24
clang::tidy::ClangTidyOptions::OptionMap
std::map< std::string, std::string > OptionMap
Definition: ClangTidyOptions.h:82
Context
ClangTidyContext & Context
Definition: ClangTidy.cpp:93
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition: ClangTidyDiagnosticConsumer.h:124
clang::tidy::google::runtime::IntegerTypesCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition: IntegerTypesCheck.cpp:42
clang::tidy::google::runtime::IntegerTypesCheck::storeOptions
void storeOptions(ClangTidyOptions::OptionMap &Options) override
Should store all options supported by this check with their current values or default values for opti...
Definition: IntegerTypesCheck.cpp:30
Result
const NamedDecl * Result
Definition: USRFinder.cpp:121