clang-tools
3.9.0
Main Page
Namespaces
Classes
Files
File List
File Members
llvm.src
tools
clang
tools
extra
clang-tidy
google
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
#include <memory>
16
17
namespace
clang {
18
19
class
IdentifierTable;
20
21
namespace
tidy {
22
namespace
google {
23
namespace
runtime {
24
25
/// Finds uses of `short`, `long` and `long long` and suggest replacing them
26
/// with `u?intXX(_t)?`.
27
///
28
/// Correspondig cpplint.py check: 'runtime/int'.
29
class
IntegerTypesCheck
:
public
ClangTidyCheck
{
30
public
:
31
IntegerTypesCheck
(StringRef
Name
,
ClangTidyContext
*
Context
);
32
void
registerMatchers
(ast_matchers::MatchFinder *
Finder
)
override
;
33
void
check
(
const
ast_matchers::MatchFinder::MatchResult &
Result
)
override
;
34
void
storeOptions
(
ClangTidyOptions::OptionMap
&
Options
)
override
;
35
36
private
:
37
const
std::string UnsignedTypePrefix;
38
const
std::string SignedTypePrefix;
39
const
std::string TypeSuffix;
40
41
std::unique_ptr<IdentifierTable> IdentTable;
42
};
43
44
}
// namespace runtime
45
}
// namespace google
46
}
// namespace tidy
47
}
// namespace clang
48
49
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_INTEGERTYPESCHECK_H
Name
const std::string Name
Definition:
USRFinder.cpp:140
Finder
std::unique_ptr< ast_matchers::MatchFinder > Finder
Definition:
ClangTidy.cpp:210
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition:
ClangTidy.h:110
clang::tidy::google::runtime::IntegerTypesCheck::IntegerTypesCheck
IntegerTypesCheck(StringRef Name, ClangTidyContext *Context)
Definition:
IntegerTypesCheck.cpp:44
clang::tidy::ClangTidyCheck::Options
OptionsView Options
Definition:
ClangTidy.h:166
clang::tidy::google::runtime::IntegerTypesCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Definition:
IntegerTypesCheck.cpp:56
clang::tidy::google::runtime::IntegerTypesCheck
Finds uses of short, long and long long and suggest replacing them with u?intXX(_t)?.
Definition:
IntegerTypesCheck.h:29
clang::tidy::ClangTidyOptions::OptionMap
std::map< std::string, std::string > OptionMap
Definition:
ClangTidyOptions.h:85
Context
ClangTidyContext & Context
Definition:
ClangTidy.cpp:93
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition:
ClangTidyDiagnosticConsumer.h:135
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:64
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:50
Result
const NamedDecl * Result
Definition:
USRFinder.cpp:137
Generated on Wed Aug 31 2016 16:57:10 for clang-tools by
1.8.6