clang 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::SourceLocation Class Reference

Encodes a location in the source. More...

#include "clang/Basic/SourceLocation.h"

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

Public Types

using UIntTy = uint32_t
 
using IntTy = int32_t
 

Public Member Functions

bool isFileID () const
 
bool isMacroID () const
 
bool isValid () const
 Return true if this is a valid SourceLocation object.
 
bool isInvalid () const
 
SourceLocation getLocWithOffset (IntTy Offset) const
 Return a source location with the specified offset from this SourceLocation.
 
UIntTy getRawEncoding () const
 When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it.
 
void * getPtrEncoding () const
 When a SourceLocation itself cannot be used, this returns an (opaque) pointer encoding for it.
 
unsigned getHashValue () const
 
void print (raw_ostream &OS, const SourceManager &SM) const
 
std::string printToString (const SourceManager &SM) const
 
void dump (const SourceManager &SM) const
 

Static Public Member Functions

static SourceLocation getFromRawEncoding (UIntTy Encoding)
 Turn a raw encoding of a SourceLocation object into a real SourceLocation.
 
static SourceLocation getFromPtrEncoding (const void *Encoding)
 Turn a pointer encoding of a SourceLocation object back into a real SourceLocation.
 
static bool isPairOfFileLocations (SourceLocation Start, SourceLocation End)
 

Friends

class ASTReader
 
class ASTWriter
 
class SourceManager
 
struct llvm::FoldingSetTrait< SourceLocation, void >
 
class SourceLocationEncoding
 

Detailed Description

Encodes a location in the source.

The SourceManager can decode this to get at the full include stack, line and column information.

Technically, a source location is simply an offset into the manager's view of the input source, which is all input buffers (including macro expansions) concatenated in an effectively arbitrary order. The manager actually maintains two blocks of input buffers. One, starting at offset 0 and growing upwards, contains all buffers from this module. The other, starting at the highest possible offset and growing downwards, contains buffers of loaded modules.

In addition, one bit of SourceLocation is used for quick access to the information whether the location is in a file or a macro expansion.

It is important that this type remains small. It is currently 32 bits wide.

Definition at line 88 of file SourceLocation.h.

Member Typedef Documentation

◆ IntTy

Definition at line 97 of file SourceLocation.h.

◆ UIntTy

Definition at line 96 of file SourceLocation.h.

Member Function Documentation

◆ dump()

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

Definition at line 96 of file SourceLocation.cpp.

References print(), and SM.

Referenced by clang::FullSourceLoc::dump().

◆ getFromPtrEncoding()

static SourceLocation clang::SourceLocation::getFromPtrEncoding ( const void *  Encoding)
inlinestatic

Turn a pointer encoding of a SourceLocation object back into a real SourceLocation.

Definition at line 174 of file SourceLocation.h.

References getFromRawEncoding().

Referenced by clang::ImplicitCallPoint::getLocation().

◆ getFromRawEncoding()

static SourceLocation clang::SourceLocation::getFromRawEncoding ( UIntTy  Encoding)
inlinestatic

◆ getHashValue()

unsigned SourceLocation::getHashValue ( ) const

◆ getLocWithOffset()

SourceLocation clang::SourceLocation::getLocWithOffset ( IntTy  Offset) const
inline

Return a source location with the specified offset from this SourceLocation.

Definition at line 137 of file SourceLocation.h.

References ID.

