clang 17.0.0git
|
Encodes a location in the source. More...
#include "clang/Basic/SourceLocation.h"
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 > |
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 86 of file SourceLocation.h.
using clang::SourceLocation::IntTy = int32_t |
Definition at line 94 of file SourceLocation.h.
using clang::SourceLocation::UIntTy = uint32_t |
Definition at line 93 of file SourceLocation.h.
LLVM_DUMP_METHOD void SourceLocation::dump | ( | const SourceManager & | SM | ) | const |
Definition at line 96 of file SourceLocation.cpp.
Referenced by clang::FullSourceLoc::dump().
|
inlinestatic |
Turn a pointer encoding of a SourceLocation object back into a real SourceLocation.
Definition at line 171 of file SourceLocation.h.
References getFromRawEncoding().
Referenced by clang::ImplicitCallPoint::getLocation().
|
inlinestatic |
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
Definition at line 152 of file SourceLocation.h.
References X.
Referenced by clang::Lexer::ComputePreamble(), clang::SourceLocationSequence::decode(), clang::SourceLocationEncoding::decode(), clang::BackendConsumer::DontCallDiagHandler(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::Token::getAnnotationEndLoc(), clang::serialization::PPEntityOffset::getBegin(), clang::serialization::PPSkippedRange::getBegin(), llvm::DenseMapInfo< clang::SourceLocation, void >::getEmptyKey(), clang::serialization::PPEntityOffset::getEnd(), clang::serialization::PPSkippedRange::getEnd(), getFromPtrEncoding(), clang::Token::getLocation(), clang::serialization::DeclOffset::getLocation(), clang::MMToken::getLocation(), llvm::DenseMapInfo< clang::SourceLocation, void >::getTombstoneKey(), clang::BackendConsumer::InlineAsmDiagHandler(), LoadSourceLocation(), clang::ASTReader::ReadMismatchingDeleteExpressions(), clang::ASTReader::ReadPendingInstantiations(), clang::ASTReader::ReadReferencedSelectors(), clang::ASTReader::ReadUndefinedButUsed(), clang::ASTReader::ReadUsedVTables(), clang::ASTReader::ReadWeakUndeclaredIdentifiers(), and clang::BackendConsumer::SrcMgrDiagHandler().
unsigned SourceLocation::getHashValue | ( | ) | const |
Definition at line 53 of file SourceLocation.cpp.
Referenced by llvm::DenseMapInfo< clang::SourceLocation, void >::getHashValue(), and llvm::DenseMapInfo< clang::Sema::FunctionDeclAndLoc >::getHashValue().
|
inline |
Return a source location with the specified offset from this SourceLocation.
Definition at line 134 of file SourceLocation.h.
References Offset.
Referenced by clang::Sema::ActOnComment(), clang::Sema::ActOnIfStmt(), clang::Sema::ActOnPropertyImplDecl(), 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(), 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(), 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::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), isEmptyARCMTMacroStatement(), clang::detail::MacroExpansionRangeRecorder::MacroExpands(), clang::format::Environment::make(), 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().
|
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 163 of file SourceLocation.h.
References getRawEncoding().
|
inline |
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it.
This should only be passed to SourceLocation::getFromRawEncoding, it should not be inspected directly.
Definition at line 146 of file SourceLocation.h.
Referenced by clang::Lexer::ComputePreamble(), clang::SourceLocationSequence::encode(), clang::SourceLocationEncoding::encode(), generateUniqueName(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), getAsmSrcLocInfo(), getPtrEncoding(), clang::operator<(), clang::operator<=(), clang::operator==(), clang::operator>(), clang::operator>=(), SaveSourceLocation(), clang::Token::setAnnotationEndLoc(), clang::Token::setLocation(), clang::serialization::DeclOffset::setLocation(), clang::Token::startToken(), and updateConsecutiveMacroArgTokens().
|
inline |
Definition at line 102 of file SourceLocation.h.
Referenced by applyRewrite(), clang::ASTContext::attachCommentsToJustParsedDecls(), 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::getRawCommentForDeclNoCache(), 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().
|
inline |
Definition at line 111 of file SourceLocation.h.
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::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::ASTContext::attachCommentsToJustParsedDecls(), 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::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::getRawCommentForDeclNoCache(), 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::CodeGen::CGDebugInfo::setLocation(), clang::Declarator::SetRangeBegin(), clang::Declarator::SetRangeEnd(), clang::DiagnosticsEngine::setSeverity(), clang::EnumDecl::setTemplateSpecializationKind(), shouldIgnoreDueToReservedName(), shouldIgnoreMacro(), clang::StoredDiagnostic::StoredDiagnostic(), and tryConsumeLambdaSpecifierToken().
|
inline |
Definition at line 103 of file SourceLocation.h.
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(), getDeclLocForCommentSearch(), 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(), handleObjCOwnershipTypeAttr(), handleStandardNoReturnAttr(), isArgumentExpandedFromMacro(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), isEmptyARCMTMacroStatement(), IsEnumConstOrFromMacro(), isExpandedFromConfigurationMacro(), clang::Expr::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().
|
inlinestatic |
Definition at line 175 of file SourceLocation.h.
References isFileID(), and isValid().
Referenced by clang::tooling::findSelectedASTNodes().
|
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 110 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::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::ActOnOpenMPNumTasksClause(), clang::Sema::ActOnOpenMPOrderClause(), clang::Sema::ActOnOpenMPOrderedClause(), clang::Sema::ActOnOpenMPReductionClause(), clang::Sema::ActOnPragmaFPReassociate(), 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::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(), 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(), diagExportedUnnamedDecl(), DiagLocForExplicitInstantiation(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), DiagnosedUnqualifiedCallsToStdFunctions(), clang::Sema::diagnoseIgnoredQualifiers(), DiagnoseMismatchedNewDelete(), diagnoseObjCARCConversion(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), DiagnoseStaticSpecifierRestrictions(), DiagnoseTemplateParameterListArityMismatch(), clang::Sema::DiagnoseUnterminatedPragmaAlignPack(), 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(), formImmediatelyDeclaredConstraint(), clang::index::generateUSRForMacro(), clang::TypeLoc::getBeginLoc(), clang::MemberExpr::getBeginLoc(), clang::CXXFoldExpr::getBeginLoc(), clang::FullSourceLoc::getBufferData(), clang::FullSourceLoc::getCharacterData(), clang::FullSourceLoc::getColumnNumber(), clang::SourceManager::getDecomposedIncludedLoc(), getEndCharLoc(), clang::DeclarationNameInfo::getEndLoc(), clang::ConceptSpecializationExpr::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::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(), 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::AutoTypeLoc::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::Sema::RequiredTemplateKind::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::Declarator::isFirstDeclarator(), 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(), clang::Sema::notePreviousDefinition(), 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::ento::ConditionBRVisitor::VisitTrueTest(), clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl(), warnInvalidLock(), and WarnUndefinedMethod().
void SourceLocation::print | ( | raw_ostream & | OS, |
const SourceManager & | SM | ||
) | const |
Definition at line 62 of file SourceLocation.cpp.
References clang::PresumedLoc::getColumn(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), isFileID(), clang::PresumedLoc::isInvalid(), isValid(), and SM.
Referenced by clang::comments::Token::dump(), dump(), clang::Preprocessor::DumpLocation(), clang::detail::MacroExpansionRangeRecorder::MacroExpands(), clang::PrettyStackTraceDecl::print(), clang::PrettyDeclStackTraceEntry::print(), clang::PrettyStackTraceLoc::print(), printLocation(), printToString(), and clang::PrintingCodeCompleteConsumer::ProcessOverloadCandidates().
LLVM_DUMP_METHOD std::string SourceLocation::printToString | ( | const SourceManager & | SM | ) | const |
Definition at line 89 of file SourceLocation.cpp.
Referenced by clang::operator<<().
|
friend |
Definition at line 87 of file SourceLocation.h.
|
friend |
Definition at line 88 of file SourceLocation.h.
|
friend |
Definition at line 89 of file SourceLocation.h.
|
friend |
Definition at line 89 of file SourceLocation.h.