clang-tools  3.8.0
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'.
25 public:
27  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
28  void check(const ast_matchers::MatchFinder::MatchResult &Result) 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
StringHandle Name
std::unique_ptr< ast_matchers::MatchFinder > Finder
Definition: ClangTidy.cpp:188
Base class for all clang-tidy checks.
Definition: ClangTidy.h:102
IntegerTypesCheck(StringRef Name, ClangTidyContext *Context)
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register ASTMatchers with Finder.
Finds uses of short, long and long long and suggest replacing them with u?intXX(_t)?.
std::map< std::string, std::string > OptionMap
ClangTidyContext & Context
Definition: ClangTidy.cpp:93
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
void storeOptions(ClangTidyOptions::OptionMap &Options) override
Should store all options supported by this check with their current values or default values for opti...
const NamedDecl * Result
Definition: USRFinder.cpp:121