clang  9.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
clang::CharSourceRange Class Reference

Represents a character-granular source range. More...

#include "clang/Basic/SourceLocation.h"

Public Member Functions

 CharSourceRange ()=default
 CharSourceRange (SourceRange R, bool ITR)
bool isTokenRange () const
 Return true if the end of this range specifies the start of the last token. More...
bool isCharRange () const
SourceLocation getBegin () const
SourceLocation getEnd () const
SourceRange getAsRange () const
void setBegin (SourceLocation b)
void setEnd (SourceLocation e)
void setTokenRange (bool TR)
bool isValid () const
bool isInvalid () const

Static Public Member Functions

static CharSourceRange getTokenRange (SourceRange R)
static CharSourceRange getCharRange (SourceRange R)
static CharSourceRange getTokenRange (SourceLocation B, SourceLocation E)
static CharSourceRange getCharRange (SourceLocation B, SourceLocation E)

Detailed Description

Represents a character-granular source range.

The underlying SourceRange can either specify the starting/ending character of the range, or it can specify the start of the range and the start of the last token of the range (a "token range"). In the token range case, the size of the last token must be measured to determine the actual end of the range.

Definition at line 234 of file SourceLocation.h.

Constructor & Destructor Documentation

◆ CharSourceRange() [1/2]

clang::CharSourceRange::CharSourceRange ( )

◆ CharSourceRange() [2/2]

clang::CharSourceRange::CharSourceRange ( SourceRange  R,
bool  ITR 

Definition at line 240 of file SourceLocation.h.

Member Function Documentation

◆ getAsRange()

SourceRange clang::CharSourceRange::getAsRange ( ) const

◆ getBegin()

SourceLocation clang::CharSourceRange::getBegin ( ) const

Definition at line 264 of file SourceLocation.h.

References clang::SourceRange::getBegin().

Referenced by clang::format::AffectedRangeManager::affectsCharSourceRange(), checkAllAtProps(), CheckMoveOnConstruction(), checkRangeForMacroArgExpansion(), DiagnoseNullConversion(), DiagUninitUse(), clang::markup::EmitRange(), findLinesForRange(), clang::PreprocessingRecord::findMacroDefinition(), clang::NestedNameSpecifierLoc::getBeginLoc(), clang::SourceManager::getBufferData(), clang::SourceManager::getExpansionRange(), clang::SourceManager::getImmediateMacroCallerLoc(), clang::Lexer::getImmediateMacroName(), clang::Lexer::getImmediateMacroNameForDiagnostics(), clang::TemplateArgumentLoc::getLocation(), GetMappedTokenLoc(), clang::Rewriter::getRangeSize(), getRangeSize(), clang::Lexer::getSourceText(), clang::FixItRewriter::HandleDiagnostic(), handleObjCOwnershipTypeAttr(), hasSuperInitCall(), clang::html::HighlightMacros(), highlightRange(), clang::Rewriter::IncreaseIndentation(), clang::edit::Commit::insertFromRange(), clang::edit::Commit::insertWrap(), isFunctionMacroExpansion(), clang::TokenLexer::Lex(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), makeStandaloneRange(), mapDiagnosticRanges(), maybeDiagnoseIDCharCompat(), maybeDiagnoseUTF8Homoglyph(), clang::edit::Commit::remove(), clang::Rewriter::RemoveText(), clang::edit::Commit::replace(), clang::edit::Commit::replaceText(), clang::edit::Commit::replaceWithInner(), retrieveMacroLocation(), clang::CoverageSourceInfo::SourceRangeSkipped(), and clang::FixItRewriter::WriteFixedFile().

◆ getCharRange() [1/2]

static CharSourceRange clang::CharSourceRange::getCharRange ( SourceRange  R)

◆ getCharRange() [2/2]

static CharSourceRange clang::CharSourceRange::getCharRange ( SourceLocation  B,
SourceLocation  E 

Definition at line 254 of file SourceLocation.h.

◆ getEnd()

SourceLocation clang::CharSourceRange::getEnd ( ) const

◆ getTokenRange() [1/2]

static CharSourceRange clang::CharSourceRange::getTokenRange ( SourceRange  R)

◆ getTokenRange() [2/2]

static CharSourceRange clang::CharSourceRange::getTokenRange ( SourceLocation  B,
SourceLocation  E 

Definition at line 250 of file SourceLocation.h.

◆ isCharRange()

bool clang::CharSourceRange::isCharRange ( ) const

◆ isInvalid()

bool clang::CharSourceRange::isInvalid ( ) const

◆ isTokenRange()

bool clang::CharSourceRange::isTokenRange ( ) const

◆ isValid()

bool clang::CharSourceRange::isValid ( ) const

◆ setBegin()

void clang::CharSourceRange::setBegin ( SourceLocation  b)

◆ setEnd()

void clang::CharSourceRange::setEnd ( SourceLocation  e)

◆ setTokenRange()

void clang::CharSourceRange::setTokenRange ( bool  TR)

Definition at line 270 of file SourceLocation.h.

Referenced by clang::SourceManager::getExpansionRange().

The documentation for this class was generated from the following file: