clang  14.0.0git
Public Member Functions | List of all members
clang::SourceRange Class Reference

A trivial tuple used to represent a source range. More...

#include "clang/Basic/SourceLocation.h"

Inheritance diagram for clang::SourceRange:
Inheritance graph
[legend]

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
 

Detailed Description

A trivial tuple used to represent a source range.

Definition at line 212 of file SourceLocation.h.

Constructor & Destructor Documentation

◆ SourceRange() [1/3]

clang::SourceRange::SourceRange ( )
default

◆ SourceRange() [2/3]

clang::SourceRange::SourceRange ( SourceLocation  loc)
inline

Definition at line 218 of file SourceLocation.h.

◆ SourceRange() [3/3]

clang::SourceRange::SourceRange ( SourceLocation  begin,
SourceLocation  end 
)
inline

Definition at line 219 of file SourceLocation.h.

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void SourceRange::dump ( const SourceManager SM) const

Definition at line 101 of file SourceLocation.cpp.

◆ fullyContains()

bool clang::SourceRange::fullyContains ( const SourceRange other) const
inline

Definition at line 239 of file SourceLocation.h.

◆ getBegin()

SourceLocation clang::SourceRange::getBegin ( ) const
inline

Definition at line 221 of file SourceLocation.h.

Referenced by clang::Sema::ActOnAttributedStmt(), clang::Sema::ActOnBaseSpecifier(), clang::Sema::ActOnComment(), clang::Sema::ActOnOpenMPDeclareSimdDirective(), clang::Sema::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::ASTContext::addComment(), clang::PreprocessingRecord::addPreprocessedEntity(), clang::Sema::BuildArrayType(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildClassMessage(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), buildLambdaCaptureFixit(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildMemberInitializer(), clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCDictionaryLiteral(), clang::Sema::BuildPseudoDestructorExpr(), clang::Sema::CheckAddressOfOperand(), clang::Sema::CheckAltivecInitFromScalar(), clang::Sema::CheckCastAlign(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckExceptionSpecCompatibility(), clang::Sema::CheckExtVectorCast(), clang::Sema::CheckFriendTypeDecl(), clang::Sema::checkInitializerLifetime(), checkIntToPointerCast(), clang::Sema::CheckLiteralOperatorDeclaration(), checkLiteralOperatorTemplateParameterList(), clang::Sema::CheckMatrixCast(), clang::Sema::CheckMessageArgumentTypes(), clang::Sema::CheckObjCConversion(), checkObjCMethodX86VectorTypes(), clang::Sema::checkOpenMPDeclareVariantFunction(), clang::Sema::CheckTemplateArgument(), clang::Sema::checkUnknownAnyCast(), clang::Sema::CheckVectorCast(), comparePiece(), clang::tooling::CodeRangeASTSelection::create(), clang::InitializationKind::CreateCast(), clang::InitializationKind::CreateCStyleCast(), clang::InitializationKind::CreateFunctionalCast(), clang::Sema::createLambdaClosureType(), createTextRegion(), clang::Sema::CXXCheckConditionalOperands(), DiagnoseCallingConvCast(), clang::Sema::DiagnoseEqualityWithExtraParens(), diagnoseInstanceReference(), clang::Sema::DiagnoseMultipleMethodInGlobalPool(), DiagnoseReinterpretUpDownCast(), clang::Sema::diagnoseTypo(), clang::Sema::DiagnoseUnexpandedParameterPack(), doRewriteToUTF8StringBoxedExpressionHelper(), clang::TextNodeDumper::dumpSourceRange(), clang::Sema::EnsureTemplateArgumentListConstraints(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::syntax::TokenBuffer::expandedTokens(), clang::CXXScopeSpec::Extend(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), clang::tooling::findSelectedASTNodes(), GCRewriteFinalize(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::RawComment::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::comments::Comment::getBeginLoc(), clang::NestedNameSpecifierLoc::getBeginLoc(), clang::Decl::getBeginLoc(), clang::LambdaExpr::getBeginLoc(), clang::BuiltinTypeLoc::getBuiltinLoc(), GetDeclSpecTypeForDeclarator(), clang::NonTypeTemplateParmDecl::getDefaultArgumentLoc(), clang::DeclaratorChunk::getFunction(), getGenericLambdaTemplateParameterList(), clang::DependentFunctionTemplateSpecializationInfo::getLAngleLoc(), clang::VariableArrayType::getLBracketLoc(), clang::DependentSizedArrayType::getLBracketLoc(), getLengthOnSingleLine(), getLiteralInfo(), clang::AttributeCommonInfo::getLoc(), clang::NestedNameSpecifierLoc::getLocalBeginLoc(), clang::Attr::getLocation(), clang::MacroDefinitionRecord::getLocation(), clang::FunctionDecl::getParametersSourceRange(), clang::ento::CallEvent::getProgramPoint(), clang::DeclSpec::getTypeSpecWidthLoc(), clang::VerifyDiagnosticConsumer::HandleComment(), clang::ASTImporter::Import(), clang::tooling::RenameOccurrences::initiate(), isPreprocessedEntityIfInFileID(), clang::ASTUnit::mapRangeFromPreamble(), clang::ASTUnit::mapRangeToPreamble(), clang::format::WhitespaceManager::Change::IsBeforeInFile::operator()(), clang::BeforeThanCompare< SourceRange >::operator()(), populateExecutedLinesWithFunctionSignature(), clang::PseudoDestructorTypeStorage::PseudoDestructorTypeStorage(), clang::RawComment::RawComment(), clang::Sema::RebuildNestedNameSpecifierInCurrentInstantiation(), clang::Rewriter::ReplaceText(), clang::Sema::RequireCompleteDeclContext(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), clang::comments::Sema::resolveParamCommandIndexes(), 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::CXXScopeSpec::SetInvalid(), clang::ObjCMessageExpr::setSourceRange(), clang::Sema::startLambdaDefinition(), SuggestParentheses(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), TryReinterpretCast(), TryStaticCast(), TryStaticDowncast(), TryStaticImplicitCast(), and TryStaticMemberPointerUpcast().

◆ getEnd()

SourceLocation clang::SourceRange::getEnd ( ) const
inline

Definition at line 222 of file SourceLocation.h.

Referenced by clang::Sema::ActOnStartOfLambdaDefinition(), clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDelegatingInitializer(), buildLambdaCaptureFixit(), clang::Sema::BuildLambdaExpr(), buildLambdaThisCaptureFixit(), clang::Sema::BuildMemberInitializer(), clang::Sema::BuildObjCNumericLiteral(), clang::comments::Sema::checkBlockCommandEmptyParagraph(), clang::Preprocessor::CheckEndOfDirective(), clang::Sema::CheckPureMethod(), comparePiece(), clang::tooling::CodeRangeASTSelection::create(), clang::InitializationKind::CreateCast(), clang::InitializationKind::CreateCStyleCast(), clang::InitializationKind::CreateFunctionalCast(), createTextRegion(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::Sema::DiagnoseEqualityWithExtraParens(), clang::TextNodeDumper::dumpSourceRange(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::syntax::TokenBuffer::expandedTokens(), extendLeft(), clang::Declarator::ExtendWithDeclSpec(), clang::tooling::findSelectedASTNodes(), GCRewriteFinalize(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::RawComment::getEndLoc(), clang::comments::Comment::getEndLoc(), clang::NestedNameSpecifierLoc::getEndLoc(), clang::Decl::getEndLoc(), clang::CXXConstructExpr::getEndLoc(), clang::CXXTemporaryObjectExpr::getEndLoc(), clang::DeclaratorChunk::getFunction(), getGenericLambdaTemplateParameterList(), getLengthOnSingleLine(), getLiteralInfo(), clang::NestedNameSpecifierLoc::getLocalEndLoc(), clang::FunctionDecl::getParametersSourceRange(), clang::DependentFunctionTemplateSpecializationInfo::getRAngleLoc(), clang::VariableArrayType::getRBracketLoc(), clang::DependentSizedArrayType::getRBracketLoc(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::TemplateDecl::getSourceRange(), clang::ParmVarDecl::getSourceRange(), clang::TemplateTemplateParmDecl::getSourceRange(), clang::ClassTemplateSpecializationDecl::getSourceRange(), clang::TagDecl::getSourceRange(), clang::format::FormatToken::getStartOfNonWhitespace(), clang::VerifyDiagnosticConsumer::HandleComment(), clang::ASTImporter::Import(), LookupMemberExprInRecord(), clang::ASTUnit::mapRangeFromPreamble(), clang::ASTUnit::mapRangeToPreamble(), populateExecutedLinesWithFunctionSignature(), clang::RawComment::RawComment(), rewriteToArraySubscriptSet(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToSubscriptGetCommon(), clang::Token::setAnnotationRange(), clang::IfStmt::setConditionVariable(), clang::SwitchStmt::setConditionVariable(), clang::WhileStmt::setConditionVariable(), clang::ForStmt::setConditionVariable(), clang::CXXScopeSpec::SetInvalid(), clang::ObjCMessageExpr::setSourceRange(), SuggestParentheses(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().

◆ isInvalid()

bool clang::SourceRange::isInvalid ( ) const
inline

◆ isValid()

bool clang::SourceRange::isValid ( ) const
inline

◆ operator!=()

bool clang::SourceRange::operator!= ( const SourceRange X) const
inline

Definition at line 234 of file SourceLocation.h.

References clang::tooling::X().

◆ operator==()

bool clang::SourceRange::operator== ( const SourceRange X) const
inline

Definition at line 230 of file SourceLocation.h.

References clang::tooling::X().

◆ print()

void SourceRange::print ( raw_ostream &  OS,
const SourceManager SM 
) const

Definition at line 136 of file SourceLocation.cpp.

◆ printToString()

LLVM_DUMP_METHOD std::string SourceRange::printToString ( const SourceManager SM) const

Definition at line 148 of file SourceLocation.cpp.

◆ setBegin()

void clang::SourceRange::setBegin ( SourceLocation  b)
inline

◆ setEnd()

void clang::SourceRange::setEnd ( SourceLocation  e)
inline

The documentation for this class was generated from the following files: