clang 19.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 >
 

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 96 of file SourceLocation.h.

◆ UIntTy

Definition at line 95 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 173 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 136 of file SourceLocation.h.

References ID.

Referenced by clang::Sema::ActOnComment(), clang::Sema::ActOnIfStmt(), clang::Sema::ActOnPropertyImplDecl(), clang::Sema::ActOnStartNamespaceDef(), clang::comments::Sema::actOnVerbatimBlockStart(), 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::comments::Token::getEndLocation(), 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::Sema::ParseObjCSelectorExpression(), clang::format::WhitespaceManager::replaceWhitespaceInToken(), rewriteToNSEnumDecl(), rewriteToNSMacroDecl(), rewriteToObjCProperty(), skipWhitespaceAndNewline(), clang::Preprocessor::SplitToken(), clang::BackendConsumer::SrcMgrDiagHandler(), clang::SourceManager::translateLineCol(), clang::ASTReader::TranslateSourceLocation(), 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 165 of file SourceLocation.h.

References getRawEncoding().

◆ getRawEncoding()

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

◆ isFileID()

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

Definition at line 104 of file SourceLocation.h.

References ID.

Referenced by applyRewrite(), clang::Sema::CheckAssignmentOperands(), CompactMacroExpandedPieces(), clang::tooling::DiagnosticMessage::DiagnosticMessage(), clang::DoPrintPreprocessedInput(), EmitAlphaCounter(), clang::syntax::FileRange::FileRange(), getBeginningOfFileToken(), clang::Lexer::GetBeginningOfToken(), clang::SourceManager::getDecomposedExpansionLoc(), clang::SourceManager::getDecomposedSpellingLoc(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getExpansionRange(), clang::SourceManager::getFileLoc(), clang::edit::Commit::Edit::getFileLocation(), clang::Lexer::getImmediateMacroName(), clang::Lexer::getImmediateMacroNameForDiagnostics(), clang::SourceManager::getImmediateSpellingLoc(), clang::edit::Commit::Edit::getInsertFromRange(), clang::SourceManager::getMacroArgExpandedLocation(), clang::ASTContext::getRawCommentForDeclNoCacheImpl(), clang::Lexer::getSourceLocation(), clang::SourceManager::getSpellingLoc(), handleNonNullAttr(), clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic(), clang::Lexer::isAtEndOfMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), isEmptyARCMTMacroStatement(), isPairOfFileLocations(), clang::Rewriter::isRewritable(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), print(), PrintDifference(), printLocation(), clang::printSourceLocationAsJson(), clang::VAOptExpansionContext::sawVAOptFollowedByOpeningParens(), clang::syntax::TokenBuffer::spelledTokenAt(), clang::syntax::spelledTokensTouching(), SuggestParentheses(), and updateConsecutiveMacroArgTokens().

◆ isInvalid()

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

