|
clang 23.0.0git
|
A trivial tuple used to represent a source range. More...
#include "clang/Basic/SourceLocation.h"
Public Member Functions | |
| SourceRange ()=default | |
| SourceRange (SourceLocation loc) | |
| SourceRange (SourceLocation begin, SourceLocation end) | |
| SourceLocation | getBegin () const |
| SourceLocation | getEnd () const |
| void | setBegin (SourceLocation b) |
| void | setEnd (SourceLocation e) |
| bool | isValid () const |
| bool | isInvalid () const |
| bool | operator== (const SourceRange &X) const |
| bool | operator!= (const SourceRange &X) const |
| bool | fullyContains (const SourceRange &other) const |
| void | print (raw_ostream &OS, const SourceManager &SM) const |
| std::string | printToString (const SourceManager &SM) const |
| void | dump (const SourceManager &SM) const |
A trivial tuple used to represent a source range.
When referring to tokens, a SourceRange is an inclusive range [begin, end] that contains its endpoints, its begin SourceLocation points to the first byte of the first token and its end SourceLocation points to the first byte of the last token.
Definition at line 224 of file SourceLocation.h.
|
default |
Referenced by fullyContains(), operator!=(), operator==(), and clang::ento::PathDiagnosticRange::PathDiagnosticRange().
|
inline |
Definition at line 230 of file SourceLocation.h.
|
inline |
Definition at line 231 of file SourceLocation.h.
| LLVM_DUMP_METHOD void SourceRange::dump | ( | const SourceManager & | SM | ) | const |
Definition at line 99 of file SourceLocation.cpp.
|
inline |
Definition at line 251 of file SourceLocation.h.
References SourceRange().
|
inline |
Definition at line 233 of file SourceLocation.h.
Referenced by clang::Sema::ActOnAttributedStmt(), clang::Sema::ActOnBaseSpecifier(), clang::Sema::ActOnComment(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::Sema::ActOnMemberAccessExpr(), clang::SemaObjC::ActOnObjCExceptionDecl(), clang::SemaObjC::actOnObjCTypeArgsAndProtocolQualifiers(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPDeclareSimdDirective(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), clang::Sema::ActOnTag(), clang::Sema::ActOnTagFinishDefinition(), clang::Sema::ActOnUsingDeclaration(), clang::Sema::ActOnUsingEnumDeclaration(), addBlockPointerConversion(), clang::ASTContext::addComment(), addFunctionPointerConversion(), clang::PreprocessingRecord::addPreprocessedEntity(), clang::format::ContinuationIndenter::addTokenToState(), clang::Sema::BuildArrayType(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBaseInitializer(), clang::SemaObjC::BuildClassMessage(), clang::Sema::BuildCXXFunctionalCastExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), buildIdExpression(), buildImplicitMap(), clang::Sema::BuildImplicitMemberExpr(), buildLambdaCaptureFixit(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildMemberInitializer(), clang::Sema::BuildMemberReferenceExpr(), clang::SemaObjC::BuildObjCArrayLiteral(), clang::SemaObjC::BuildObjCBoxedExpr(), clang::SemaObjC::BuildObjCDictionaryLiteral(), clang::Sema::BuildPseudoDestructorExpr(), clang::Sema::CheckAddressOfOperand(), clang::Sema::CheckAltivecInitFromScalar(), clang::Sema::CheckCastAlign(), CheckConstraintSatisfaction(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckExceptionSpecCompatibility(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::sema::checkExprLifetimeImpl(), clang::Sema::CheckExtVectorCast(), checkIntToPointerCast(), checkLiteralOperatorTemplateParameterList(), clang::Sema::CheckMain(), clang::Sema::CheckMatrixCast(), clang::Sema::CheckMemberPointerConversion(), CheckMemorySizeofForComparison(), clang::SemaObjC::CheckMessageArgumentTypes(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::SemaObjC::CheckObjCConversion(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), checkOpenMPLoop(), clang::Sema::CheckParameterPacksForExpansion(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), clang::Sema::CheckTypenameType(), checkTypeParamListConsistency(), clang::Sema::checkUnknownAnyCast(), clang::Sema::CheckVectorCast(), comparePiece(), ConstructFixItRangeForUnusedCapture(), convertTokenRangeToCharRange(), clang::tooling::CodeRangeASTSelection::create(), clang::InitializationKind::CreateCast(), clang::InitializationKind::CreateCStyleCast(), clang::InitializationKind::CreateFunctionalCast(), clang::Sema::CreateGenericSelectionExpr(), clang::Sema::CreateLambdaCallOperator(), clang::Sema::createLambdaClosureType(), clang::Sema::CXXCheckConditionalOperands(), clang::InitializationSequence::Diagnose(), DiagnoseAccessPath(), DiagnoseConstAssignment(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::DiagnoseEqualityWithExtraParens(), diagnoseInstanceReference(), diagnoseInvalidDeclaratorChunks(), DiagnoseInvisibleNamespace(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::SemaObjC::DiagnoseMultipleMethodInGlobalPool(), DiagnoseNullConversion(), diagnoseObjCARCConversion(), clang::Sema::diagnoseTypo(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::Sema::DiagnoseUnknownAttribute(), clang::Sema::DiagnoseUnknownTypeName(), diagnoseWellFormedUnsatisfiedConstraintExpr(), doRewriteToUTF8StringBoxedExpressionHelper(), clang::TextNodeDumper::dumpSourceRange(), clang::CodeGen::CodeGenFunction::EmitCXXForRangeStmt(), clang::CodeGen::CodeGenFunction::EmitDoStmt(), clang::CodeGen::CodeGenFunction::EmitForStmt(), clang::EmitIncompleteCountedByPointeeNotes(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitOMPInnerLoop(), clang::CodeGen::CodeGenFunction::EmitWhileStmt(), clang::Sema::EnsureTemplateArgumentListConstraints(), clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::CIRGenModule::errorNYI(), EvaluateSizeTTypeTrait(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::syntax::TokenBuffer::expandedTokens(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), clang::tooling::findSelectedASTNodes(), clang::CIRGen::CIRGenFunction::generateCode(), clang::Decl::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::BuiltinTypeLoc::getBuiltinLoc(), GetDeclSpecTypeForDeclarator(), clang::NonTypeTemplateParmDecl::getDefaultArgumentLoc(), clang::DeclaratorChunk::getFunction(), getGenericLambdaTemplateParameterList(), getLambdaType(), getLengthOnSingleLine(), getLiteralInfo(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CIRGen::CIRGenModule::getLoc(), clang::NestedNameSpecifierLoc::getLocalBeginLoc(), clang::Attr::getLocation(), clang::MacroDefinitionRecord::getLocation(), clang::TemplateArgumentLoc::getLocation(), clang::ento::CallEvent::getProgramPoint(), clang::Sema::getTypeName(), handleAvailabilityAttr(), clang::VerifyDiagnosticConsumer::HandleComment(), handleDeprecatedAttr(), HandleDestructionImpl(), handleDLLAttr(), handleFallThroughAttr(), clang::SemaRISCV::handleInterruptAttr(), handleNullableTypeAttr(), handleOpenCLUnrollHint(), handleVisibilityAttr(), clang::ASTImporter::Import(), clang::tooling::RenameOccurrences::initiate(), isPreprocessedEntityIfInFileID(), LookupMemberExpr(), clang::ASTUnit::mapRangeFromPreamble(), clang::ASTUnit::mapRangeToPreamble(), mergeInterfaceMethodToImpl(), clang::BeforeThanCompare< SourceRange >::operator()(), clang::format::WhitespaceManager::Change::IsBeforeInFile::operator()(), clang::InitializationSequence::Perform(), clang::Sema::PerformObjectMemberConversion(), populateExecutedLinesWithFunctionSignature(), populateExecutedLinesWithStmt(), PreparePackForExpansion(), ProcessStmtAttribute(), clang::RawComment::RawComment(), clang::TreeTransform< Derived >::RebuildArrayType(), clang::Sema::RebuildNestedNameSpecifierInCurrentInstantiation(), clang::Rewriter::ReplaceText(), clang::Sema::RequireCompleteDeclContext(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), rewriteToArraySubscriptSet(), rewriteToBoolLiteral(), rewriteToCharLiteral(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNumberLiteral(), rewriteToNumericBoxedExpression(), rewriteToSubscriptGetCommon(), clang::Token::setAnnotationRange(), clang::ForStmt::setConditionVariable(), clang::IfStmt::setConditionVariable(), clang::SwitchStmt::setConditionVariable(), clang::WhileStmt::setConditionVariable(), clang::CXXScopeSpec::SetInvalid(), clang::ObjCMessageExpr::setSourceRange(), clang::Sema::setTagNameForLinkagePurposes(), shouldInferAvailabilityAttribute(), SuggestParentheses(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), TryOrBuildParenListInitialization(), clang::ConversionFixItGenerator::tryToFixConversion(), and warnAboutAmbiguousFunction().
|
inline |
Definition at line 234 of file SourceLocation.h.
Referenced by clang::Sema::ActOnCXXForRangeIdentifier(), clang::Sema::ActOnCXXNestedNameSpecifierDecltype(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), clang::Sema::ActOnUsingEnumDeclaration(), clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), clang::format::ContinuationIndenter::addTokenToState(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), buildIdExpression(), buildLambdaCaptureFixit(), clang::Sema::BuildLambdaExpr(), buildLambdaThisCaptureFixit(), clang::Sema::BuildMemberInitializer(), clang::SemaObjC::BuildObjCNumericLiteral(), clang::Preprocessor::CheckEndOfDirective(), CheckMemorySizeofForComparison(), clang::Sema::CheckPureMethod(), clang::Sema::CheckTemplateTypeArgument(), comparePiece(), clang::tooling::ExtractionSemicolonPolicy::compute(), ConstructFixItRangeForUnusedCapture(), ConvertDeducedTemplateArguments(), convertTokenRangeToCharRange(), clang::tooling::CodeRangeASTSelection::create(), clang::InitializationKind::CreateCast(), clang::InitializationKind::CreateCStyleCast(), clang::InitializationKind::CreateFunctionalCast(), clang::CreateHLSLAttributedResourceType(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::Sema::DiagnoseEqualityWithExtraParens(), DiagnoseInvalidRedeclaration(), clang::TextNodeDumper::dumpSourceRange(), clang::CodeGen::CodeGenFunction::EmitCXXForRangeStmt(), clang::CodeGen::CodeGenFunction::EmitDoStmt(), clang::CodeGen::CodeGenFunction::EmitForStmt(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitOMPInnerLoop(), clang::CodeGen::CodeGenFunction::EmitWhileStmt(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::syntax::TokenBuffer::expandedTokens(), extendLeft(), clang::Declarator::ExtendWithDeclSpec(), clang::tooling::findSelectedASTNodes(), fixVarDeclWithArray(), clang::CIRGen::CIRGenFunction::generateCode(), clang::CXXTemporaryObjectExpr::getEndLoc(), clang::Decl::getEndLoc(), clang::NestedNameSpecifierLoc::getEndLoc(), clang::DeclaratorChunk::getFunction(), getGenericLambdaTemplateParameterList(), getLengthOnSingleLine(), getLiteralInfo(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CIRGen::CIRGenModule::getLoc(), clang::NestedNameSpecifierLoc::getLocalEndLoc(), clang::TemplateSpecializationTypeLoc::getRAngleLoc(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::ParmVarDecl::getSourceRange(), clang::TemplateTemplateParmDecl::getSourceRange(), clang::VerifyDiagnosticConsumer::HandleComment(), clang::ASTImporter::Import(), clang::ASTUnit::mapRangeFromPreamble(), clang::ASTUnit::mapRangeToPreamble(), clang::SemaHLSL::mergeParamModifierAttr(), clang::format::WhitespaceManager::Change::IsBeforeInFile::operator()(), clang::InitializationSequence::Perform(), populateExecutedLinesWithFunctionSignature(), clang::RawComment::RawComment(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToSubscriptGetCommon(), clang::Token::setAnnotationRange(), clang::ForStmt::setConditionVariable(), clang::IfStmt::setConditionVariable(), clang::SwitchStmt::setConditionVariable(), clang::WhileStmt::setConditionVariable(), clang::CXXScopeSpec::SetInvalid(), clang::ObjCMessageExpr::setSourceRange(), SuggestParentheses(), clang::Declarator::takeAttributesAppending(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), TryOrBuildParenListInitialization(), clang::ConversionFixItGenerator::tryToFixConversion(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
Definition at line 240 of file SourceLocation.h.
References isValid().
Referenced by clang::SemaObjC::CheckARCMethodDecl(), clang::SemaObjC::CheckMessageArgumentTypes(), clang::Sema::DeduceAutoType(), clang::syntax::TokenBuffer::expandedTokens(), extendLeft(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::Rewriter::ReplaceText(), and WalkUpFromCXXConstructExpr().
|
inline |
Definition at line 239 of file SourceLocation.h.
Referenced by clang::SemaObjC::ActOnAtEnd(), clang::Sema::ActOnFunctionDeclarator(), clang::ento::BugReport::addRange(), clang::ento::PathDiagnosticPiece::addRange(), clang::Sema::BuildCXXNew(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckMain(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::SemaObjC::CheckObjCConversion(), ConstructFixItRangeForUnusedCapture(), clang::CXXNewExpr::Create(), diagnoseObjCARCConversion(), clang::Sema::DiagnoseUnusedLambdaCapture(), emitStoresForConstant(), clang::tooling::findSelectedASTNodes(), clang::interp::InterpFrame::getCallRange(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CIRGen::CIRGenModule::getLoc(), getPointee2TypeText(), clang::getPointeeTypeText(), clang::ParmVarDecl::getSourceRange(), handleGlobalAttr(), isInvalid(), clang::CXXScopeSpec::SetInvalid(), clang::JSONNodeDumper::Visit(), and clang::TextNodeDumper::Visit().
|
inline |
Definition at line 246 of file SourceLocation.h.
References SourceRange(), and X.
|
inline |
Definition at line 242 of file SourceLocation.h.
References SourceRange(), and X.
| void SourceRange::print | ( | raw_ostream & | OS, |
| const SourceManager & | SM ) const |
Definition at line 134 of file SourceLocation.cpp.
References PrintDifference(), and SM.
Referenced by dump(), and printToString().
| LLVM_DUMP_METHOD std::string SourceRange::printToString | ( | const SourceManager & | SM | ) | const |
Definition at line 146 of file SourceLocation.cpp.
Referenced by clang::Sema::CheckConstraintSatisfaction(), printIndicesOfElementsToConstructJson(), and printPendingInitLoopJson().
|
inline |
Definition at line 236 of file SourceLocation.h.
References b.
Referenced by actOnOMPReductionKindClause(), clang::Sema::ActOnPackExpansion(), clang::InitializationSequence::Diagnose(), clang::Preprocessor::DiscardUntilEndOfDirective(), clang::BuiltinTypeLoc::expandBuiltinRange(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), and clang::TypoCorrection::setCorrectionRange().
|
inline |
Definition at line 237 of file SourceLocation.h.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), actOnOMPReductionKindClause(), clang::format::JavaScriptImportSorter::analyze(), clang::tooling::ExtractionSemicolonPolicy::compute(), clang::Preprocessor::DiscardUntilEndOfDirective(), clang::BuiltinTypeLoc::expandBuiltinRange(), extendLeft(), and extendRight().