clang 20.0.0git
Functions
SourceCode.cpp File Reference
#include "clang/Tooling/Transformer/SourceCode.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Comment.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include <set>

Go to the source code of this file.

Functions

static bool spelledInMacroDefinition (SourceLocation Loc, const SourceManager &SM)
 
static std::optional< CharSourceRangegetExpansionForSplitToken (SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts)
 
static CharSourceRange getRangeForSplitTokens (CharSourceRange Range, const SourceManager &SM, const LangOptions &LangOpts)
 
static CharSourceRange getRange (const CharSourceRange &EditRange, const SourceManager &SM, const LangOptions &LangOpts, bool IncludeMacroExpansion)
 
static bool startsWithNewline (const SourceManager &SM, const Token &Tok)
 
static bool contains (const std::set< tok::TokenKind > &Terminators, const Token &Tok)
 
static SourceLocation getEntityEndLoc (const SourceManager &SM, SourceLocation EntityLast, const std::set< tok::TokenKind > &Terminators, const LangOptions &LangOpts)
 
static std::set< tok::TokenKindgetTerminators (const Decl &D)
 
static SourceLocation skipWhitespaceAndNewline (const SourceManager &SM, SourceLocation Loc, const LangOptions &LangOpts)
 
static bool atOrBeforeSeparation (const SourceManager &SM, SourceLocation Loc, const LangOptions &LangOpts)
 

Function Documentation

◆ atOrBeforeSeparation()

static bool atOrBeforeSeparation ( const SourceManager SM,
SourceLocation  Loc,
const LangOptions LangOpts 
)
static

◆ contains()

static bool contains ( const std::set< tok::TokenKind > &  Terminators,
const Token Tok 
)
static

Definition at line 201 of file SourceCode.cpp.

References clang::Token::getKind().

Referenced by getEntityEndLoc(), and percentEncodeURICharacter().

◆ getEntityEndLoc()

static SourceLocation getEntityEndLoc ( const SourceManager SM,
SourceLocation  EntityLast,
const std::set< tok::TokenKind > &  Terminators,
const LangOptions LangOpts 
)
static

◆ getExpansionForSplitToken()

static std::optional< CharSourceRange > getExpansionForSplitToken ( SourceLocation  Loc,
const SourceManager SM,
const LangOptions LangOpts 
)
static

Definition at line 108 of file SourceCode.cpp.

References clang::Invalid, clang::SourceLocation::isMacroID(), Loc, and SM.

Referenced by getRangeForSplitTokens().

◆ getRange()

static CharSourceRange getRange ( const CharSourceRange EditRange,
const SourceManager SM,
const LangOptions LangOpts,
bool  IncludeMacroExpansion 
)
static

◆ getRangeForSplitTokens()

static CharSourceRange getRangeForSplitTokens ( CharSourceRange  Range,
const SourceManager SM,
const LangOptions LangOpts 
)
static

◆ getTerminators()

static std::set< tok::TokenKind > getTerminators ( const Decl D)
static

Definition at line 344 of file SourceCode.cpp.

References D.

Referenced by clang::tooling::getAssociatedRange().

◆ skipWhitespaceAndNewline()

static SourceLocation skipWhitespaceAndNewline ( const SourceManager SM,
SourceLocation  Loc,
const LangOptions LangOpts 
)
static

◆ spelledInMacroDefinition()

static bool spelledInMacroDefinition ( SourceLocation  Loc,
const SourceManager SM 
)
static

Definition at line 89 of file SourceCode.cpp.

References clang::SourceLocation::isMacroID(), Loc, and SM.

Referenced by getRange().

◆ startsWithNewline()

static bool startsWithNewline ( const SourceManager SM,
const Token Tok 
)
static

Definition at line 197 of file SourceCode.cpp.

References clang::Token::getLocation(), clang::isVerticalWhitespace(), and SM.

Referenced by getEntityEndLoc().