clang
10.0.0svn
|
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) |
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.
|
default |
|
inline |
Definition at line 240 of file SourceLocation.h.
|
inline |
Definition at line 266 of file SourceLocation.h.
Referenced by clang::Lexer::getAsCharRange(), clang::SourceManager::getExpansionRange(), and clang::edit::Commit::replaceText().
|
inline |
Definition at line 264 of file SourceLocation.h.
References clang::SourceRange::getBegin().
Referenced by clang::format::AffectedRangeManager::affectsCharSourceRange(), TokenCollector::Builder::build(), checkAllAtProps(), CheckMoveOnConstruction(), checkRangeForMacroArgExpansion(), DiagnoseNullConversion(), DiagUninitUse(), clang::markup::EmitRange(), findLinesForRange(), FindLocsWithCommonFileID(), 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::tooling::getRangeForEdit(), clang::Rewriter::getRangeSize(), getRangeSize(), clang::Rewriter::getRewrittenText(), 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::Rewriter::ReplaceText(), clang::edit::Commit::replaceWithInner(), retrieveMacroLocation(), clang::CoverageSourceInfo::SourceRangeSkipped(), and clang::FixItRewriter::WriteFixedFile().
|
inlinestatic |
Definition at line 246 of file SourceLocation.h.
Referenced by clang::Sema::AddCFAuditedAttribute(), clang::format::AffectedRangeManager::affectsCharSourceRange(), clang::transformer::after(), applyEditsToTemp(), applyRewrite(), clang::transformer::before(), clang::transformer::callArgs(), clang::Preprocessor::checkModuleIsAvailable(), clang::edit::EditedSource::clearRewrites(), CreateIfFixit(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateInsertionFromRange(), diagnoseObjCLiteralComparison(), diagnoseXorMisusedAsPow(), clang::format::Environment::Environment(), GenerateFixForUnusedDecl(), clang::edit::Commit::Edit::getFileRange(), clang::edit::Commit::Edit::getInsertFromRange(), getLiteralInfo(), makeCharRange(), MakeCharSourceRange(), makeRangeFromFileLocs(), clang::transformer::name(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNSMacroDecl(), rewriteToObjCProperty(), rewriteToSubscriptGetCommon(), and clang::transformer::statements().
|
inlinestatic |
Definition at line 254 of file SourceLocation.h.
|
inline |
Definition at line 265 of file SourceLocation.h.
References clang::SourceRange::getEnd().
Referenced by clang::format::AffectedRangeManager::affectsCharSourceRange(), TokenCollector::Builder::build(), checkRangeForMacroArgExpansion(), clang::TextDiagnostic::emitDiagnosticLoc(), clang::markup::EmitRange(), findLinesForRange(), clang::PreprocessingRecord::findMacroDefinition(), clang::NestedNameSpecifierLoc::getEndLoc(), clang::SourceManager::getExpansionRange(), GetMappedTokenLoc(), clang::tooling::getRangeForEdit(), clang::Rewriter::getRangeSize(), getRangeSize(), clang::Rewriter::getRewrittenText(), clang::Lexer::getSourceText(), clang::FixItRewriter::HandleDiagnostic(), hasSuperInitCall(), clang::html::HighlightMacros(), highlightRange(), clang::Rewriter::IncreaseIndentation(), clang::edit::Commit::insertWrap(), isTargetEnvironment(), clang::TokenLexer::Lex(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), makeStandaloneRange(), clang::edit::Commit::replaceText(), clang::edit::Commit::replaceWithInner(), and retrieveMacroLocation().
|
inlinestatic |
Definition at line 242 of file SourceLocation.h.
Referenced by clang::Sema::AddCFAuditedAttribute(), clang::Sema::CheckConversionDeclarator(), constructDebugPieceForTrackedCondition(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), diagnoseXorMisusedAsPow(), GCRewriteFinalize(), GetDefaultValueString(), getLiteralInfo(), clang::Rewriter::getRangeSize(), clang::Rewriter::getRewrittenText(), clang::transformer::detail::getRuleMatchLoc(), clang::tooling::fixit::internal::getSourceRange(), clang::tooling::getText(), clang::Rewriter::IncreaseIndentation(), clang::edit::Commit::insertFromRange(), clang::edit::Commit::insertWrap(), isReleased(), clang::transformer::member(), clang::transformer::name(), clang::transformer::node(), clang::operator<<(), 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(), and clang::tooling::ReplaceNodeWithTemplate::run().
|
inlinestatic |
Definition at line 250 of file SourceLocation.h.
|
inline |
Definition at line 262 of file SourceLocation.h.
Referenced by clang::markup::EmitRange(), clang::PreprocessingRecord::findMacroDefinition(), hasSuperInitCall(), and clang::Lexer::makeFileCharRange().
|
inline |
Definition at line 273 of file SourceLocation.h.
Referenced by applyEditsToTemp(), clang::markup::EmitRange(), GetDefaultValueString(), clang::tooling::getRangeForEdit(), clang::Lexer::getSourceText(), clang::Rewriter::IncreaseIndentation(), and clang::edit::Commit::replaceText().
|
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 261 of file SourceLocation.h.
Referenced by clang::TextDiagnostic::emitDiagnosticLoc(), clang::Lexer::getAsCharRange(), clang::SourceManager::getExpansionRange(), clang::Rewriter::getRangeSize(), getRangeSize(), clang::Rewriter::getRewrittenText(), clang::FixItRewriter::HandleDiagnostic(), clang::html::HighlightMacros(), highlightRange(), clang::edit::Commit::insertWrap(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), mapDiagnosticRanges(), and retrieveMacroLocation().
|
inline |
Definition at line 272 of file SourceLocation.h.
References clang::SourceRange::isValid().
Referenced by findLinesForRange(), clang::FixItRewriter::HandleDiagnostic(), highlightRange(), and clang::FixItHint::isNull().
|
inline |
Definition at line 268 of file SourceLocation.h.
References clang::SourceRange::setBegin().
Referenced by clang::SourceManager::getExpansionRange(), and clang::Lexer::makeFileCharRange().
|
inline |
Definition at line 269 of file SourceLocation.h.
References clang::SourceRange::setEnd().
Referenced by clang::SourceManager::getExpansionRange(), and clang::Lexer::makeFileCharRange().
|
inline |
Definition at line 270 of file SourceLocation.h.
Referenced by clang::SourceManager::getExpansionRange().