Referenced by clang::Sema::ActOnComment(), clang::Sema::ActOnIfStmt(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnStartNamespaceDef(), clang::comments::Sema::actOnVerbatimLine(), clang::html::AddHeaderFooterInternalBuiltinCSS(), clang::Lexer::AdvanceToTokenCharacter(), applyRewrite(), atOrBeforeSeparation(), clang::TokenConcatenation::AvoidConcat(), buildLambdaCaptureFixit(), clang::Sema::CheckAssignmentOperands(), CheckMoveOnConstruction(), checkRangeForMacroArgExpansion(), ConvertBackendLocation(), clang::markup::EmitRange(), clang::syntax::Token::endLocation(), clang::Preprocessor::EnterSourceFile(), clang::ASTReader::FindFileRegionDecls(), clang::arcmt::trans::findLocationAfterSemi(), clang::Lexer::findLocationAfterToken(), findPreviousTokenStart(), FixDigraph(), fixLocalVarDeclWithSpan(), fixVarDeclWithArray(), getBeginningOfFileToken(), clang::Lexer::GetBeginningOfToken(), clang::comments::BlockCommandComment::getCommandNameBeginLoc(), clang::Token::getEndLoc(), clang::edit::Commit::Edit::getFileLocation(), clang::edit::Commit::Edit::getFileRange(), UUCAddAssignGadget::getFixits(), clang::RawComment::getFormattedLines(), clang::SourceManager::getImmediateSpellingLoc(), clang::edit::Commit::Edit::getInsertFromRange(), getLiteralInfo(), clang::ASTUnit::getLocation(), clang::Lexer::getLocForEndOfToken(), clang::SourceManager::getMacroArgExpandedLocation(), GetMappedTokenLoc(), clang::comments::HTMLStartTagComment::Attribute::getNameLocEnd(), clang::SourceManager::getPresumedLoc(), clang::Lexer::getSourceLocation(), getStandardSelLoc(), clang::comments::HTMLTagComment::getTagNameSourceRange(), clang::ScratchBuffer::getToken(), clang::SourceMgrAdapter::handleDiag(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), isEmptyARCMTMacroStatement(), clang::detail::MacroExpansionRangeRecorder::MacroExpands(), clang::format::Environment::make(), clang::SourceMgrAdapter::mapLocation(), clang::ASTUnit::mapLocationFromPreamble(), clang::ASTUnit::mapLocationToPreamble(), ParseDirective(), clang::comments::Parser::parseInlineCommand(), clang::SemaObjC::ParseObjCSelectorExpression(), clang::format::WhitespaceManager::replaceWhitespaceInToken(), rewriteToNSEnumDecl(), rewriteToNSMacroDecl(), rewriteToObjCProperty(), skipWhitespaceAndNewline(), clang::Preprocessor::SplitToken(), clang::BackendConsumer::SrcMgrDiagHandler(), clang::tooling::SymbolOccurrence::SymbolOccurrence(), clang::SourceManager::translateLineCol(), clang::Sema::tryToRecoverWithCall(), and updateConsecutiveMacroArgTokens().

◆ getPtrEncoding()

void * clang::SourceLocation::getPtrEncoding ( ) const
inline

When a SourceLocation itself cannot be used, this returns an (opaque) pointer encoding for it.

This should only be passed to SourceLocation::getFromPtrEncoding, it should not be inspected directly.

Definition at line 166 of file SourceLocation.h.

References getRawEncoding().

◆ getRawEncoding()

UIntTy clang::SourceLocation::getRawEncoding ( ) const
inline

◆ isFileID()

bool clang::SourceLocation::isFileID ( ) const
inline

◆ isInvalid()

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

Definition at line 114 of file SourceLocation.h.

References ID.

Referenced by clang::Sema::ActOnBaseSpecifier(), clang::Sema::ActOnCaseStmt(), clang::Sema::ActOnCXXForRangeStmt(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendTypeDecl(), clang::Sema::ActOnInitList(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOpenMPDefaultmapClause(), clang::SemaOpenMP::ActOnOpenMPDeviceClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPGrainsizeClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPNumTasksClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::ActOnOpenMPScheduleClause(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnReturnStmt(), clang::Sema::ActOnStringLiteral(), clang::Sema::ActOnTemplateIdType(), clang::Sema::ActOnTemplateTemplateParameter(), clang::Sema::ActOnUsingDeclaration(), addEdgeToPath(), clang::ASTUnit::addFileLevelDecl(), clang::Declarator::AddTypeInfo(), adjustColumnPos(), clang::SemaObjC::BuildClassMessage(), clang::Sema::BuildCXXForRangeStmt(), clang::SemaObjC::BuildInstanceMessage(), BuildNonArrayForRange(), clang::Sema::BuildTypeConstraint(), checkAllProps(), CheckConstexprFunctionStmt(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExplicitlyDefaultedComparison(), CheckIdentityFieldAssignment(), clang::Sema::CheckImplicitConversion(), checkModuleImportContext(), checkNullabilityConsistency(), checkObjCMethodX86VectorTypes(), clang::SemaOpenMP::CheckOMPRequiresDecl(), checkReturnStmtInCoroutine(), clang::Sema::CheckShadow(), clang::Sema::CheckSpecializationInstantiationRedecl(), checkTypeParamListConsistency(), compareCrossTUSourceLocs(), clang::Lexer::ComputePreamble(), ConvertDeclSpecToType(), createAttributeInsertion(), clang::CodeGen::CGDebugInfo::CreateMacro(), clang::CodeGen::CGDebugInfo::CreateTempMacroFile(), clang::Sema::DiagnoseEqualityWithExtraParens(), clang::Sema::diagnoseIgnoredQualifiers(), DiagnoseInvalidRedeclaration(), diagnoseLogicalNotOnLHSofCheck(), clang::SemaObjC::diagnoseNullResettableSynthesizedSetters(), DiagnoseSelfAssignment(), clang::Sema::DiagnoseSentinelCalls(), clang::Sema::DiagnoseShadowingLambdaDecls(), DiagnoseStaticSpecifierRestrictions(), clang::VerifyDiagnosticConsumer::Directive::Directive(), DoMarkVarDeclReferenced(), clang::DiagnosticRenderer::emitDiagnostic(), clang::CodeGen::CGDebugInfo::EmitFunctionDecl(), clang::markup::EmitLocation(), clang::SemaObjC::EmitRelatedResultTypeNoteForReturn(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::concepts::ExprRequirement::ExprRequirement(), clang::CXXScopeSpec::Extend(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), clang::api_notes::APINotesManager::findAPINotes(), clang::PPConditionalDirectiveRecord::findConditionalDirectiveRegionLoc(), clang::arcmt::trans::findLocationAfterSemi(), findPreviousTokenKind(), findPreviousTokenStart(), clang::syntax::TreeBuilder::findToken(), clang::DeclSpec::Finish(), GenerateFixForUnusedDecl(), clang::tooling::getAssociatedRange(), clang::CallExpr::getBeginLoc(), clang::CompoundLiteralExpr::getBeginLoc(), clang::InitListExpr::getBeginLoc(), clang::DesignatedInitExpr::Designator::getBeginLoc(), clang::BackendConsumer::getBestLocationFromDebugLoc(), clang::ModuleMap::getContainingModuleMapFileID(), getDeclaratorRange(), clang::TypeLoc::getEndLoc(), clang::CallExpr::getEndLoc(), clang::MemberExpr::getEndLoc(), clang::CXXTemporaryObjectExpr::getEndLoc(), clang::SrcMgr::ExpansionInfo::getExpansionLocEnd(), GetFullTypeForDeclarator(), clang::Preprocessor::getHeaderToIncludeForDiagnostics(), clang::Lexer::getIndentationForLine(), clang::Preprocessor::getLastMacroWithSpelling(), clang::ObjCTypeParamTypeLoc::getLocalSourceRange(), clang::ObjCObjectTypeLoc::getLocalSourceRange(), clang::Lexer::getLocForEndOfToken(), clang::SourceManager::getMacroArgExpandedLocation(), getNoteDiagForInvalidRedeclaration(), getNullabilityCompletenessCheckFileID(), clang::FunctionDecl::getParametersSourceRange(), getPosAsWritten(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getRawCommentForDeclNoCacheImpl(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::DeclaratorChunk::getSourceRange(), clang::ObjCTypeParamDecl::getSourceRange(), clang::SrcMgr::ExpansionInfo::getSpellingLoc(), getStandardSelLoc(), clang::SARIFDiagnosticPrinter::HandleDiagnostic(), clang::ASTImporter::Import(), clang::index::IndexingContext::indexTopLevelDecl(), clang::UsingDecl::isAccessDeclaration(), clang::UnresolvedUsingValueDecl::isAccessDeclaration(), clang::sema::FunctionScopeInfo::isCoroutine(), clang::DesignatedInitExpr::isDirectInit(), isEmptyARCMTMacroStatement(), clang::OMPClause::isImplicit(), IsInAnyMacroBody(), clang::SourceManager::isInMainFile(), clang::ASTUnit::isInMainFileID(), clang::ASTUnit::isInPreambleFileID(), isInvalid(), clang::SrcMgr::ExpansionInfo::isMacroArgExpansion(), isPreprocessedEntityIfInFileID(), clang::ASTReader::isPreprocessedEntityInFileID(), clang::Lexer::makeFileCharRange(), makeStandaloneDiagnostic(), mapDiagnosticRanges(), clang::ASTUnit::mapLocationFromPreamble(), clang::ASTUnit::mapLocationToPreamble(), clang::syntax::TreeBuilder::markChildToken(), clang::Sema::MarkFunctionReferenced(), MarkVarDeclODRUsed(), clang::Sema::notePreviousDefinition(), clang::OpenACCClause::OpenACCClause(), clang::Sema::ParsedFreeStandingDeclSpec(), ParseDirective(), clang::Sema::PerformCopyInitialization(), clang::PrettyStackTraceDecl::print(), printLoc(), ReadLineMarkerFlags(), clang::ASTReader::ReadSLocEntry(), recordNullabilitySeen(), clang::Sema::RequireCompleteDeclContext(), clang::arcmt::trans::MigrationContext::rewritePropertyAttribute(), rewriteToNSMacroDecl(), clang::FunctionDecl::setDefaultLoc(), clang::ClassTemplateSpecializationDecl::setExternKeywordLoc(), clang::VarTemplateSpecializationDecl::setExternKeywordLoc(), clang::sema::FunctionScopeInfo::setFirstCoroutineStmt(), clang::sema::FunctionScopeInfo::setHasVLA(), clang::CodeGen::CGDebugInfo::setLocation(), clang::DiagnosticsEngine::setSeverity(), clang::ClassTemplateSpecializationDecl::setTemplateKeywordLoc(), clang::VarTemplateSpecializationDecl::setTemplateKeywordLoc(), clang::EnumDecl::setTemplateSpecializationKind(), shouldIgnoreDueToReservedName(), shouldIgnoreMacro(), clang::StoredDiagnostic::StoredDiagnostic(), and tryConsumeLambdaSpecifierToken().

◆ isMacroID()

bool clang::SourceLocation::isMacroID ( ) const
inline

Definition at line 106 of file SourceLocation.h.

References ID.

Referenced by clang::arcmt::trans::MigrationContext::addPropertyAttribute(), checkAllAtProps(), CheckIdentityFieldAssignment(), clang::Sema::CheckLogicalOperands(), CheckMemaccessSize(), CheckMoveOnConstruction(), checkRangesForMacroArgExpansion(), CompactMacroExpandedPieces(), clang::Sema::DiagnoseAlwaysNonNullPointer(), diagnoseBadTypeAttribute(), DiagnoseBinOpPrecedence(), clang::Sema::DiagnoseCommaOperator(), clang::Sema::DiagnoseEqualityWithExtraParens(), DiagnoseForRangeVariableCopies(), DiagnoseNullConversion(), DiagnoseSelfAssignment(), DiagnoseSwitchLabelsFallthrough(), diagnoseTautologicalComparison(), clang::Sema::DiagnoseUnusedExprResult(), diagnoseXorMisusedAsPow(), clang::DiagnosticRenderer::emitDiagnostic(), EvaluateDefined(), FindLocsWithCommonFileID(), clang::Sema::findMacroSpelling(), clang::Lexer::findNextToken(), findPreviousTokenKind(), findPreviousTokenStart(), clang::arcmt::trans::findSemiAfterLocation(), fixItNullability(), getDeclLocsForCommentSearch(), getEntityEndLoc(), clang::MacroExpansionContext::getExpandedText(), getExpansionForSplitToken(), getFirstStackedCallToHeaderFile(), GetFullTypeForDeclarator(), clang::SourceManager::getImmediateExpansionRange(), clang::Lexer::getImmediateMacroName(), clang::Lexer::getImmediateMacroNameForDiagnostics(), clang::Lexer::getIndentationForLine(), getLiteralInfo(), clang::Lexer::getLocForEndOfToken(), getMacroArgExpansionFileIDs(), GetMappedTokenLoc(), clang::MacroExpansionContext::getOriginalText(), getTopMostMacro(), getVarDeclIdentifierText(), handleObjCOwnershipTypeAttr(), handleStandardNoReturnAttr(), isArgumentExpandedFromMacro(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), isEmptyARCMTMacroStatement(), IsEnumConstOrFromMacro(), isExpandedFromConfigurationMacro(), clang::Decl::isFlexibleArrayMemberLike(), IsFromSameFile(), isIdenticalStmt(), IsInAnyMacroBody(), clang::SourceManager::isInSystemMacro(), clang::SourceManager::isMacroArgExpansion(), clang::SourceManager::isMacroBodyExpansion(), clang::Preprocessor::LexAfterModuleImport(), LocPropertyAttribute(), lookThroughRangesV3Condition(), clang::Lexer::makeFileCharRange(), mapDiagnosticRanges(), maybeRecoverWithZeroInitialization(), overlapWithMacro(), clang::ento::ConditionBRVisitor::patternMatch(), retrieveMacroLocation(), clang::arcmt::trans::MigrationContext::rewritePropertyAttribute(), rewriteToNumberLiteral(), spelledInMacroDefinition(), SuggestInitializationFixit(), and clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode().

◆ isPairOfFileLocations()

static bool clang::SourceLocation::isPairOfFileLocations ( SourceLocation  Start,
SourceLocation  End 
)
inlinestatic

Definition at line 178 of file SourceLocation.h.

References isFileID(), and isValid().

Referenced by clang::tooling::findSelectedASTNodes().

◆ isValid()

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

Return true if this is a valid SourceLocation object.

Invalid SourceLocations are often used when events have no corresponding location in the source (e.g. a diagnostic is required for a command line option).

Definition at line 113 of file SourceLocation.h.

References ID.

Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnCXXForRangeIdentifier(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnCXXTryBlock(), clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFinishExportDecl(), clang::Sema::ActOnFinishLinkageSpecification(), clang::Sema::ActOnFriendTypeDecl(), clang::Sema::ActOnGCCAsmStmt(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnInitList(), clang::Sema::ActOnLambdaClosureQualifiers(), clang::Sema::ActOnModuleDecl(), clang::Sema::ActOnModuleImport(), clang::SemaObjC::ActOnObjCAtTryStmt(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOMPArraySectionExpr(), clang::SemaOpenMP::ActOnOpenMPCriticalDirective(), clang::SemaOpenMP::ActOnOpenMPDeviceClause(), clang::SemaOpenMP::ActOnOpenMPGrainsizeClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPNumTasksClause(), clang::SemaOpenMP::ActOnOpenMPOrderClause(), clang::SemaOpenMP::ActOnOpenMPOrderedClause(), clang::SemaOpenMP::ActOnOpenMPReductionClause(), clang::Sema::ActOnPragmaFPValueChangingOption(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnReturnStmt(), clang::Sema::ActOnSEHTryBlock(), clang::Sema::ActOnStartCXXMemberDeclarations(), clang::Sema::ActOnStartLinkageSpecification(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnTemplateName(), clang::Sema::ActOnTemplateParameterList(), clang::Sema::ActOnTemplateTemplateParameter(), clang::Sema::ActOnTemplateTypeArgument(), clang::Sema::ActOnTypenameType(), clang::Sema::ActOnTypeParameter(), clang::Sema::ActOnUsingDeclaration(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVarTemplateSpecialization(), addConstevalToLambdaDeclSpecifier(), addConstexprToLambdaDeclSpecifier(), addEdgeToPath(), clang::ento::PathDiagnosticPiece::addRange(), clang::Sema::AddRangeBasedOptnone(), addStaticToLambdaDeclSpecifier(), assignInheritanceModel(), clang::ASTContext::attachCommentsToJustParsedDecls(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCaptureInit(), clang::SemaObjC::BuildClassMessage(), clang::SemaObjC::BuildClassMessageImplicit(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildCXXFunctionalCastExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildExprRequirement(), clang::SemaObjC::BuildInstanceMessage(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::BuildMemberPointerType(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildPointerType(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), BuildRecoveryCallExpr(), clang::Sema::BuildReferenceType(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildTypeConstraint(), clang::Sema::BuildUsingDeclaration(), clang::ento::ObjCMethodCall::canBeOverridenInSubclass(), checkARCPropertyImpl(), clang::Sema::CheckBaseSpecifier(), clang::Sema::CheckClassTemplate(), CheckConstexprDeclStmt(), CheckConstexprFunctionBody(), CheckConstexprFunctionStmt(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), clang::Sema::CheckEquivalentExceptionSpec(), clang::CheckEquivalentExceptionSpecImpl(), clang::Sema::CheckExceptionSpecSubset(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), CheckExplicitObjectParameter(), checkExportedDecl(), clang::sema::checkExprLifetimeImpl(), clang::Sema::CheckFunctionConstraints(), checkIsValidOpenCLKernelParameter(), checkMappableExpressionList(), checkModuleImportContext(), clang::Preprocessor::checkModuleIsAvailable(), checkNestingOfRegions(), clang::Sema::checkNonTrivialCUnionInInitializer(), checkOMPArraySectionConstantForReduction(), clang::Sema::CheckPureMethod(), checkReturnStmtInCoroutine(), checkScheduleModifiers(), clang::Sema::CheckSpecializationInstantiationRedecl(), CheckTemplateArgumentAddressOfObjectOrFunction(), clang::Sema::CheckTypeConstraint(), clang::Sema::CheckTypenameType(), checkUndefinedButUsed(), compare(), compareCrossTUSourceLocs(), compileModule(), ComputeDefaultedComparisonExceptionSpec(), clang::Lexer::ComputePreamble(), clang::ento::bugreporter::StoreHandler::constructNote(), clang::NoSanitizeList::containsLocation(), clang::MemberExpr::Create(), clang::UnresolvedMemberExpr::Create(), clang::UnresolvedLookupExpr::Create(), clang::DependentScopeDeclRefExpr::Create(), clang::DeclRefExpr::Create(), clang::CXXDependentScopeMemberExpr::Create(), clang::Sema::CreateBuiltinUnaryOp(), clang::ento::PathDiagnosticLocation::createMemberLoc(), clang::Preprocessor::CreateString(), clang::CXXMethodDecl::CXXMethodDecl(), clang::Sema::DefineDefaultedComparison(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagLocForExplicitInstantiation(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), DiagnosedUnqualifiedCallsToStdFunctions(), clang::Sema::diagnoseIgnoredQualifiers(), DiagnoseMismatchedNewDelete(), diagnoseObjCARCConversion(), clang::SemaObjC::DiagnoseOwningPropertyGetterSynthesis(), clang::Sema::diagnoseQualifiedDeclaration(), clang::Sema::DiagnoseShadowingLambdaDecls(), DiagnoseStaticSpecifierRestrictions(), DiagnoseTemplateParameterListArityMismatch(), clang::Sema::DiagnoseUnterminatedPragmaAlignPack(), clang::Sema::DiagnoseUseOfDecl(), clang::BackendConsumer::DontCallDiagHandler(), clang::CodeGen::CGOpenMPRuntime::emitCall(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::DiagnosticRenderer::emitDiagnostic(), clang::TextDiagnostic::emitDiagnosticLoc(), clang::TextDiagnostic::emitDiagnosticMessage(), clang::CodeGen::CGDebugInfo::emitFunctionStart(), emitNullabilityConsistencyWarning(), clang::CodeGen::CGDebugInfo::EmitUsingDirective(), EvaluateDefined(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::NestedNameSpecifierLocBuilder::Extend(), clang::sema::SemaPPCallbacks::FileChanged(), clang::syntax::FileRange::FileRange(), clang::MacroDirective::findDirectiveAtLoc(), fixItNullability(), fixLocalVarDeclWithSpan(), formImmediatelyDeclaredConstraint(), clang::index::generateUSRForMacro(), clang::TypeLoc::getBeginLoc(), clang::MemberExpr::getBeginLoc(), clang::DesignatedInitExpr::getBeginLoc(), clang::CXXFoldExpr::getBeginLoc(), clang::FullSourceLoc::getBufferData(), clang::FullSourceLoc::getCharacterData(), clang::FullSourceLoc::getColumnNumber(), clang::SourceManager::getDecomposedIncludedLoc(), getEndCharLoc(), clang::ConceptReference::getEndLoc(), clang::DeclarationNameInfo::getEndLoc(), clang::CXXConstructExpr::getEndLoc(), clang::CXXFunctionalCastExpr::getEndLoc(), clang::CXXUnresolvedConstructExpr::getEndLoc(), clang::CXXFoldExpr::getEndLoc(), getEntityEndLoc(), clang::FullSourceLoc::getExpansionColumnNumber(), clang::FullSourceLoc::getExpansionLineNumber(), clang::FullSourceLoc::getExpansionLoc(), clang::CXXMemberCallExpr::getExprLoc(), clang::SourceManager::getFileCharacteristic(), clang::FullSourceLoc::getFileEntry(), clang::FullSourceLoc::getFileEntryRef(), clang::FullSourceLoc::getFileID(), clang::FullSourceLoc::getFileLoc(), clang::FullSourceLoc::getFileOffset(), clang::sema::FunctionScopeInfo::getFirstCoroutineStmtKeyword(), GetFullTypeForDeclarator(), clang::DeclaratorChunk::getFunction(), clang::AnalysisDeclContext::getFunctionName(), clang::FullSourceLoc::getImmediateMacroCallerLoc(), clang::Preprocessor::getLastMacroWithSpelling(), getLastStmtLoc(), clang::FullSourceLoc::getLineNumber(), clang::AutoTypeLoc::getLocalSourceRange(), clang::SourceManager::getMacroArgExpandedLocation(), clang::FullSourceLoc::getModuleImportLoc(), clang::tooling::getNamedDeclAt(), clang::FunctionDecl::getParametersSourceRange(), getPastLoc(), getPointeeTypeText(), clang::FullSourceLoc::getPresumedLoc(), clang::ASTWriter::getRawSourceLocationEncoding(), clang::VarDecl::getSourceRange(), clang::TypeDecl::getSourceRange(), clang::TagDecl::getSourceRange(), clang::ObjCPropertyImplDecl::getSourceRange(), clang::ClassTemplateSpecializationDecl::getSourceRange(), clang::VarTemplateSpecializationDecl::getSourceRange(), clang::FullSourceLoc::getSpellingColumnNumber(), clang::FullSourceLoc::getSpellingLineNumber(), clang::FullSourceLoc::getSpellingLoc(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), clang::VAOptExpansionContext::getVAOptLoc(), handleAvailabilityAttr(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::Preprocessor::HandleEndOfFile(), handleObjCOwnershipTypeAttr(), clang::ExportDecl::hasBraces(), clang::LinkageSpecDecl::hasBraces(), clang::MSAsmStmt::hasBraces(), clang::Declarator::hasEllipsis(), clang::ObjCTypeParamDecl::hasExplicitBound(), clang::DeclRefExpr::hasExplicitTemplateArgs(), clang::MemberExpr::hasExplicitTemplateArgs(), clang::OverloadExpr::hasExplicitTemplateArgs(), clang::DependentScopeDeclRefExpr::hasExplicitTemplateArgs(), clang::CXXDependentScopeMemberExpr::hasExplicitTemplateArgs(), clang::DeclaratorChunk::FunctionTypeInfo::hasMutableQualifier(), clang::concepts::ExprRequirement::hasNoexceptRequirement(), clang::sema::LambdaScopeInfo::hasPotentialCaptures(), clang::sema::LambdaScopeInfo::hasPotentialThisCapture(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::DeclRefExpr::hasTemplateKeyword(), clang::MemberExpr::hasTemplateKeyword(), clang::OverloadExpr::hasTemplateKeyword(), clang::DependentScopeDeclRefExpr::hasTemplateKeyword(), clang::CXXDependentScopeMemberExpr::hasTemplateKeyword(), clang::ento::PathDiagnosticLocation::hasValidLocation(), clang::CodeGen::CodeGenModule::imbueXRayAttrs(), clang::syntax::TokenBuffer::indexExpandedTokens(), clang::TokenLexer::Init(), clang::ASTTemplateKWAndArgsInfo::initializeFrom(), clang::BackendConsumer::InlineAsmDiagHandler(), InventTemplateParameter(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), clang::SourceManager::isBeforeInTranslationUnit(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::AnalysisDeclContext::isBodyAutosynthesizedFromModelFile(), clang::InitListExpr::isExplicit(), clang::ParmVarDecl::isExplicitObjectParameter(), clang::Declarator::isFirstDeclarator(), clang::DeclSpec::isFriendSpecified(), clang::CodeGen::CodeGenModule::isFunctionBlockedByProfileList(), clang::SrcMgr::ExpansionInfo::isFunctionMacroExpansion(), clang::ento::AnalysisManager::isInCodeFile(), clang::Sema::isIncompatibleTypedef(), isInMainFile(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), clang::FullSourceLoc::isInSystemHeader(), clang::ObjCPropertyImplDecl::isIvarNameSpecified(), clang::SrcMgr::ExpansionInfo::isMacroArgExpansion(), clang::FullSourceLoc::isMacroArgExpansion(), clang::SrcMgr::ExpansionInfo::isMacroBodyExpansion(), clang::DeclSpec::isModulePrivateSpecified(), clang::diff::isNodeExcluded(), isNonDriverDiag(), clang::CXXBaseSpecifier::isPackExpansion(), clang::CXXCtorInitializer::isPackExpansion(), clang::UnresolvedUsingValueDecl::isPackExpansion(), clang::UnresolvedUsingTypenameDecl::isPackExpansion(), clang::FriendDecl::isPackExpansion(), clang::ObjCDictionaryElement::isPackExpansion(), clang::LambdaCapture::isPackExpansion(), clang::ParsedAttr::isPackExpansion(), isPairOfFileLocations(), isSameWidthConstantConversion(), clang::DecompositionDeclarator::isSet(), isStandardNewDelete(), clang::MacroDirective::DefInfo::isUndefined(), clang::SourceRange::isValid(), clang::UnqualifiedId::isValid(), clang::VisibleModuleSet::isVisible(), clang::TokenLexer::Lex(), clang::CompilerInstance::loadModule(), loadModuleMapForModuleBuild(), LookupMemberExprInRecord(), clang::Sema::LookupOrCreateLabel(), clang::SourceMgrAdapter::mapLocation(), MatchTemplateParameterKind(), clang::Sema::MatchTemplateParametersToScopeSpecifier(), clang::Sema::MergeTypedefNameDecl(), noteLocation(), clang::Sema::notePreviousDefinition(), clang::Sema::NoteTemplateLocation(), clang::OverloadExpr::OverloadExpr(), clang::Parser::ParseTopLevelDecl(), clang::Parser::ParseUnqualifiedId(), populateExecutedLinesWithFunctionSignature(), clang::PrettyStackTraceDecl::print(), clang::PrettyDeclStackTraceEntry::print(), clang::PrettyStackTraceLoc::print(), print(), clang::printSourceLocationAsJson(), clang::ASTReader::ReadComments(), clang::TreeTransform< Derived >::RebuildArraySectionExpr(), clang::TreeTransform< Derived >::RebuildDependentScopeDeclRefExpr(), RedeclarePropertyAccessor(), retrieveMacroLocation(), clang::arcmt::trans::MigrationContext::rewritePropertyAttribute(), rewriteToNSEnumDecl(), SelectPropertyForSynthesisFromProtocols(), clang::comments::BlockCommandComment::setArgs(), clang::comments::HTMLStartTagComment::setAttrs(), clang::comments::BlockCommandComment::setParagraph(), clang::LinkageSpecDecl::setRBraceLoc(), clang::VirtSpecifiers::SetSpecifier(), clang::VarDecl::setTemplateSpecializationKind(), clang::FunctionDecl::setTemplateSpecializationKind(), clang::EnumDecl::setTemplateSpecializationKind(), clang::VisibleModuleSet::setVisible(), clang::XRayFunctionFilter::shouldImbueLocation(), clang::BackendConsumer::SrcMgrDiagHandler(), clang::StoredDiagnostic::StoredDiagnostic(), SuggestParentheses(), clang::takeAndConcatenateAttrs(), clang::Declarator::takeAttributes(), clang::TreeTransform< Derived >::TemporaryBase::TemporaryBase(), clang::syntax::Token::Token(), translateTemplateArgument(), clang::UndefMacroDirective::UndefMacroDirective(), clang::Sema::UnifySection(), clang::Sema::UsualUnaryConversions(), clang::ento::ConditionBRVisitor::VisitTrueTest(), warnInvalidLock(), and WarnUndefinedMethod().

◆ print()

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

◆ printToString()

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

Definition at line 89 of file SourceLocation.cpp.

References print(), and SM.

Referenced by clang::operator<<().

Friends And Related Function Documentation

◆ ASTReader

friend class ASTReader
friend

Definition at line 89 of file SourceLocation.h.

◆ ASTWriter

friend class ASTWriter
friend

Definition at line 90 of file SourceLocation.h.

◆ llvm::FoldingSetTrait< SourceLocation, void >

friend struct llvm::FoldingSetTrait< SourceLocation, void >
friend

Definition at line 91 of file SourceLocation.h.

◆ SourceLocationEncoding

friend class SourceLocationEncoding
friend

Definition at line 93 of file SourceLocation.h.

◆ SourceManager

friend class SourceManager
friend

Definition at line 91 of file SourceLocation.h.


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