forked from OSchip/llvm-project
[clang-tidy] minor coding style tweak. make functions static.
llvm-svn: 241160
This commit is contained in:
parent
15820b072b
commit
bf5e59c78b
|
@ -38,33 +38,33 @@ private:
|
|||
Preprocessor *PP;
|
||||
MacroParenthesesCheck *Check;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
/// Is argument surrounded properly with parentheses/braces/squares/commas?
|
||||
bool isSurroundedLeft(const Token &T) {
|
||||
static bool isSurroundedLeft(const Token &T) {
|
||||
return T.isOneOf(tok::l_paren, tok::l_brace, tok::l_square, tok::comma,
|
||||
tok::semi);
|
||||
}
|
||||
|
||||
/// Is argument surrounded properly with parentheses/braces/squares/commas?
|
||||
bool isSurroundedRight(const Token &T) {
|
||||
static bool isSurroundedRight(const Token &T) {
|
||||
return T.isOneOf(tok::r_paren, tok::r_brace, tok::r_square, tok::comma,
|
||||
tok::semi);
|
||||
}
|
||||
|
||||
/// Is given TokenKind a keyword?
|
||||
bool isKeyword(const Token &T) {
|
||||
static bool isKeyword(const Token &T) {
|
||||
/// \TODO better matching of keywords to avoid false positives
|
||||
return T.isOneOf(tok::kw_case, tok::kw_const, tok::kw_struct);
|
||||
}
|
||||
|
||||
/// Warning is written when one of these operators are not within parentheses.
|
||||
bool isWarnOp(const Token &T) {
|
||||
static bool isWarnOp(const Token &T) {
|
||||
/// \TODO This is an initial list of operators. It can be tweaked later to
|
||||
/// get more positives or perhaps avoid some false positive.
|
||||
return T.isOneOf(tok::plus, tok::minus, tok::star, tok::slash, tok::percent,
|
||||
tok::amp, tok::pipe, tok::caret);
|
||||
}
|
||||
}
|
||||
|
||||
void MacroParenthesesPPCallbacks::replacementList(const Token &MacroNameTok,
|
||||
const MacroInfo *MI) {
|
||||
|
|
Loading…
Reference in New Issue