clang 17.0.0git
|
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. | |
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) |
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 253 of file SourceLocation.h.
|
default |
Referenced by getCharRange(), and getTokenRange().
|
inline |
Definition at line 259 of file SourceLocation.h.
|
inline |
Definition at line 285 of file SourceLocation.h.
|
inline |
Definition at line 283 of file SourceLocation.h.
Referenced by clang::Sema::ActOnGCCAsmStmt(), checkAllAtProps(), CheckMoveOnConstruction(), createTextRegion(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), DiagnoseNullConversion(), DiagUninitUse(), clang::markup::EmitRange(), findLinesForRange(), clang::SourceManager::getExpansionRange(), GetFullTypeForDeclarator(), clang::SourceManager::getImmediateMacroCallerLoc(), GetMappedTokenLoc(), getRange(), clang::FixItRewriter::HandleDiagnostic(), handleObjCOwnershipTypeAttr(), highlightRange(), makeStandaloneRange(), overlapWithMacro(), and retrieveMacroLocation().
|
inlinestatic |
Definition at line 273 of file SourceLocation.h.
References getCharRange().
|
inlinestatic |
Definition at line 265 of file SourceLocation.h.
References CharSourceRange().
Referenced by clang::Sema::ActOnStringLiteral(), clang::transformer::after(), clang::format::JavaScriptImportSorter::analyze(), applyEditsToTemp(), applyRewrite(), clang::transformer::before(), clang::tooling::convertChangesToFileReplacements(), convertTokenRangeToCharRange(), CreateIfFixit(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateInsertionFromRange(), diagnoseObjCLiteralComparison(), diagnoseXorMisusedAsPow(), DoEmitAvailabilityWarning(), GenerateFixForUnusedDecl(), clang::Lexer::getAsCharRange(), getCharRange(), getExprText(), clang::edit::Commit::Edit::getFileRange(), DerefSimplePtrArithFixableGadget::getFixits(), clang::edit::Commit::Edit::getInsertFromRange(), getLiteralInfo(), clang::MacroExpansionContext::getOriginalText(), getRange(), clang::format::insertQualifierAfter(), clang::format::insertQualifierBefore(), clang::format::Environment::make(), makeCharRange(), MakeCharSourceRange(), makeRangeFromFileLocs(), clang::transformer::noopEdit(), clang::format::IntegerLiteralSeparatorFixer::process(), clang::format::removeToken(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNSMacroDecl(), rewriteToObjCProperty(), rewriteToSubscriptGetCommon(), and clang::format::rotateTokens().
|
inline |
Definition at line 284 of file SourceLocation.h.
Referenced by clang::internal::anyConflict(), createTextRegion(), clang::TextDiagnostic::emitDiagnosticLoc(), clang::markup::EmitRange(), clang::SourceLocExpr::EvaluateInContext(), findLinesForRange(), getEntityEndLoc(), clang::SourceManager::getExpansionRange(), GetMappedTokenLoc(), getRange(), clang::FixItRewriter::HandleDiagnostic(), highlightRange(), makeStandaloneRange(), clang::tooling::maybeExtendRange(), clang::edit::Commit::replaceWithInner(), and retrieveMacroLocation().
|
inlinestatic |
Definition at line 269 of file SourceLocation.h.
References getTokenRange().
|
inlinestatic |
Definition at line 261 of file SourceLocation.h.
References CharSourceRange().
Referenced by clang::transformer::after(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CodeCompleteMemberReferenceExpr(), constructDebugPieceForTrackedCondition(), clang::FixItHint::CreateRemoval(), clang::tooling::createRenameAtomicChanges(), clang::FixItHint::CreateReplacement(), DiagnoseBaseOrMemInitializerOrder(), diagnoseXorMisusedAsPow(), GCRewriteFinalize(), clang::tooling::getAssociatedRange(), GetDefaultValueString(), clang::tooling::getExtendedRange(), getLiteralInfo(), clang::Rewriter::getRangeSize(), clang::Rewriter::getRewrittenText(), clang::transformer::detail::getRuleMatchLoc(), clang::tooling::fixit::internal::getSourceRange(), clang::tooling::getText(), getTokenRange(), clang::Rewriter::IncreaseIndentation(), clang::edit::Commit::insertFromRange(), clang::edit::Commit::insertWrap(), clang::tooling::maybeExtendRange(), clang::transformer::member(), clang::transformer::name(), clang::transformer::node(), clang::operator<<(), clang::ento::ConditionBRVisitor::patternMatch(), printExprAsWritten(), 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(), clang::tooling::ReplaceNodeWithTemplate::run(), and clang::ConversionFixItGenerator::tryToFixConversion().
|
inline |
Definition at line 281 of file SourceLocation.h.
Referenced by clang::markup::EmitRange(), and clang::ThreadFlow::setRange().
|
inline |
Definition at line 292 of file SourceLocation.h.
References isValid().
Referenced by clang::markup::EmitRange(), GetDefaultValueString(), and clang::tooling::maybeExtendRange().
|
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 280 of file SourceLocation.h.
Referenced by clang::TextDiagnostic::emitDiagnosticLoc(), clang::SourceManager::getExpansionRange(), getRange(), clang::FixItRewriter::HandleDiagnostic(), highlightRange(), and retrieveMacroLocation().
|
inline |
Definition at line 291 of file SourceLocation.h.
Referenced by DoEmitAvailabilityWarning(), findLinesForRange(), clang::FixItRewriter::HandleDiagnostic(), highlightRange(), isInvalid(), and clang::FixItHint::isNull().
|
inline |
Definition at line 287 of file SourceLocation.h.
References b.
Referenced by clang::SourceManager::getExpansionRange().
|
inline |
Definition at line 288 of file SourceLocation.h.
Referenced by clang::SourceManager::getExpansionRange().
|
inline |
Definition at line 289 of file SourceLocation.h.
Referenced by clang::SourceManager::getExpansionRange().