Definition at line 113 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::ActOnInitList(), clang::Sema::actOnObjCTypeArgsOrProtocolQualifiers(), clang::Sema::ActOnOpenMPDefaultmapClause(), clang::Sema::ActOnOpenMPDeviceClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPGrainsizeClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPNumTasksClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnOpenMPScheduleClause(), clang::Sema::ActOnPropertyImplDecl(), clang::Sema::ActOnStringLiteral(), clang::Sema::ActOnTemplateIdType(), clang::Sema::ActOnTemplateTemplateParameter(), clang::Sema::ActOnUsingDeclaration(), addEdgeToPath(), clang::ASTUnit::addFileLevelDecl(), clang::Declarator::AddTypeInfo(), adjustColumnPos(), clang::Sema::BuildClassMessage(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildInstanceMessage(), BuildNonArrayForRange(), clang::Sema::BuildTypeConstraint(), clang::Sema::canCalleeThrow(), checkAllProps(), CheckConstexprFunctionStmt(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExplicitlyDefaultedComparison(), CheckIdentityFieldAssignment(), CheckImplicitConversion(), CheckLists(), checkModuleImportContext(), checkNullabilityConsistency(), checkObjCMethodX86VectorTypes(), clang::Sema::CheckOMPRequiresDecl(), 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::Sema::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::Sema::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::getContainingModuleMapFile(), 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(), getMissingDeclaratorIdLoc(), getNoteDiagForInvalidRedeclaration(), getNullabilityCompletenessCheckFileID(), clang::FunctionDecl::getParametersSourceRange(), 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(), InventTemplateParameter(), 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(), clang::SourceManager::isInSystemHeader(), 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(), 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::ElaboratedTypeLoc::setElaboratedKeywordLoc(), clang::sema::FunctionScopeInfo::setFirstCoroutineStmt(), clang::sema::FunctionScopeInfo::setHasVLA(), clang::CodeGen::CGDebugInfo::setLocation(), clang::Declarator::SetRangeBegin(), clang::Declarator::SetRangeEnd(), clang::DiagnosticsEngine::setSeverity(), clang::EnumDecl::setTemplateSpecializationKind(), shouldIgnoreDueToReservedName(), shouldIgnoreMacro(), clang::StoredDiagnostic::StoredDiagnostic(), and tryConsumeLambdaSpecifierToken().

◆ isMacroID()

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

Definition at line 105 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(), clang::ast_matchers::internal::getExpansionLocOfMacro(), getFirstStackedCallToHeaderFile(), GetFullTypeForDeclarator(), clang::SourceManager::getImmediateExpansionRange(), clang::SourceManager::getImmediateMacroCallerLoc(), clang::Lexer::getImmediateMacroName(), clang::Lexer::getImmediateMacroNameForDiagnostics(), clang::Lexer::getIndentationForLine(), getLiteralInfo(), clang::Lexer::getLocForEndOfToken(), getMacroArgExpansionFileIDs(), clang::data_collection::getMacroStack(), 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(), 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 177 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 112 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::ActOnGCCAsmStmt(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnInitList(), clang::Sema::ActOnLambdaClosureQualifiers(), clang::Sema::ActOnModuleDecl(), clang::Sema::ActOnModuleImport(), clang::Sema::ActOnObjCAtTryStmt(), clang::Sema::actOnObjCTypeArgsOrProtocolQualifiers(), clang::Sema::ActOnOMPArraySectionExpr(), clang::Sema::ActOnOpenMPCriticalDirective(), clang::Sema::ActOnOpenMPDeviceClause(), clang::Sema::ActOnOpenMPGrainsizeClause(), clang::Sema::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPNumTasksClause(), clang::Sema::ActOnOpenMPOrderClause(), clang::Sema::ActOnOpenMPOrderedClause(), clang::Sema::ActOnOpenMPReductionClause(), clang::Sema::ActOnPragmaFPValueChangingOption(), clang::Sema::ActOnPropertyImplDecl(), 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(), clang::Sema::AddCFAuditedAttribute(), addConstevalToLambdaDeclSpecifier(), addConstexprToLambdaDeclSpecifier(), addEdgeToPath(), clang::ento::PathDiagnosticPiece::addRange(), clang::Sema::AddRangeBasedOptnone(), addStaticToLambdaDeclSpecifier(), assignInheritanceModel(), clang::ASTContext::attachCommentsToJustParsedDecls(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCaptureInit(), clang::Sema::BuildClassMessage(), clang::Sema::BuildClassMessageImplicit(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildCXXFunctionalCastExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildExprRequirement(), clang::Sema::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::BuildTypeConstraint(), clang::Sema::BuildUsingDeclaration(), clang::ento::ObjCMethodCall::canBeOverridenInSubclass(), clang::Sema::canCalleeThrow(), checkARCPropertyImpl(), clang::Sema::CheckBaseSpecifier(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckCompletedCoroutineBody(), CheckConstexprDeclStmt(), CheckConstexprFunctionBody(), CheckConstexprFunctionStmt(), clang::Sema::checkDeclIsAllowedInOpenMPTarget(), clang::Sema::CheckEquivalentExceptionSpec(), clang::CheckEquivalentExceptionSpecImpl(), clang::Sema::CheckExceptionSpecSubset(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), CheckExplicitObjectParameter(), checkExportedDecl(), clang::Sema::CheckFieldDecl(), clang::Sema::CheckFunctionConstraints(), clang::Sema::checkInitializerLifetime(), checkIsValidOpenCLKernelParameter(), checkMappableExpressionList(), checkModuleImportContext(), clang::Preprocessor::checkModuleIsAvailable(), checkNestingOfRegions(), clang::Sema::checkNonTrivialCUnionInInitializer(), checkOMPArraySectionConstantForReduction(), clang::Sema::CheckPureMethod(), checkScheduleModifiers(), clang::Sema::CheckSpecializationInstantiationRedecl(), CheckTemplateArgumentAddressOfObjectOrFunction(), clang::Sema::CheckTypeConstraint(), clang::Sema::CheckTypenameType(), checkUndefinedButUsed(), compare(), compareCrossTUSourceLocs(), 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::DefineImplicitCopyConstructor(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DefineImplicitMoveConstructor(), DiagLocForExplicitInstantiation(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), DiagnosedUnqualifiedCallsToStdFunctions(), clang::Sema::diagnoseIgnoredQualifiers(), DiagnoseMismatchedNewDelete(), diagnoseObjCARCConversion(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), clang::Sema::diagnoseQualifiedDeclaration(), clang::Sema::DiagnoseShadowingLambdaDecls(), DiagnoseStaticSpecifierRestrictions(), DiagnoseTemplateParameterListArityMismatch(), clang::Sema::DiagnoseUnterminatedPragmaAlignPack(), clang::Sema::DiagnoseUseOfDecl(), clang::tooling::DiagnosticMessage::DiagnosticMessage(), clang::BackendConsumer::DontCallDiagHandler(), clang::CodeGen::CGOpenMPRuntime::emitCall(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::DiagnosticRenderer::emitDiagnostic(), clang::SARIFDiagnostic::emitDiagnosticMessage(), 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::FullSourceLoc::getImmediateMacroCallerLoc(), clang::Preprocessor::getLastMacroWithSpelling(), getLastStmtLoc(), clang::FullSourceLoc::getLineNumber(), clang::AutoTypeLoc::getLocalSourceRange(), clang::SourceManager::getMacroArgExpandedLocation(), getMissingDeclaratorIdLoc(), clang::FullSourceLoc::getModuleImportLoc(), clang::tooling::getNamedDeclAt(), clang::FunctionDecl::getParametersSourceRange(), getPastLoc(), getPointeeTypeText(), clang::FullSourceLoc::getPresumedLoc(), clang::VarDecl::getSourceRange(), clang::TypeDecl::getSourceRange(), clang::TagDecl::getSourceRange(), clang::ObjCPropertyImplDecl::getSourceRange(), clang::ClassTemplateSpecializationDecl::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::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::Sema::MarkMemberReferenced(), 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 >::RebuildDependentScopeDeclRefExpr(), RedeclarePropertyAccessor(), retrieveMacroLocation(), clang::arcmt::trans::MigrationContext::rewritePropertyAttribute(), rewriteToNSEnumDecl(), SelectPropertyForSynthesisFromProtocols(), clang::comments::BlockCommandComment::setArgs(), clang::comments::HTMLStartTagComment::setAttrs(), clang::comments::BlockCommandComment::setParagraph(), clang::ClassTemplateSpecializationDecl::setPointOfInstantiation(), clang::VarTemplateSpecializationDecl::setPointOfInstantiation(), 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::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ento::ConditionBRVisitor::VisitTrueTest(), clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl(), 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.

◆ SourceManager

friend class SourceManager
friend

Definition at line 91 of file SourceLocation.h.


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