clang
9.0.0
|
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 |
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 196 of file SourceLocation.h.
|
default |
|
inline |
Definition at line 202 of file SourceLocation.h.
|
inline |
Definition at line 203 of file SourceLocation.h.
LLVM_DUMP_METHOD void SourceRange::dump | ( | const SourceManager & | SM | ) | const |
Definition at line 82 of file SourceLocation.cpp.
|
inline |
Definition at line 205 of file SourceLocation.h.
Referenced by clang::Sema::ActOnBaseSpecifier(), clang::Sema::ActOnComment(), clang::Sema::ActOnMemberAccessExpr(), clang::Sema::ActOnOpenMPDeclareSimdDirective(), clang::Sema::AddCFAuditedAttribute(), clang::ASTContext::addComment(), addConstevalToLambdaDeclSpecifier(), addFixitForObjCARCConversion(), clang::PreprocessingRecord::addPreprocessedEntity(), clang::ASTWriter::AddSourceRange(), clang::format::AffectedRangeManager::affectsCharSourceRange(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), clang::Sema::BuildArrayType(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildClassMessage(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildMemberInitializer(), clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCDictionaryLiteral(), clang::Sema::BuildPseudoDestructorExpr(), clang::Sema::CheckCastAlign(), clang::Sema::CheckCompatibleReinterpretCast(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckExceptionSpecCompatibility(), clang::Sema::CheckFriendTypeDecl(), clang::Sema::checkInitializerLifetime(), checkLiteralOperatorTemplateParameterList(), CheckMemorySizeofForComparison(), clang::Sema::CheckMessageArgumentTypes(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::Sema::CheckObjCConversion(), checkObjCMethodX86VectorTypes(), clang::Sema::CheckSpecifiedExceptionType(), clang::Sema::CheckTemplateArgument(), clang::Sema::checkUnknownAnyCast(), clang::Sema::CheckUsingDeclQualifier(), clang::arcmt::CapturedDiagList::clearDiagnostic(), CompactMacroExpandedPieces(), comparePiece(), clang::tooling::CodeRangeASTSelection::create(), clang::InitializationKind::CreateCast(), clang::InitializationKind::CreateCStyleCast(), clang::InitializationKind::CreateFunctionalCast(), createTextRegion(), clang::Parser::Diag(), clang::Sema::DiagnoseAlwaysNonNullPointer(), DiagnoseBadFunctionCast(), DiagnoseCallingConvCast(), DiagnoseConstAssignment(), diagnoseDynamicExceptionSpecification(), diagnoseInstanceReference(), clang::Sema::DiagnoseMultipleMethodInGlobalPool(), DiagnoseNullConversion(), diagnoseObjCARCConversion(), DiagnoseReinterpretUpDownCast(), clang::Sema::diagnoseTypo(), clang::Sema::DiagnoseUnexpandedParameterPack(), DiagUninitUse(), doRewriteToUTF8StringBoxedExpressionHelper(), clang::TextNodeDumper::dumpSourceRange(), EmitAlphaCounter(), clang::CodeGen::CodeGenFunction::EmitOMPInnerLoop(), clang::Preprocessor::EnterAnnotationToken(), clang::BuiltinTypeLoc::expandBuiltinRange(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), clang::PreprocessingRecord::findMacroDefinition(), clang::ASTReader::findPreprocessedEntitiesInRange(), clang::tooling::findSelectedASTNodes(), GCRewriteFinalize(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::Lexer::getAsCharRange(), clang::ObjCBoxedExpr::getAtLoc(), clang::CharSourceRange::getBegin(), clang::CXXScopeSpec::getBeginLoc(), clang::CXXOperatorCallExpr::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::ObjCBoxedExpr::getBeginLoc(), clang::ObjCArrayLiteral::getBeginLoc(), clang::comments::Comment::getBeginLoc(), clang::CXXBaseSpecifier::getBeginLoc(), clang::ObjCDictionaryLiteral::getBeginLoc(), clang::Decl::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::CXXTypeidExpr::getBeginLoc(), clang::CXXUuidofExpr::getBeginLoc(), clang::Declarator::getBeginLoc(), clang::LambdaExpr::getBeginLoc(), clang::OffsetOfNode::getBeginLoc(), clang::CXXNewExpr::getBeginLoc(), clang::CXXNoexceptExpr::getBeginLoc(), getCastAwayConstnessCastKind(), GetDeclSpecTypeForDeclarator(), clang::SourceManager::getExpansionRange(), clang::DeclaratorChunk::getFunction(), getGenericLambdaTemplateParameterList(), clang::DependentFunctionTemplateSpecializationInfo::getLAngleLoc(), clang::VariableArrayType::getLBracketLoc(), clang::DependentSizedArrayType::getLBracketLoc(), getLengthOnSingleLine(), getLiteralInfo(), clang::ParsedAttr::getLoc(), clang::NestedNameSpecifierLoc::getLocalBeginLoc(), clang::Attr::getLocation(), clang::MacroDefinitionRecord::getLocation(), getMissingDeclaratorIdLoc(), clang::tooling::SymbolOccurrence::getNameRanges(), GetNSSetArgumentIndex(), clang::ento::CallEvent::getProgramPoint(), clang::NestedNameSpecifierLoc::getSourceRange(), clang::diff::SyntaxTree::getSourceRangeOffsets(), getStrlenExprArg(), clang::DeclSpec::getTypeSpecWidthLoc(), clang::VerifyDiagnosticConsumer::HandleComment(), clang::arcmt::CapturedDiagList::hasDiagnostic(), clang::html::HighlightRange(), clang::ASTImporter::Import(), clang::tooling::RenameOccurrences::initiate(), clang::PreprocessingRecord::isEntityInFileID(), isPreprocessedEntityIfInFileID(), clang::CodeGen::CodeGenFunction::LexicalScope::LexicalScope(), LookThroughTransitiveAssignmentsAndCommaOperators(), LookupMemberExpr(), clang::syntax::TokenCollector::CollectPPExpansions::MacroExpands(), clang::ASTUnit::mapRangeFromPreamble(), clang::ASTUnit::mapRangeToPreamble(), clang::Sema::MaybeSuggestAddingStaticToDecl(), objectifyExpr(), clang::format::WhitespaceManager::Change::IsBeforeInFile::operator()(), clang::BeforeThanCompare< SourceRange >::operator()(), clang::RawComment::parse(), clang::Parser::ParseTopLevelDecl(), clang::InitializationSequence::Perform(), clang::PseudoDestructorTypeStorage::PseudoDestructorTypeStorage(), clang::PPConditionalDirectiveRecord::rangeIntersectsConditionalDirective(), clang::RawComment::RawComment(), clang::TreeTransform< Derived >::RebuildCXXNoexceptExpr(), clang::Rewriter::RemoveText(), clang::Rewriter::ReplaceText(), clang::Sema::RequireCompleteDeclContext(), clang::comments::Sema::resolveParamCommandIndexes(), RewriteOneForwardClassDecl(), rewriteToArraySubscriptSet(), rewriteToBoolLiteral(), rewriteToCharLiteral(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNSMacroDecl(), rewriteToNumberLiteral(), rewriteToNumericBoxedExpression(), rewriteToSubscriptGetCommon(), clang::Token::setAnnotationRange(), clang::IfStmt::setConditionVariable(), clang::SwitchStmt::setConditionVariable(), clang::WhileStmt::setConditionVariable(), clang::ForStmt::setConditionVariable(), clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::CXXScopeSpec::SetInvalid(), clang::TypeofLikeTypeLoc< TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo >::setParensRange(), clang::UnaryTransformTypeLoc::setParensRange(), clang::AtomicTypeLoc::setParensRange(), clang::ObjCMessageExpr::setSourceRange(), SuggestParentheses(), takeDeclAttributes(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), clang::TreeTransform< Derived >::TransformInitializer(), TryAddressSpaceCast(), TryReinterpretCast(), TryStaticDowncast(), TryStaticImplicitCast(), TryStaticMemberPointerUpcast(), clang::JSONNodeDumper::Visit(), and warnBracedScalarInit().
|
inline |
Definition at line 206 of file SourceLocation.h.
Referenced by clang::Sema::AddCFAuditedAttribute(), addConstevalToLambdaDeclSpecifier(), addFixitForObjCARCConversion(), clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), clang::ASTWriter::AddSourceRange(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCXXNamedCast(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildMemberInitializer(), clang::Sema::BuildMemInitializer(), CheckAvailabilitySpecList(), clang::comments::Sema::checkBlockCommandEmptyParagraph(), clang::Preprocessor::CheckEndOfDirective(), CheckMemorySizeofForComparison(), clang::Sema::CheckPureMethod(), clang::arcmt::CapturedDiagList::clearDiagnostic(), CompactMacroExpandedPieces(), comparePiece(), clang::tooling::ExtractionSemicolonPolicy::compute(), ConvertDeducedTemplateArgument(), clang::tooling::CodeRangeASTSelection::create(), clang::InitializationKind::CreateCast(), clang::InitializationKind::CreateCStyleCast(), clang::InitializationKind::CreateFunctionalCast(), createTextRegion(), clang::Parser::Diag(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::TextNodeDumper::dumpSourceRange(), EmitAlphaCounter(), clang::CodeGen::CodeGenFunction::EmitOMPInnerLoop(), clang::Preprocessor::EnterAnnotationToken(), EvaluateDirectiveSubExpr(), clang::BuiltinTypeLoc::expandBuiltinRange(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), clang::ASTReader::findPreprocessedEntitiesInRange(), clang::tooling::findSelectedASTNodes(), GCRewriteFinalize(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::Lexer::getAsCharRange(), clang::CXXScalarValueInitExpr::getBeginLoc(), clang::Decl::getBodyRBrace(), clang::CharSourceRange::getEnd(), clang::CXXScopeSpec::getEndLoc(), clang::CXXOperatorCallExpr::getEndLoc(), clang::TypeLoc::getEndLoc(), clang::ObjCBoxedExpr::getEndLoc(), clang::ObjCArrayLiteral::getEndLoc(), clang::comments::Comment::getEndLoc(), clang::CXXBaseSpecifier::getEndLoc(), clang::ObjCDictionaryLiteral::getEndLoc(), clang::Decl::getEndLoc(), clang::DeclSpec::getEndLoc(), clang::CXXTypeidExpr::getEndLoc(), clang::CXXUuidofExpr::getEndLoc(), clang::Declarator::getEndLoc(), clang::OffsetOfNode::getEndLoc(), clang::CXXNewExpr::getEndLoc(), clang::CXXNoexceptExpr::getEndLoc(), clang::SourceManager::getExpansionRange(), clang::DeclaratorChunk::getFunction(), getGenericLambdaTemplateParameterList(), getLengthOnSingleLine(), getLiteralInfo(), clang::NestedNameSpecifierLoc::getLocalEndLoc(), getMissingDeclaratorIdLoc(), clang::DependentFunctionTemplateSpecializationInfo::getRAngleLoc(), clang::VariableArrayType::getRBracketLoc(), clang::DependentSizedArrayType::getRBracketLoc(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::ParmVarDecl::getSourceRange(), clang::ClassTemplateSpecializationDecl::getSourceRange(), clang::TagDecl::getSourceRange(), clang::diff::SyntaxTree::getSourceRangeOffsets(), clang::format::FormatToken::getStartOfNonWhitespace(), getStrlenExprArg(), clang::VerifyDiagnosticConsumer::HandleComment(), clang::arcmt::CapturedDiagList::hasDiagnostic(), clang::html::HighlightRange(), clang::ASTImporter::Import(), clang::PreprocessingRecord::isEntityInFileID(), LookupMemberExprInRecord(), clang::syntax::TokenCollector::CollectPPExpansions::MacroExpands(), clang::ASTUnit::mapRangeFromPreamble(), clang::ASTUnit::mapRangeToPreamble(), clang::InitializationSequence::Perform(), clang::PPConditionalDirectiveRecord::rangeIntersectsConditionalDirective(), clang::RawComment::RawComment(), clang::TreeTransform< Derived >::RebuildCXXNoexceptExpr(), clang::Rewriter::ReplaceText(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToSubscriptGetCommon(), clang::Token::setAnnotationRange(), clang::comments::HTMLStartTagComment::setAttrs(), clang::IfStmt::setConditionVariable(), clang::SwitchStmt::setConditionVariable(), clang::WhileStmt::setConditionVariable(), clang::ForStmt::setConditionVariable(), clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::CXXScopeSpec::SetInvalid(), clang::TypeofLikeTypeLoc< TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo >::setParensRange(), clang::UnaryTransformTypeLoc::setParensRange(), clang::AtomicTypeLoc::setParensRange(), clang::ObjCMessageExpr::setSourceRange(), SuggestParentheses(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), clang::TreeTransform< Derived >::TransformInitializer(), clang::Sema::tryToRecoverWithCall(), clang::JSONNodeDumper::Visit(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), warnBracedScalarInit(), and clang::CodeGen::CodeGenFunction::LexicalScope::~LexicalScope().
|
inline |
Definition at line 212 of file SourceLocation.h.
Referenced by clang::Sema::CheckARCMethodDecl(), clang::Sema::CheckMessageArgumentTypes(), clang::arcmt::CapturedDiagList::clearDiagnostic(), extendLeft(), extendRight(), clang::ASTReader::findPreprocessedEntitiesInRange(), clang::PreprocessingRecord::getPreprocessedEntitiesInRange(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::arcmt::CapturedDiagList::hasDiagnostic(), clang::PreprocessingRecord::isEntityInFileID(), clang::PPConditionalDirectiveRecord::rangeIntersectsConditionalDirective(), clang::Rewriter::ReplaceText(), and SetupFixedPointError().
|
inline |
Definition at line 211 of file SourceLocation.h.
References clang::SourceLocation::isValid().
Referenced by clang::ento::BugReport::addRange(), clang::ento::PathDiagnosticPiece::addRange(), clang::Sema::BuildCXXNew(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildLambdaExpr(), clang::Sema::CheckConversionDeclarator(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::Sema::CheckObjCConversion(), clang::CXXNewExpr::Create(), diagnoseObjCARCConversion(), clang::PreprocessingRecord::findMacroDefinition(), clang::tooling::findSelectedASTNodes(), clang::CXXScalarValueInitExpr::getBeginLoc(), clang::ParmVarDecl::getSourceRange(), clang::CXXScopeSpec::isEmpty(), clang::PreprocessingRecord::isEntityInFileID(), clang::CharSourceRange::isValid(), clang::ento::PathDiagnosticLocation::PathDiagnosticLocation(), clang::ASTReader::ReadSkippedRange(), clang::ento::mpi::MPIBugReporter::reportDoubleNonblocking(), clang::ento::mpi::MPIBugReporter::reportUnmatchedWait(), clang::CXXScopeSpec::SetInvalid(), clang::TextNodeDumper::Visit(), and clang::JSONNodeDumper::Visit().
|
inline |
Definition at line 218 of file SourceLocation.h.
|
inline |
Definition at line 214 of file SourceLocation.h.
void SourceRange::print | ( | raw_ostream & | OS, |
const SourceManager & | SM | ||
) | const |
Definition at line 117 of file SourceLocation.cpp.
LLVM_DUMP_METHOD std::string SourceRange::printToString | ( | const SourceManager & | SM | ) | const |
Definition at line 129 of file SourceLocation.cpp.
|
inline |
Definition at line 208 of file SourceLocation.h.
References b.
Referenced by clang::Sema::ActOnPackExpansion(), addContextSensitiveTypeNullability(), diagnoseDynamicExceptionSpecification(), diagnoseInstanceReference(), clang::Preprocessor::DiscardUntilEndOfDirective(), clang::BuiltinTypeLoc::expandBuiltinRange(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), FixDigraph(), clang::CharSourceRange::setBegin(), clang::CXXScopeSpec::setBeginLoc(), clang::TypoCorrection::setCorrectionRange(), clang::CXXScopeSpec::SetInvalid(), clang::Declarator::SetRangeBegin(), clang::DeclSpec::SetRangeStart(), and clang::TypeLocReader::VisitArrayTypeLoc().
|
inline |
Definition at line 209 of file SourceLocation.h.
Referenced by addContextSensitiveTypeNullability(), clang::tooling::ExtractionSemicolonPolicy::compute(), diagnoseDynamicExceptionSpecification(), clang::Preprocessor::DiscardUntilEndOfDirective(), clang::BuiltinTypeLoc::expandBuiltinRange(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), FixDigraph(), clang::CXXScalarValueInitExpr::getBeginLoc(), clang::DependentAddressSpaceTypeLoc::getLocalSourceRange(), clang::comments::HTMLStartTagComment::setAttrs(), clang::CharSourceRange::setEnd(), clang::CXXScopeSpec::setEndLoc(), clang::comments::HTMLStartTagComment::setGreaterLoc(), clang::CXXScopeSpec::SetInvalid(), clang::DeclSpec::SetRangeEnd(), clang::Declarator::SetRangeEnd(), and clang::TypeLocReader::VisitArrayTypeLoc().