clang 20.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.
Definition at line 213 of file SourceLocation.h.
|
default |
|
inline |
Definition at line 219 of file SourceLocation.h.
References E.
|
inline |
Definition at line 220 of file SourceLocation.h.
References E.
LLVM_DUMP_METHOD void SourceRange::dump | ( | const SourceManager & | SM | ) | const |
Definition at line 101 of file SourceLocation.cpp.
|
inline |
Definition at line 240 of file SourceLocation.h.
References E.
|
inline |
Definition at line 222 of file SourceLocation.h.
Referenced by clang::Sema::ActOnAttributedStmt(), clang::Sema::ActOnBaseSpecifier(), clang::Sema::ActOnComment(), clang::Sema::ActOnCXXNestedNameSpecifier(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), 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::CoverageSourceInfo::AddSkippedRange(), clang::ASTWriter::AddSourceRange(), clang::Sema::BuildArrayType(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBaseInitializer(), clang::SemaObjC::BuildClassMessage(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), 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::checkArgCount(), checkAvailabilityAttr(), clang::Sema::CheckCastAlign(), clang::Sema::CheckCompatibleReinterpretCast(), CheckConstraintSatisfaction(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckExceptionSpecCompatibility(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::sema::checkExprLifetimeImpl(), clang::Sema::CheckExtVectorCast(), checkIntToPointerCast(), clang::Sema::CheckLiteralOperatorDeclaration(), checkLiteralOperatorTemplateParameterList(), clang::Sema::CheckMain(), clang::Sema::CheckMatrixCast(), CheckMemorySizeofForComparison(), clang::SemaObjC::CheckMessageArgumentTypes(), clang::Sema::checkMSInheritanceAttrOnDefinition(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::SemaObjC::CheckObjCConversion(), checkObjCMethodX86VectorTypes(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), checkRangeForMacroArgExpansion(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), clang::Sema::CheckTypenameType(), checkTypeParamListConsistency(), clang::Sema::checkUnknownAnyCast(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::CheckVectorCast(), comparePiece(), 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::Sema::deduceVarTypeFromInitializer(), clang::InitializationSequence::Diagnose(), DiagnoseAccessPath(), clang::Sema::DiagnoseAlwaysNonNullPointer(), diagnoseBadCast(), DiagnoseCallingConvCast(), DiagnoseConstAssignment(), diagnoseDynamicExceptionSpecification(), clang::Sema::DiagnoseEqualityWithExtraParens(), diagnoseExtensionInIdentifier(), diagnoseInstanceReference(), diagnoseInvalidUnicodeCodepointInIdentifier(), DiagnoseInvisibleNamespace(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::SemaObjC::DiagnoseMultipleMethodInGlobalPool(), DiagnoseNullConversion(), diagnoseObjCARCConversion(), DiagnoseReinterpretUpDownCast(), clang::Sema::diagnoseTypo(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::Sema::DiagnoseUnknownTypeName(), diagnoseWellFormedUnsatisfiedConstraintExpr(), DiagUninitUse(), doRewriteToUTF8StringBoxedExpressionHelper(), clang::TextNodeDumper::dumpSourceRange(), clang::Sema::EnsureTemplateArgumentListConstraints(), clang::Preprocessor::EnterAnnotationToken(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::syntax::TokenBuffer::expandedTokens(), clang::CXXScopeSpec::Extend(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), clang::ASTReader::findPreprocessedEntitiesInRange(), clang::tooling::findSelectedASTNodes(), clang::DeclSpec::Finish(), GCRewriteFinalize(), clang::NestedNameSpecifierLoc::getBeginLoc(), clang::OpenACCClause::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::SemaOpenACC::OpenACCParsedClause::getBeginLoc(), clang::comments::Comment::getBeginLoc(), clang::Decl::getBeginLoc(), clang::RawComment::getBeginLoc(), clang::BuiltinTypeLoc::getBuiltinLoc(), GetDeclSpecTypeForDeclarator(), clang::NonTypeTemplateParmDecl::getDefaultArgumentLoc(), clang::DeclaratorChunk::getFunction(), getGenericLambdaTemplateParameterList(), getLambdaType(), clang::VariableArrayType::getLBracketLoc(), clang::DependentSizedArrayType::getLBracketLoc(), getLengthOnSingleLine(), getLiteralInfo(), clang::AttributeCommonInfo::getLoc(), clang::NestedNameSpecifierLoc::getLocalBeginLoc(), clang::Attr::getLocation(), clang::TemplateArgumentLoc::getLocation(), clang::MacroDefinitionRecord::getLocation(), clang::FunctionDecl::getParametersSourceRange(), clang::format::FormatToken::getPrecedence(), clang::ento::CallEvent::getProgramPoint(), clang::syntax::TreeBuilder::getRange(), getRangeForSplitTokens(), clang::Rewriter::getRangeSize(), clang::Rewriter::getRewrittenText(), clang::diff::SyntaxTree::getSourceRangeOffsets(), clang::Lexer::getSourceText(), clang::Sema::getTypeName(), clang::DeclSpec::getTypeSpecWidthLoc(), handleAvailabilityAttr(), clang::VerifyDiagnosticConsumer::HandleComment(), handleDeprecatedAttr(), HandleDestructionImpl(), handleDLLAttr(), handleFallThroughAttr(), clang::SemaRISCV::handleInterruptAttr(), handleNullableTypeAttr(), handleOpenCLUnrollHint(), handleVisibilityAttr(), clang::ASTImporter::Import(), clang::tooling::RenameOccurrences::initiate(), isPreprocessedEntityIfInFileID(), LookupMemberExpr(), TokenCollector::CollectPPExpansions::MacroExpands(), clang::detail::MacroExpansionRangeRecorder::MacroExpands(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), clang::NestedNameSpecifierLocBuilder::MakeTrivial(), mapDiagnosticRanges(), clang::ASTUnit::mapRangeFromPreamble(), clang::ASTUnit::mapRangeToPreamble(), maybeDiagnoseIDCharCompat(), maybeDiagnoseUTF8Homoglyph(), mergeInterfaceMethodToImpl(), clang::transformer::noopEdit(), objectifyExpr(), clang::format::WhitespaceManager::Change::IsBeforeInFile::operator()(), clang::BeforeThanCompare< SourceRange >::operator()(), overlapWithMacro(), clang::InitializationSequence::Perform(), clang::Sema::PerformObjectMemberConversion(), populateExecutedLinesWithFunctionSignature(), ProcessStmtAttribute(), clang::PPConditionalDirectiveRecord::rangeIntersectsConditionalDirective(), clang::RawComment::RawComment(), clang::ASTRecordReader::readNestedNameSpecifierLoc(), clang::TreeTransform< Derived >::RebuildArrayType(), clang::Sema::RebuildNestedNameSpecifierInCurrentInstantiation(), clang::Rewriter::ReplaceText(), clang::Sema::RequireCompleteDeclContext(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), rewriteToArraySubscriptSet(), rewriteToBoolLiteral(), rewriteToCharLiteral(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNSMacroDecl(), rewriteToNumberLiteral(), rewriteToNumericBoxedExpression(), rewriteToSubscriptGetCommon(), clang::Token::setAnnotationRange(), clang::ForStmt::setConditionVariable(), clang::IfStmt::setConditionVariable(), clang::WhileStmt::setConditionVariable(), clang::SwitchStmt::setConditionVariable(), clang::CXXScopeSpec::SetInvalid(), clang::ObjCMessageExpr::setSourceRange(), SuggestParentheses(), clang::takeAndConcatenateAttrs(), TryOrBuildParenListInitialization(), TryReinterpretCast(), TryStaticCast(), TryStaticDowncast(), TryStaticImplicitCast(), TryStaticMemberPointerUpcast(), clang::ConversionFixItGenerator::tryToFixConversion(), warnAboutAmbiguousFunction(), and WarnUndefinedMethod().
|
inline |
Definition at line 223 of file SourceLocation.h.
References E.
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::CoverageSourceInfo::AddSkippedRange(), clang::ASTWriter::AddSourceRange(), clang::transformer::after(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), buildImplicitMap(), buildLambdaCaptureFixit(), clang::Sema::BuildLambdaExpr(), buildLambdaThisCaptureFixit(), clang::Sema::BuildMemberInitializer(), clang::SemaObjC::BuildObjCNumericLiteral(), clang::Preprocessor::CheckEndOfDirective(), CheckMemorySizeofForComparison(), clang::Sema::CheckPureMethod(), checkRangeForMacroArgExpansion(), clang::Sema::CheckTemplateTypeArgument(), comparePiece(), clang::tooling::ExtractionSemicolonPolicy::compute(), ConvertDeducedTemplateArgument(), ConvertDeducedTemplateArguments(), convertTokenRangeToCharRange(), clang::tooling::CodeRangeASTSelection::create(), clang::InitializationKind::CreateCast(), clang::InitializationKind::CreateCStyleCast(), clang::InitializationKind::CreateFunctionalCast(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::Sema::DiagnoseEqualityWithExtraParens(), DiagnoseInvalidRedeclaration(), clang::TextNodeDumper::dumpSourceRange(), clang::Preprocessor::EnterAnnotationToken(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::syntax::TokenBuffer::expandedTokens(), extendLeft(), clang::Declarator::ExtendWithDeclSpec(), clang::ASTReader::findPreprocessedEntitiesInRange(), clang::tooling::findSelectedASTNodes(), fixVarDeclWithArray(), GCRewriteFinalize(), clang::NestedNameSpecifierLoc::getEndLoc(), clang::OpenACCClause::getEndLoc(), clang::SemaOpenACC::OpenACCParsedClause::getEndLoc(), clang::comments::Comment::getEndLoc(), clang::Decl::getEndLoc(), clang::CXXConstructExpr::getEndLoc(), clang::CXXTemporaryObjectExpr::getEndLoc(), clang::RawComment::getEndLoc(), clang::DeclaratorChunk::getFunction(), getGenericLambdaTemplateParameterList(), getLengthOnSingleLine(), getLiteralInfo(), clang::NestedNameSpecifierLoc::getLocalEndLoc(), clang::FunctionDecl::getParametersSourceRange(), clang::format::FormatToken::getPrecedence(), clang::syntax::TreeBuilder::getRange(), getRangeForSplitTokens(), clang::Rewriter::getRangeSize(), clang::VariableArrayType::getRBracketLoc(), clang::DependentSizedArrayType::getRBracketLoc(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::Rewriter::getRewrittenText(), clang::ParmVarDecl::getSourceRange(), clang::TagDecl::getSourceRange(), clang::TemplateDecl::getSourceRange(), clang::TemplateTemplateParmDecl::getSourceRange(), clang::diff::SyntaxTree::getSourceRangeOffsets(), clang::Lexer::getSourceText(), clang::VerifyDiagnosticConsumer::HandleComment(), handleFallThroughAttr(), clang::format::FormatToken::hasWhitespaceBefore(), clang::ASTImporter::Import(), TokenCollector::CollectPPExpansions::MacroExpands(), clang::detail::MacroExpansionRangeRecorder::MacroExpands(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), clang::NestedNameSpecifierLocBuilder::MakeTrivial(), mapDiagnosticRanges(), clang::ASTUnit::mapRangeFromPreamble(), clang::ASTUnit::mapRangeToPreamble(), clang::SemaHLSL::mergeParamModifierAttr(), clang::format::WhitespaceManager::Change::IsBeforeInFile::operator()(), overlapWithMacro(), clang::InitializationSequence::Perform(), populateExecutedLinesWithFunctionSignature(), clang::PPConditionalDirectiveRecord::rangeIntersectsConditionalDirective(), clang::RawComment::RawComment(), clang::ASTRecordReader::readNestedNameSpecifierLoc(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToSubscriptGetCommon(), clang::Token::setAnnotationRange(), clang::ForStmt::setConditionVariable(), clang::IfStmt::setConditionVariable(), clang::WhileStmt::setConditionVariable(), clang::SwitchStmt::setConditionVariable(), clang::CXXScopeSpec::SetInvalid(), clang::ObjCMessageExpr::setSourceRange(), SuggestParentheses(), clang::takeAndConcatenateAttrs(), clang::Declarator::takeAttributes(), TryOrBuildParenListInitialization(), clang::ConversionFixItGenerator::tryToFixConversion(), clang::Sema::tryToRecoverWithCall(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and warnAboutAmbiguousFunction().
|
inline |
Definition at line 229 of file SourceLocation.h.
References isValid().
Referenced by clang::transformer::after(), clang::SemaObjC::CheckARCMethodDecl(), clang::SemaObjC::CheckMessageArgumentTypes(), clang::Sema::DeduceAutoType(), clang::syntax::TokenBuffer::expandedTokens(), extendLeft(), clang::ASTReader::findPreprocessedEntitiesInRange(), clang::PreprocessingRecord::getPreprocessedEntitiesInRange(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::Lexer::getSourceText(), mapDiagnosticRanges(), clang::PPConditionalDirectiveRecord::rangeIntersectsConditionalDirective(), clang::Rewriter::ReplaceText(), and clang::syntax::TokenBuffer::spelledForExpanded().
|
inline |
Definition at line 228 of file SourceLocation.h.
References E, and clang::SourceLocation::isValid().
Referenced by clang::SemaObjC::ActOnAtEnd(), clang::Sema::ActOnCXXNestedNameSpecifier(), clang::Sema::ActOnFunctionDeclarator(), clang::ento::PathDiagnosticPiece::addRange(), clang::ento::BugReport::addRange(), clang::Sema::BuildCXXNew(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckMain(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::SemaObjC::CheckObjCConversion(), clang::CXXNewExpr::Create(), diagnoseObjCARCConversion(), clang::tooling::findSelectedASTNodes(), clang::interp::InterpFrame::getCallRange(), clang::CXXConstructExpr::getEndLoc(), getPointeeTypeText(), clang::syntax::TreeBuilder::getRange(), clang::ParmVarDecl::getSourceRange(), handleGlobalAttr(), isInvalid(), clang::SourceMgrAdapter::mapRange(), clang::ASTReader::ReadSkippedRange(), clang::CXXScopeSpec::SetInvalid(), clang::TextNodeDumper::Visit(), and clang::JSONNodeDumper::Visit().
|
inline |
Definition at line 235 of file SourceLocation.h.
|
inline |
Definition at line 231 of file SourceLocation.h.
void SourceRange::print | ( | raw_ostream & | OS, |
const SourceManager & | SM | ||
) | const |
Definition at line 136 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 148 of file SourceLocation.cpp.
Referenced by printIndicesOfElementsToConstructJson(), and printPendingInitLoopJson().
|
inline |
Definition at line 225 of file SourceLocation.h.
References b.
Referenced by clang::Sema::ActOnCXXNestedNameSpecifier(), actOnOMPReductionKindClause(), clang::Sema::ActOnPackExpansion(), clang::InitializationSequence::Diagnose(), diagnoseInstanceReference(), clang::Preprocessor::DiscardUntilEndOfDirective(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::CXXScopeSpec::Extend(), extendLeft(), extendRight(), FixDigraph(), clang::ClassTemplateSpecializationDecl::getSourceRange(), clang::ClassTemplatePartialSpecializationDecl::getSourceRange(), clang::VarTemplateSpecializationDecl::getSourceRange(), clang::VarTemplatePartialSpecializationDecl::getSourceRange(), TokenCollector::CollectPPExpansions::MacroExpands(), clang::Lexer::makeFileCharRange(), clang::CXXScopeSpec::MakeSuper(), clang::TypoCorrection::setCorrectionRange(), and clang::DeclSpec::SetTypeSpecWidth().
|
inline |
Definition at line 226 of file SourceLocation.h.
References E.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), actOnOMPReductionKindClause(), clang::format::JavaScriptImportSorter::analyze(), clang::tooling::ExtractionSemicolonPolicy::compute(), clang::Preprocessor::DiscardUntilEndOfDirective(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::CXXScopeSpec::Extend(), extendLeft(), extendRight(), FixDigraph(), clang::ClassTemplateSpecializationDecl::getSourceRange(), clang::VarTemplateSpecializationDecl::getSourceRange(), clang::Lexer::makeFileCharRange(), clang::CXXScopeSpec::MakeSuper(), clang::comments::HTMLStartTagComment::setAttrs(), clang::Declarator::setDecompositionBindings(), clang::SemaOpenACC::OpenACCParsedClause::setEndLoc(), clang::comments::HTMLStartTagComment::setGreaterLoc(), and clang::DeclSpec::SetTypeSpecWidth().