clang API Documentation
Represents a character-granular source range. More...
#include <SourceLocation.h>
Public Member Functions | |
CharSourceRange () | |
CharSourceRange (SourceRange R, bool ITR) | |
bool | isTokenRange () const |
Return true if the end of this range specifies the start of the last token. Return false if the end of this range specifies the last character in the range. | |
bool | isCharRange () const |
SourceLocation | getBegin () const |
SourceLocation | getEnd () const |
const SourceRange & | getAsRange () const |
void | setBegin (SourceLocation b) |
void | setEnd (SourceLocation e) |
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) |
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 225 of file SourceLocation.h.
clang::CharSourceRange::CharSourceRange | ( | ) | [inline] |
Definition at line 229 of file SourceLocation.h.
Referenced by getCharRange(), and getTokenRange().
clang::CharSourceRange::CharSourceRange | ( | SourceRange | R, |
bool | ITR | ||
) | [inline] |
Definition at line 230 of file SourceLocation.h.
const SourceRange& clang::CharSourceRange::getAsRange | ( | ) | const [inline] |
Definition at line 255 of file SourceLocation.h.
SourceLocation clang::CharSourceRange::getBegin | ( | ) | const [inline] |
Definition at line 253 of file SourceLocation.h.
References clang::SourceRange::getBegin().
Referenced by clang::Sema::ActOnGCCAsmStmt(), DiagUninitUse(), clang::markup::EmitRange(), clang::tooling::getRangeSize(), clang::Rewriter::getRangeSize(), clang::Lexer::getSourceText(), clang::FixItRewriter::HandleDiagnostic(), highlightRange(), clang::Rewriter::IncreaseIndentation(), clang::edit::Commit::insertFromRange(), clang::edit::Commit::insertWrap(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), makeStandaloneRange(), maybeDiagnoseIDCharCompat(), mergeFixits(), clang::edit::Commit::remove(), clang::Rewriter::RemoveText(), clang::edit::Commit::replace(), and clang::edit::Commit::replaceWithInner().
static CharSourceRange clang::CharSourceRange::getCharRange | ( | SourceRange | R | ) | [inline, static] |
Definition at line 236 of file SourceLocation.h.
References CharSourceRange().
Referenced by applyEditsToTemp(), applyRewrite(), CreateIfFixit(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateInsertionFromRange(), diagnoseObjCLiteralComparison(), getCharRange(), clang::edit::Commit::Edit::getFileRange(), clang::edit::Commit::Edit::getInsertFromRange(), getLiteralInfo(), makeCharRange(), MakeCharSourceRange(), makeRangeFromFileLocs(), clang::format::reformat(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToObjCProperty(), and rewriteToSubscriptGetCommon().
static CharSourceRange clang::CharSourceRange::getCharRange | ( | SourceLocation | B, |
SourceLocation | E | ||
) | [inline, static] |
Definition at line 243 of file SourceLocation.h.
References getCharRange().
SourceLocation clang::CharSourceRange::getEnd | ( | ) | const [inline] |
Definition at line 254 of file SourceLocation.h.
References clang::SourceRange::getEnd().
Referenced by clang::markup::EmitRange(), clang::tooling::getRangeSize(), clang::Rewriter::getRangeSize(), clang::Lexer::getSourceText(), clang::FixItRewriter::HandleDiagnostic(), highlightRange(), clang::Rewriter::IncreaseIndentation(), clang::edit::Commit::insertWrap(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), makeStandaloneRange(), mergeFixits(), and clang::edit::Commit::replaceWithInner().
static CharSourceRange clang::CharSourceRange::getTokenRange | ( | SourceRange | R | ) | [inline, static] |
Definition at line 232 of file SourceLocation.h.
References CharSourceRange().
Referenced by clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), GCRewriteFinalize(), getLiteralInfo(), clang::Rewriter::getRangeSize(), getTokenRange(), clang::Rewriter::IncreaseIndentation(), clang::edit::Commit::insertFromRange(), clang::edit::Commit::insertWrap(), clang::operator<<(), clang::edit::Commit::remove(), clang::edit::Commit::replace(), clang::tooling::Replacement::Replacement(), clang::tooling::replaceStmtWithStmt(), clang::tooling::replaceStmtWithText(), clang::edit::Commit::replaceWithInner(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNumberLiteral(), rewriteToSubscriptGetCommon(), clang::tooling::ReplaceStmtWithText::run(), and clang::ConversionFixItGenerator::tryToFixConversion().
static CharSourceRange clang::CharSourceRange::getTokenRange | ( | SourceLocation | B, |
SourceLocation | E | ||
) | [inline, static] |
Definition at line 240 of file SourceLocation.h.
References getTokenRange().
bool clang::CharSourceRange::isCharRange | ( | ) | const [inline] |
Definition at line 251 of file SourceLocation.h.
Referenced by clang::Lexer::makeFileCharRange().
bool clang::CharSourceRange::isInvalid | ( | ) | const [inline] |
Definition at line 261 of file SourceLocation.h.
References isValid().
Referenced by applyEditsToTemp(), clang::Lexer::getSourceText(), and clang::Rewriter::IncreaseIndentation().
bool clang::CharSourceRange::isTokenRange | ( | ) | const [inline] |
Return true if the end of this range specifies the start of the last token. Return false if the end of this range specifies the last character in the range.
Definition at line 250 of file SourceLocation.h.
Referenced by clang::markup::EmitRange(), clang::tooling::getRangeSize(), clang::Rewriter::getRangeSize(), clang::FixItRewriter::HandleDiagnostic(), highlightRange(), clang::edit::Commit::insertWrap(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), and mergeFixits().
bool clang::CharSourceRange::isValid | ( | ) | const [inline] |
Definition at line 260 of file SourceLocation.h.
References clang::SourceRange::isValid().
Referenced by clang::FixItRewriter::HandleDiagnostic(), highlightRange(), isInvalid(), clang::FixItHint::isNull(), and mergeFixits().
void clang::CharSourceRange::setBegin | ( | SourceLocation | b | ) | [inline] |
Definition at line 257 of file SourceLocation.h.
References clang::SourceRange::setBegin().
Referenced by clang::Lexer::makeFileCharRange().
void clang::CharSourceRange::setEnd | ( | SourceLocation | e | ) | [inline] |
Definition at line 258 of file SourceLocation.h.
References clang::SourceRange::setEnd().
Referenced by clang::Lexer::makeFileCharRange().