clang-tools
9.0.0
|
Functions | |
Token | getPreviousToken (SourceLocation Location, const SourceManager &SM, const LangOptions &LangOpts, bool SkipComments=true) |
Returns previous token or tok::unknown if not found. More... | |
SourceLocation | findPreviousTokenStart (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts) |
SourceLocation | findPreviousTokenKind (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts, tok::TokenKind TK) |
SourceLocation | findNextTerminator (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts) |
bool | rangeContainsExpansionsOrDirectives (SourceRange Range, const SourceManager &SM, const LangOptions &LangOpts) |
Re-lex the provide Range and return false if either a macro spans multiple tokens, a pre-processor directive or failure to retrieve the next token is found, otherwise true . More... | |
llvm::Optional< Token > | getConstQualifyingToken (CharSourceRange Range, const ASTContext &Context, const SourceManager &SM) |
Assuming that Range spans a const-qualified type, returns the const token in Range that is responsible for const qualification. More... | |
template<typename TokenKind , typename... TokenKinds> | |
SourceLocation | findPreviousAnyTokenKind (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts, TokenKind TK, TokenKinds... TKs) |
template<typename TokenKind , typename... TokenKinds> | |
SourceLocation | findNextAnyTokenKind (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts, TokenKind TK, TokenKinds... TKs) |
SourceLocation clang::tidy::utils::lexer::findNextAnyTokenKind | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts, | ||
TokenKind | TK, | ||
TokenKinds... | TKs | ||
) |
Definition at line 59 of file LexerUtils.h.
SourceLocation clang::tidy::utils::lexer::findNextTerminator | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts | ||
) |
Definition at line 66 of file LexerUtils.cpp.
SourceLocation clang::tidy::utils::lexer::findPreviousAnyTokenKind | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts, | ||
TokenKind | TK, | ||
TokenKinds... | TKs | ||
) |
Definition at line 37 of file LexerUtils.h.
SourceLocation clang::tidy::utils::lexer::findPreviousTokenKind | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts, | ||
tok::TokenKind | TK | ||
) |
Definition at line 46 of file LexerUtils.cpp.
SourceLocation clang::tidy::utils::lexer::findPreviousTokenStart | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts | ||
) |
Definition at line 33 of file LexerUtils.cpp.
llvm::Optional< Token > clang::tidy::utils::lexer::getConstQualifyingToken | ( | CharSourceRange | Range, |
const ASTContext & | Context, | ||
const SourceManager & | SM | ||
) |
Assuming that Range
spans a const-qualified type, returns the const
token in Range
that is responsible for const qualification.
Range
must be valid with respect to SM
. Returns None
if no const
tokens are found.
Definition at line 95 of file LexerUtils.cpp.
Referenced by clang::tidy::readability::findConstToRemove().
Token clang::tidy::utils::lexer::getPreviousToken | ( | SourceLocation | Location, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts, | ||
bool | SkipComments | ||
) |
Returns previous token or tok::unknown
if not found.
Definition at line 16 of file LexerUtils.cpp.
Referenced by clang::tidy::readability::DeleteNullPointerCheck::check(), and clang::tidy::bugprone::SuspiciousSemicolonCheck::check().
bool clang::tidy::utils::lexer::rangeContainsExpansionsOrDirectives | ( | SourceRange | Range, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts | ||
) |
Re-lex the provide Range
and return false
if either a macro spans multiple tokens, a pre-processor directive or failure to retrieve the next token is found, otherwise true
.
Definition at line 71 of file LexerUtils.cpp.