clang-tools
15.0.0git
|
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) |
Optional< Token > | findNextTokenSkippingComments (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 > | getQualifyingToken (tok::TokenKind TK, CharSourceRange Range, const ASTContext &Context, const SourceManager &SM) |
Assuming that Range spans a CVR-qualified type, returns the token in Range that is responsible for the qualification. More... | |
static bool | breakAndReturnEnd (const Stmt &S) |
static bool | breakAndReturnEndPlus1Token (const Stmt &S) |
static SourceLocation | getSemicolonAfterStmtEndLoc (const SourceLocation &EndLoc, const SourceManager &SM, const LangOptions &LangOpts) |
SourceLocation | getUnifiedEndLoc (const Stmt &S, const SourceManager &SM, const LangOptions &LangOpts) |
Stmt->getEndLoc does not always behave the same way depending on Token type. 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) |
|
static |
Definition at line 153 of file LexerUtils.cpp.
|
static |
Definition at line 157 of file LexerUtils.cpp.
SourceLocation clang::tidy::utils::lexer::findNextAnyTokenKind | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts, | ||
TokenKind | TK, | ||
TokenKinds... | TKs | ||
) |
Definition at line 65 of file LexerUtils.h.
SourceLocation clang::tidy::utils::lexer::findNextTerminator | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts | ||
) |
Definition at line 75 of file LexerUtils.cpp.
Optional< Token > clang::tidy::utils::lexer::findNextTokenSkippingComments | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts | ||
) |
Definition at line 80 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 41 of file LexerUtils.h.
SourceLocation clang::tidy::utils::lexer::findPreviousTokenKind | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts, | ||
tok::TokenKind | TK | ||
) |
Definition at line 52 of file LexerUtils.cpp.
SourceLocation clang::tidy::utils::lexer::findPreviousTokenStart | ( | SourceLocation | Start, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts | ||
) |
Definition at line 39 of file LexerUtils.cpp.
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 18 of file LexerUtils.cpp.
llvm::Optional< Token > clang::tidy::utils::lexer::getQualifyingToken | ( | tok::TokenKind | TK, |
CharSourceRange | Range, | ||
const ASTContext & | Context, | ||
const SourceManager & | SM | ||
) |
Assuming that Range
spans a CVR-qualified type, returns the token in Range
that is responsible for the qualification.
Range
must be valid with respect to SM
. Returns None
if no qualifying tokens are found.
Definition at line 114 of file LexerUtils.cpp.
|
static |
Definition at line 163 of file LexerUtils.cpp.
SourceLocation clang::tidy::utils::lexer::getUnifiedEndLoc | ( | const Stmt & | S, |
const SourceManager & | SM, | ||
const LangOptions & | LangOpts | ||
) |
Stmt->getEndLoc does not always behave the same way depending on Token type.
See implementation for exceptions.
Definition at line 199 of file LexerUtils.cpp.
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 90 of file LexerUtils.cpp.