clang-tools 19.0.0git
Namespaces | Functions
LexerUtils.cpp File Reference
#include "LexerUtils.h"
#include "clang/AST/AST.h"
#include "clang/Basic/SourceManager.h"
#include <optional>
#include <utility>

Go to the source code of this file.

Namespaces

namespace  clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
namespace  clang::tidy
 
namespace  clang::tidy::utils
 
namespace  clang::tidy::utils::lexer
 

Functions

std::pair< Token, SourceLocation > clang::tidy::utils::lexer::getPreviousTokenAndStart (SourceLocation Location, const SourceManager &SM, const LangOptions &LangOpts, bool SkipComments)
 
Token clang::tidy::utils::lexer::getPreviousToken (SourceLocation Location, const SourceManager &SM, const LangOptions &LangOpts, bool SkipComments=true)
 Returns previous token or tok::unknown if not found.
 
SourceLocation clang::tidy::utils::lexer::findPreviousTokenStart (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts)
 
SourceLocation clang::tidy::utils::lexer::findPreviousTokenKind (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts, tok::TokenKind TK)
 
SourceLocation clang::tidy::utils::lexer::findNextTerminator (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts)
 
std::optional< Token > clang::tidy::utils::lexer::findNextTokenIncludingComments (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts)
 
std::optional< Token > clang::tidy::utils::lexer::findNextTokenSkippingComments (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts)
 
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.
 
std::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.
 
static bool clang::tidy::utils::lexer::breakAndReturnEnd (const Stmt &S)
 
static bool clang::tidy::utils::lexer::breakAndReturnEndPlus1Token (const Stmt &S)
 
static SourceLocation clang::tidy::utils::lexer::getSemicolonAfterStmtEndLoc (const SourceLocation &EndLoc, const SourceManager &SM, const LangOptions &LangOpts)
 
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.
 
SourceLocation clang::tidy::utils::lexer::getLocationForNoexceptSpecifier (const FunctionDecl *FuncDecl, const SourceManager &SM)
 For a given FunctionDecl returns the location where you would need to place the noexcept specifier.