clang 22.0.0git
clang::SourceLocation Class Reference

Encodes a location in the source. More...

#include "clang/Basic/SourceLocation.h"

Inheritance diagram for clang::SourceLocation:
[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 90 of file SourceLocation.h.

Member Typedef Documentation

◆ IntTy

Definition at line 99 of file SourceLocation.h.

◆ UIntTy

Definition at line 98 of file SourceLocation.h.

Member Function Documentation

◆ dump()

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

Definition at line 94 of file SourceLocation.cpp.

References print(), SM, and SourceManager.

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

◆ getFromPtrEncoding()

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

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

Definition at line 176 of file SourceLocation.h.

References getFromRawEncoding().

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

◆ getFromRawEncoding()

◆ getHashValue()

◆ getLocWithOffset()

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

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

Definition at line 139 of file SourceLocation.h.

Referenced by clang::Sema::ActOnComment(), clang::Sema::ActOnIfStmt(), clang::SemaObjC::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(), CheckExtVectorComponent(), CheckMoveOnConstruction(), clang::SemaX86::checkTargetClonesAttr(), ConstructFixItRangeForUnusedCapture(), ConvertBackendLocation(), clang::markup::EmitRange(), clang::SourceLocationEncoding::encode(), clang::syntax::Token::endLocation(), clang::ASTReader::FindFileRegionDecls(), clang::Lexer::findLocationAfterToken(), clang::Lexer::findPreviousToken(), findPreviousTokenStart(), FixDigraph(), fixLocalVarDeclWithSpan(), fixVarDeclWithArray(), getBeginningOfFileToken(), clang::Lexer::GetBeginningOfToken(), clang::comments::BlockCommandComment::getCommandNameBeginLoc(), getEndCharLoc(), clang::Token::getEndLoc(), clang::comments::Token::getEndLocation(), clang::edit::Commit::Edit::getFileLocation(), clang::edit::Commit::Edit::getFileRange(), clang::SourceManager::getImmediateSpellingLoc(), clang::edit::Commit::Edit::getInsertFromRange(), getLiteralInfo(), clang::ASTUnit::getLocation(), clang::Lexer::getLocForEndOfToken(), clang::SourceManager::getMacroArgExpandedLocation(), GetMappedTokenLoc(), clang::SourceManager::getPresumedLoc(), getStandardSelLoc(), clang::comments::HTMLTagComment::getTagNameSourceRange(), clang::SourceMgrAdapter::handleDiag(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::detail::MacroExpansionRangeRecorder::MacroExpands(), clang::format::Environment::make(), clang::ASTUnit::mapLocationFromPreamble(), clang::ASTUnit::mapLocationToPreamble(), ParseDirective(), clang::comments::Parser::parseInlineCommand(), clang::SemaObjC::ParseObjCSelectorExpression(), clang::Preprocessor::ParsePragmaPushOrPopMacro(), rangesInsideSameMacroArgExpansion(), clang::format::WhitespaceManager::replaceWhitespaceInToken(), 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 168 of file SourceLocation.h.

References getRawEncoding().

◆ getRawEncoding()

◆ isFileID()

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

◆ isInvalid()

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

Definition at line 116 of file SourceLocation.h.

Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), clang::Sema::ActOnBaseSpecifier(), clang::Sema::ActOnCaseStmt(), clang::Sema::ActOnCXXForRangeStmt(), clang::Sema::ActOnCXXMemberDeclarator(), clang::SemaOpenACC::ActOnEndRoutineDeclDirective(), clang::SemaOpenACC::ActOnEndRoutineStmtDirective(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendTypeDecl(), clang::Sema::ActOnInitList(), clang::Sema::ActOnNonTypeTemplateParameter(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOpenMPDefaultmapClause(), clang::SemaOpenMP::ActOnOpenMPDeviceClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPGrainsizeClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPNumTasksClause(), clang::SemaOpenMP::ActOnOpenMPNumThreadsClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::ActOnOpenMPScheduleClause(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnReturnStmt(), clang::Sema::ActOnStringLiteral(), clang::Sema::ActOnTemplateIdType(), clang::Sema::ActOnTemplateTemplateParameter(), clang::Sema::ActOnUsingDeclaration(), clang::VerifyDiagnosticConsumer::MarkerTracker::addDirective(), addEdgeToPath(), clang::ASTUnit::addFileLevelDecl(), clang::VerifyDiagnosticConsumer::MarkerTracker::addMarker(), clang::Declarator::AddTypeInfo(), clang::Declarator::AddTypeInfo(), clang::Declarator::AddTypeInfo(), adjustColumnPos(), clang::SemaObjC::BuildClassMessage(), clang::Sema::BuildCXXForRangeStmt(), clang::SemaObjC::BuildInstanceMessage(), BuildNonArrayForRange(), clang::Sema::BuildTypeConstraint(), clang::Sema::canCalleeThrow(), CheckConstexprFunctionStmt(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExplicitlyDefaultedComparison(), CheckFieldPadding(), CheckIdentityFieldAssignment(), clang::Sema::CheckImplicitConversion(), CheckLists(), checkModuleImportContext(), checkNullabilityConsistency(), checkObjCMethodX86VectorTypes(), clang::SemaOpenMP::CheckOMPRequiresDecl(), checkReturnStmtInCoroutine(), clang::Sema::CheckShadow(), clang::Sema::CheckSpecializationInstantiationRedecl(), clang::Sema::CheckTemplateDeclScope(), 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(), DoMarkVarDeclReferenced(), clang::CodeGen::CodeGenFunction::EmitArraySectionExpr(), clang::DiagnosticRenderer::emitDiagnostic(), clang::CodeGen::CGDebugInfo::EmitFunctionDecl(), clang::markup::EmitLocation(), clang::SemaObjC::EmitRelatedResultTypeNoteForReturn(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::SourceLocationEncoding::encode(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), clang::api_notes::APINotesManager::findAPINotes(), clang::PPConditionalDirectiveRecord::findConditionalDirectiveRegionLoc(), clang::Lexer::findPreviousToken(), findPreviousTokenKind(), findPreviousTokenStart(), findTemplateParameter(), findTemplateParameterInType(), clang::DeclSpec::Finish(), GenerateFixForUnusedDecl(), clang::Lexer::getAsCharRange(), clang::tooling::getAssociatedRange(), clang::CallExpr::getBeginLoc(), clang::DesignatedInitExpr::Designator::getBeginLoc(), clang::InitListExpr::getBeginLoc(), clang::BackendConsumer::getBestLocationFromDebugLoc(), clang::ModuleMap::getContainingModuleMapFileID(), clang::CXXTemporaryObjectExpr::getEndLoc(), clang::InitListExpr::getEndLoc(), clang::MemberExpr::getEndLoc(), clang::TypeLoc::getEndLoc(), clang::SrcMgr::ExpansionInfo::getExpansionLocEnd(), GetFullTypeForDeclarator(), clang::Preprocessor::getHeaderToIncludeForDiagnostics(), clang::Lexer::getIndentationForLine(), clang::Preprocessor::getLastMacroWithSpelling(), clang::DeducedTemplateSpecializationTypeLoc::getLocalSourceRange(), clang::ElaboratedNameLocInfo::getLocalSourceRange(), clang::ObjCObjectTypeLoc::getLocalSourceRange(), clang::ObjCTypeParamTypeLoc::getLocalSourceRange(), clang::TagTypeLoc::getLocalSourceRange(), clang::Lexer::getLocForEndOfToken(), clang::SourceManager::getMacroArgExpandedLocation(), getMissingDeclaratorIdLoc(), getNoteDiagForInvalidRedeclaration(), getNullabilityCompletenessCheckFileID(), clang::FunctionDecl::getParametersSourceRange(), getPosAsWritten(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getRawCommentForDeclNoCacheImpl(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::ObjCTypeParamDecl::getSourceRange(), clang::SrcMgr::ExpansionInfo::getSpellingLoc(), getStandardSelLoc(), clang::SARIFDiagnosticPrinter::HandleDiagnostic(), clang::SemaHLSL::handleResourceBindingAttr(), clang::ASTImporter::Import(), clang::index::IndexingContext::indexTopLevelDecl(), InventTemplateParameter(), IsInAnyMacroBody(), clang::SourceManager::isInMainFile(), clang::ASTUnit::isInMainFileID(), clang::ASTUnit::isInPreambleFileID(), clang::SourceManager::isInSystemHeader(), isPreprocessedEntityIfInFileID(), clang::ASTReader::isPreprocessedEntityInFileID(), isStandardDelete(), isValidDeadStmt(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), makeStandaloneDiagnostic(), mapDiagnosticRanges(), clang::ASTUnit::mapLocationFromPreamble(), clang::ASTUnit::mapLocationToPreamble(), 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::FunctionDecl::setDefaultLoc(), clang::CodeGen::CGDebugInfo::setLocation(), clang::Declarator::SetRangeBegin(), clang::Declarator::SetRangeEnd(), clang::DiagnosticsEngine::setSeverity(), clang::EnumDecl::setTemplateSpecializationKind(), shouldIgnoreDueToReservedName(), shouldIgnoreMacro(), clang::StoredDiagnostic::StoredDiagnostic(), clang::ASTReader::TranslateSourceLocation(), and tryConsumeLambdaSpecifierToken().

◆ isMacroID()

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

Definition at line 108 of file SourceLocation.h.

Referenced by BuiltinOverflow(), clang::interp::CheckCallable(), CheckConstexprFunction(), CheckIdentityFieldAssignment(), clang::Sema::CheckLogicalOperands(), CheckMemaccessSize(), CheckMoveOnConstruction(), clang::Sema::CheckSingleAssignmentConstraints(), CompactMacroExpandedPieces(), clang::ento::containsMacro(), clang::Sema::DiagnoseAlwaysNonNullPointer(), diagnoseBadTypeAttribute(), DiagnoseBinOpPrecedence(), clang::Sema::DiagnoseCommaOperator(), clang::Sema::DiagnoseEqualityWithExtraParens(), DiagnoseForRangeVariableCopies(), DiagnoseNullConversion(), DiagnoseSelfAssignment(), DiagnoseSwitchLabelsFallthrough(), diagnoseTautologicalComparison(), diagnoseXorMisusedAsPow(), clang::DiagnosticRenderer::emitDiagnostic(), EvaluateDefined(), FindLocsWithCommonFileID(), clang::Sema::findMacroSpelling(), clang::Lexer::findNextToken(), findPreviousTokenKind(), findPreviousTokenStart(), fixItNullability(), getDeclLocsForCommentSearch(), getEntityEndLoc(), clang::MacroExpansionContext::getExpandedText(), getExpansionForSplitToken(), clang::ast_matchers::internal::getExpansionLocOfMacroRecursive(), 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(), clang::Sema::getRangeForNextToken(), getTopMostMacro(), clang::getVarDeclIdentifierText(), handleObjCOwnershipTypeAttr(), handleStandardNoReturnAttr(), isArgumentExpandedFromMacro(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), IsEnumConstOrFromMacro(), isExpandedFromConfigurationMacro(), clang::Decl::isFlexibleArrayMemberLike(), IsFromSameFile(), IsInAnyMacroBody(), clang::SourceManager::isInSystemMacro(), clang::SourceManager::isMacroArgExpansion(), clang::SourceManager::isMacroBodyExpansion(), clang::Preprocessor::LexAfterModuleImport(), LocPropertyAttribute(), lookThroughRangesV3Condition(), clang::Lexer::makeFileCharRange(), mapDiagnosticRanges(), maybeRecoverWithZeroInitialization(), clang::ento::ConditionBRVisitor::patternMatch(), rangesInsideSameMacroArgExpansion(), retrieveMacroLocation(), rewriteToNumberLiteral(), spelledInMacroDefinition(), SuggestInitializationFixit(), and clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode().

◆ isPairOfFileLocations()

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

Definition at line 180 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 115 of file SourceLocation.h.

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::SemaOpenACC::ActOnForStmtEnd(), clang::Sema::ActOnFriendTypeDecl(), clang::Sema::ActOnGCCAsmStmt(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnInitList(), clang::Sema::ActOnLambdaClosureQualifiers(), 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::ActOnOpenMPNumThreadsClause(), clang::SemaOpenMP::ActOnOpenMPOrderClause(), clang::SemaOpenMP::ActOnOpenMPOrderedClause(), clang::SemaOpenMP::ActOnOpenMPReductionClause(), 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::ActOnTypenameType(), clang::Sema::ActOnTypeParameter(), clang::Sema::ActOnUsingDeclaration(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVarTemplateSpecialization(), addConstevalToLambdaDeclSpecifier(), addConstexprToLambdaDeclSpecifier(), addEdgeToPath(), clang::ento::PathDiagnosticPiece::addRange(), 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(), buildIdExpression(), 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(), clang::Sema::canCalleeThrow(), 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::CheckFieldDecl(), clang::Sema::CheckFunctionConstraints(), checkIsValidOpenCLKernelParameter(), checkModuleImportContext(), clang::Preprocessor::checkModuleIsAvailable(), checkNestingOfRegions(), clang::Sema::checkNonTrivialCUnionInInitializer(), checkOMPArraySectionConstantForReduction(), clang::Sema::CheckParameterPacksForExpansion(), clang::Sema::CheckPureMethod(), checkReturnStmtInCoroutine(), clang::SemaOpenACC::CheckRoutineDecl(), checkScheduleModifiers(), clang::Sema::CheckSpecializationInstantiationRedecl(), CheckSYCLKernelName(), CheckTemplateArgumentAddressOfObjectOrFunction(), clang::Sema::CheckTypeConstraint(), clang::Sema::CheckTypenameType(), checkUndefinedButUsed(), clang::CompilerInstance::cloneForModuleCompile(), compare(), compareCrossTUSourceLocs(), ComputeDefaultedComparisonExceptionSpec(), clang::Lexer::ComputePreamble(), clang::ento::bugreporter::StoreHandler::constructNote(), clang::NoSanitizeList::containsLocation(), clang::CXXDependentScopeMemberExpr::Create(), clang::DeclRefExpr::Create(), clang::DependentScopeDeclRefExpr::Create(), clang::MemberExpr::Create(), clang::UnresolvedLookupExpr::Create(), clang::UnresolvedMemberExpr::Create(), clang::Sema::CreateBuiltinUnaryOp(), clang::ento::PathDiagnosticLocation::createMemberLoc(), clang::Preprocessor::CreateString(), clang::Sema::DefineDefaultedComparison(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DetectPrecisionLossInComplexDivision(), DiagLocForExplicitInstantiation(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), DiagnosedUnqualifiedCallsToStdFunctions(), clang::Sema::diagnoseIgnoredQualifiers(), DiagnoseMismatchedNewDelete(), diagnoseObjCARCConversion(), clang::SemaObjC::DiagnoseOwningPropertyGetterSynthesis(), clang::Sema::diagnoseQualifiedDeclaration(), clang::diagnoseRetainCycle(), clang::Sema::DiagnoseShadowingLambdaDecls(), DiagnoseStaticSpecifierRestrictions(), DiagnoseTemplateParameterListArityMismatch(), clang::Sema::DiagnoseUnterminatedPragmaAlignPack(), clang::tooling::DiagnosticMessage::DiagnosticMessage(), clang::BackendConsumer::DontCallDiagHandler(), clang::CodeGen::CGOpenMPRuntime::emitCall(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::DiagnosticRenderer::emitDiagnostic(), clang::SARIFDiagnostic::emitDiagnosticMessage(), clang::TextDiagnostic::emitDiagnosticMessage(), clang::CodeGen::CGDebugInfo::emitFunctionStart(), emitNullabilityConsistencyWarning(), clang::CodeGen::CGDebugInfo::EmitUsingDirective(), EvaluateDefined(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::sema::SemaPPCallbacks::FileChanged(), clang::syntax::FileRange::FileRange(), clang::syntax::FileRange::FileRange(), clang::VerifyDiagnosticConsumer::MarkerTracker::finalize(), findBlockLocations(), clang::findCapturingExpr(), clang::MacroDirective::findDirectiveAtLoc(), fixItNullability(), fixLocalVarDeclWithSpan(), formImmediatelyDeclaredConstraint(), clang::CIRGen::CIRGenFunction::generateCode(), clang::index::generateUSRForMacro(), clang::CallExpr::getBeginLoc(), clang::DesignatedInitExpr::getBeginLoc(), clang::MemberExpr::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::FullSourceLoc::getBufferData(), clang::FullSourceLoc::getCharacterData(), clang::FullSourceLoc::getColumnNumber(), clang::SourceManager::getDecomposedIncludedLoc(), getEndCharLoc(), clang::ConceptReference::getEndLoc(), clang::CXXConstructExpr::getEndLoc(), clang::CXXFunctionalCastExpr::getEndLoc(), clang::DeclarationNameInfo::getEndLoc(), clang::Parser::getEndOfPreviousToken(), 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(), GetFullTypeForDeclarator(), clang::DeclaratorChunk::getFunction(), clang::FullSourceLoc::getImmediateMacroCallerLoc(), getLastStmtLoc(), clang::FullSourceLoc::getLineNumber(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CIRGen::CIRGenModule::getLoc(), clang::AutoTypeLoc::getLocalSourceRange(), clang::ento::PathSensitiveBugReport::getLocation(), clang::SourceManager::getMacroArgExpandedLocation(), getMissingDeclaratorIdLoc(), clang::FullSourceLoc::getModuleImportLoc(), clang::tooling::getNamedDeclAt(), clang::TypeLoc::getNonPrefixBeginLoc(), clang::FunctionDecl::getParametersSourceRange(), clang::getPastLoc(), getPointee2TypeText(), clang::getPointeeTypeText(), clang::FullSourceLoc::getPresumedLoc(), clang::Sema::getRangeForNextToken(), clang::ASTWriter::getRawSourceLocationEncoding(), clang::ClassTemplateSpecializationDecl::getSourceRange(), clang::TagDecl::getSourceRange(), clang::VarDecl::getSourceRange(), clang::VarTemplateSpecializationDecl::getSourceRange(), clang::FullSourceLoc::getSpellingColumnNumber(), clang::FullSourceLoc::getSpellingLineNumber(), clang::FullSourceLoc::getSpellingLoc(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), handleAvailabilityAttr(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), handleObjCOwnershipTypeAttr(), clang::CXXDependentScopeMemberExpr::hasExplicitTemplateArgs(), clang::DeclRefExpr::hasExplicitTemplateArgs(), clang::DependentScopeDeclRefExpr::hasExplicitTemplateArgs(), clang::MemberExpr::hasExplicitTemplateArgs(), clang::OverloadExpr::hasExplicitTemplateArgs(), clang::OpenACCWaitClause::hasExprs(), clang::DeclaratorChunk::FunctionTypeInfo::hasMutableQualifier(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::CXXDependentScopeMemberExpr::hasTemplateKeyword(), clang::DeclRefExpr::hasTemplateKeyword(), clang::DependentScopeDeclRefExpr::hasTemplateKeyword(), clang::MemberExpr::hasTemplateKeyword(), clang::OverloadExpr::hasTemplateKeyword(), clang::Sema::RequiredTemplateKind::hasTemplateKeyword(), clang::ento::PathDiagnosticLocation::hasValidLocation(), clang::CodeGen::CodeGenModule::imbueXRayAttrs(), clang::syntax::TokenBuffer::indexExpandedTokens(), clang::BackendConsumer::InlineAsmDiagHandler(), InventTemplateParameter(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), clang::SourceManager::isBeforeInTranslationUnit(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::AnalysisDeclContext::isBodyAutosynthesizedFromModelFile(), clang::CodeGen::CodeGenModule::isFunctionBlockedByProfileList(), clang::SrcMgr::ExpansionInfo::isFunctionMacroExpansion(), clang::ento::AnalysisManager::isInCodeFile(), clang::Sema::isIncompatibleTypedef(), isInMainFile(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), clang::FullSourceLoc::isInSystemHeader(), clang::FullSourceLoc::isMacroArgExpansion(), clang::SrcMgr::ExpansionInfo::isMacroArgExpansion(), clang::SrcMgr::ExpansionInfo::isMacroBodyExpansion(), clang::diff::isNodeExcluded(), isNonDriverDiag(), isPairOfFileLocations(), isSameWidthConstantConversion(), isStandardNew(), clang::VisibleModuleSet::isVisible(), 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(), print(), clang::Sema::PrintInstantiationStack(), clang::printSourceLocationAsJson(), clang::ASTReader::ReadComments(), clang::TreeTransform< AdjustConstraintDepth >::RebuildArraySectionExpr(), clang::TreeTransform< AdjustConstraintDepth >::RebuildDependentScopeDeclRefExpr(), RedeclarePropertyAccessor(), reportOriginalDsa(), retrieveMacroLocation(), SelectPropertyForSynthesisFromProtocols(), clang::TemplateSpecializationTypeLoc::set(), clang::comments::BlockCommandComment::setArgs(), clang::comments::HTMLStartTagComment::setAttrs(), clang::comments::BlockCommandComment::setParagraph(), clang::EnumDecl::setTemplateSpecializationKind(), clang::FunctionDecl::setTemplateSpecializationKind(), clang::VarDecl::setTemplateSpecializationKind(), clang::VisibleModuleSet::setVisible(), clang::XRayFunctionFilter::shouldImbueLocation(), clang::BackendConsumer::SrcMgrDiagHandler(), clang::StoredDiagnostic::StoredDiagnostic(), SuggestParentheses(), clang::Declarator::takeAttributes(), translateTemplateArgument(), clang::UndefMacroDirective::UndefMacroDirective(), clang::Sema::UnifySection(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ento::ConditionBRVisitor::VisitTrueTest(), clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl(), warnInvalidLock(), and WarnUndefinedMethod().

◆ print()

◆ printToString()

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

Definition at line 87 of file SourceLocation.cpp.

References print(), SM, and SourceManager.

Referenced by clang::operator<<().

◆ ASTReader

friend class ASTReader
friend

Definition at line 91 of file SourceLocation.h.

References ASTReader.

Referenced by ASTReader.

◆ ASTWriter

friend class ASTWriter
friend

Definition at line 92 of file SourceLocation.h.

References ASTWriter.

Referenced by ASTWriter.

◆ llvm::FoldingSetTrait< SourceLocation, void >

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

Definition at line 93 of file SourceLocation.h.

References SourceManager.

◆ SourceLocationEncoding

friend class SourceLocationEncoding
friend

Definition at line 95 of file SourceLocation.h.

References SourceLocationEncoding.

Referenced by SourceLocationEncoding.

◆ SourceManager


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