clang 22.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 > |
class | SourceLocationEncoding |
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.
using clang::SourceLocation::IntTy = int32_t |
Definition at line 99 of file SourceLocation.h.
using clang::SourceLocation::UIntTy = uint32_t |
Definition at line 98 of file SourceLocation.h.
LLVM_DUMP_METHOD void SourceLocation::dump | ( | const SourceManager & | SM | ) | const |
Definition at line 94 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 176 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 157 of file SourceLocation.h.
References X.
Referenced by clang::Lexer::ComputePreamble(), clang::SourceLocationEncoding::decode(), clang::BackendConsumer::DontCallDiagHandler(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::Token::getAnnotationEndLoc(), llvm::DenseMapInfo< clang::SourceLocation, void >::getEmptyKey(), getFromPtrEncoding(), clang::Token::getLocation(), llvm::DenseMapInfo< clang::SourceLocation, void >::getTombstoneKey(), clang::BackendConsumer::InlineAsmDiagHandler(), 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 51 of file SourceLocation.cpp.
Referenced by llvm::DenseMapInfo< clang::SemaCUDA::FunctionDeclAndLoc >::getHashValue().
|
inline |
Return a source location with the specified offset from this SourceLocation.
Definition at line 139 of file SourceLocation.h.
References ID.
Referenced by clang::Sema::ActOnComment(), clang::Sema::ActOnIfStmt(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnStartNamespaceDef(), clang::comments::Sema::actOnVerbatimLine(), clang::html::AddHeaderFooterInternalBuiltinCSS(), clang::Lexer::AdvanceToTokenCharacter(), applyRewrite(), atOrBeforeSeparation(), clang::TokenConcatenation::AvoidConcat(), buildLambdaCaptureFixit(), clang::Sema::CheckAssignmentOperands(), CheckExtVectorComponent(), CheckMoveOnConstruction(), ConstructFixItRangeForUnusedCapture(), ConvertBackendLocation(), clang::markup::EmitRange(), clang::syntax::Token::endLocation(), clang::Preprocessor::EnterSourceFile(), clang::ASTReader::FindFileRegionDecls(), clang::Lexer::findLocationAfterToken(), clang::Lexer::findPreviousToken(), findPreviousTokenStart(), FixDigraph(), fixLocalVarDeclWithSpan(), fixVarDeclWithArray(), getBeginningOfFileToken(), clang::Lexer::GetBeginningOfToken(), clang::comments::BlockCommandComment::getCommandNameBeginLoc(), clang::Token::getEndLoc(), clang::edit::Commit::Edit::getFileLocation(), clang::edit::Commit::Edit::getFileRange(), UUCAddAssignGadget::getFixits(), clang::RawComment::getFormattedLines(), clang::SourceManager::getImmediateSpellingLoc(), clang::edit::Commit::Edit::getInsertFromRange(), getLiteralInfo(), clang::ASTUnit::getLocation(), clang::Lexer::getLocForEndOfToken(), clang::SourceManager::getMacroArgExpandedLocation(), GetMappedTokenLoc(), clang::comments::HTMLStartTagComment::Attribute::getNameLocEnd(), clang::SourceManager::getPresumedLoc(), clang::Lexer::getSourceLocation(), getStandardSelLoc(), clang::comments::HTMLTagComment::getTagNameSourceRange(), clang::ScratchBuffer::getToken(), clang::SourceMgrAdapter::handleDiag(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::detail::MacroExpansionRangeRecorder::MacroExpands(), clang::format::Environment::make(), clang::SourceMgrAdapter::mapLocation(), clang::ASTUnit::mapLocationFromPreamble(), clang::ASTUnit::mapLocationToPreamble(), ParseDirective(), clang::comments::Parser::parseInlineCommand(), clang::SemaObjC::ParseObjCSelectorExpression(), clang::Preprocessor::ParsePragmaPushOrPopMacro(), rangesInsideSameMacroArgExpansion(), clang::format::WhitespaceManager::replaceWhitespaceInToken(), skipWhitespaceAndNewline(), clang::Preprocessor::SplitToken(), clang::BackendConsumer::SrcMgrDiagHandler(), clang::tooling::SymbolOccurrence::SymbolOccurrence(), clang::SourceManager::translateLineCol(), clang::Sema::tryToRecoverWithCall(), 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 168 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 151 of file SourceLocation.h.
References ID.
Referenced by clang::Lexer::ComputePreamble(), clang::CodeGen::CodeGenFunction::EmitCall(), 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::Token::startToken(), and updateConsecutiveMacroArgTokens().
|
inline |
Definition at line 107 of file SourceLocation.h.
References ID.
Referenced by applyRewrite(), clang::Sema::CheckAssignmentOperands(), CompactMacroExpandedPieces(), clang::DoPrintPreprocessedInput(), EmitAlphaCounter(), clang::syntax::FileRange::FileRange(), getBeginningOfFileToken(), clang::Lexer::GetBeginningOfToken(), clang::SourceManager::getExpansionRange(), 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(), handleNonNullAttr(), clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic(), clang::Lexer::isAtEndOfMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), isPairOfFileLocations(), TokenCollector::CollectPPExpansions::MacroExpands(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), print(), PrintDifference(), printLocation(), clang::printSourceLocationAsJson(), clang::VAOptExpansionContext::sawVAOptFollowedByOpeningParens(), clang::syntax::TokenBuffer::spelledTokenContaining(), clang::syntax::spelledTokensTouching(), SuggestParentheses(), and updateConsecutiveMacroArgTokens().
|
inline |
Definition at line 116 of file SourceLocation.h.
References ID.
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::ActOnFriendTypeDecl(), clang::Sema::ActOnInitList(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOpenMPDefaultmapClause(), clang::SemaOpenMP::ActOnOpenMPDeviceClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPGrainsizeClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPNumTasksClause(), clang::SemaOpenMP::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(), addEdgeToPath(), clang::ASTUnit::addFileLevelDecl(), clang::Declarator::AddTypeInfo(), adjustColumnPos(), clang::SemaObjC::BuildClassMessage(), clang::Sema::BuildCXXForRangeStmt(), clang::SemaObjC::BuildInstanceMessage(), BuildNonArrayForRange(), clang::Sema::BuildTypeConstraint(), CheckConstexprFunctionStmt(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExplicitlyDefaultedComparison(), CheckFieldPadding(), CheckIdentityFieldAssignment(), clang::Sema::CheckImplicitConversion(), 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(), clang::VerifyDiagnosticConsumer::Directive::Directive(), DoMarkVarDeclReferenced(), clang::DiagnosticRenderer::emitDiagnostic(), clang::CodeGen::CGDebugInfo::EmitFunctionDecl(), clang::markup::EmitLocation(), clang::SemaObjC::EmitRelatedResultTypeNoteForReturn(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::concepts::ExprRequirement::ExprRequirement(), clang::CXXScopeSpec::Extend(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), clang::api_notes::APINotesManager::findAPINotes(), clang::PPConditionalDirectiveRecord::findConditionalDirectiveRegionLoc(), clang::Lexer::findPreviousToken(), findPreviousTokenKind(), findPreviousTokenStart(), clang::syntax::TreeBuilder::findToken(), clang::DeclSpec::Finish(), GenerateFixForUnusedDecl(), clang::tooling::getAssociatedRange(), clang::CallExpr::getBeginLoc(), clang::CompoundLiteralExpr::getBeginLoc(), clang::InitListExpr::getBeginLoc(), clang::DesignatedInitExpr::Designator::getBeginLoc(), clang::BackendConsumer::getBestLocationFromDebugLoc(), clang::ModuleMap::getContainingModuleMapFileID(), getDeclaratorRange(), clang::TypeLoc::getEndLoc(), clang::MemberExpr::getEndLoc(), clang::CXXTemporaryObjectExpr::getEndLoc(), clang::SrcMgr::ExpansionInfo::getExpansionLocEnd(), GetFullTypeForDeclarator(), clang::Preprocessor::getHeaderToIncludeForDiagnostics(), clang::Lexer::getIndentationForLine(), clang::Preprocessor::getLastMacroWithSpelling(), clang::TagTypeLoc::getLocalSourceRange(), clang::ObjCTypeParamTypeLoc::getLocalSourceRange(), clang::ObjCObjectTypeLoc::getLocalSourceRange(), clang::DeducedTemplateSpecializationTypeLoc::getLocalSourceRange(), clang::ElaboratedNameLocInfo::getLocalSourceRange(), clang::Lexer::getLocForEndOfToken(), clang::SourceManager::getMacroArgExpandedLocation(), getNoteDiagForInvalidRedeclaration(), getNullabilityCompletenessCheckFileID(), clang::FunctionDecl::getParametersSourceRange(), getPosAsWritten(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getRawCommentForDeclNoCacheImpl(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::DeclaratorChunk::getSourceRange(), clang::ObjCTypeParamDecl::getSourceRange(), clang::SrcMgr::ExpansionInfo::getSpellingLoc(), getStandardSelLoc(), clang::SARIFDiagnosticPrinter::HandleDiagnostic(), clang::SemaHLSL::handleResourceBindingAttr(), clang::OpenACCWaitClause::hasQueuesTag(), clang::OpenACCWaitConstruct::hasQueuesTag(), clang::OpenACCCacheConstruct::hasReadOnly(), clang::ASTImporter::Import(), clang::index::IndexingContext::indexTopLevelDecl(), clang::UsingDecl::isAccessDeclaration(), clang::UnresolvedUsingValueDecl::isAccessDeclaration(), clang::sema::FunctionScopeInfo::isCoroutine(), clang::DesignatedInitExpr::isDirectInit(), clang::AttributeScopeInfo::isExplicit(), clang::OMPClause::isImplicit(), IsInAnyMacroBody(), clang::SourceManager::isInMainFile(), clang::ASTUnit::isInMainFileID(), clang::ASTUnit::isInPreambleFileID(), isInvalid(), clang::SrcMgr::ExpansionInfo::isMacroArgExpansion(), isPreprocessedEntityIfInFileID(), clang::ASTReader::isPreprocessedEntityInFileID(), isStandardDelete(), clang::CXXScopeSpec::Make(), clang::Lexer::makeFileCharRange(), makeStandaloneDiagnostic(), mapDiagnosticRanges(), clang::ASTUnit::mapLocationFromPreamble(), clang::ASTUnit::mapLocationToPreamble(), clang::syntax::TreeBuilder::markChildToken(), clang::Sema::MarkFunctionReferenced(), MarkVarDeclODRUsed(), clang::Sema::notePreviousDefinition(), clang::OpenACCClause::OpenACCClause(), clang::Sema::ParsedFreeStandingDeclSpec(), ParseDirective(), clang::Sema::PerformCopyInitialization(), clang::PrettyStackTraceDecl::print(), printLoc(), ReadLineMarkerFlags(), clang::ASTReader::ReadSLocEntry(), recordNullabilitySeen(), clang::Sema::RequireCompleteDeclContext(), clang::FunctionDecl::setDefaultLoc(), clang::ClassTemplateSpecializationDecl::setExternKeywordLoc(), clang::VarTemplateSpecializationDecl::setExternKeywordLoc(), clang::sema::FunctionScopeInfo::setFirstCoroutineStmt(), clang::sema::FunctionScopeInfo::setHasVLA(), clang::CodeGen::CGDebugInfo::setLocation(), clang::DiagnosticsEngine::setSeverity(), clang::ClassTemplateSpecializationDecl::setTemplateKeywordLoc(), clang::VarTemplateSpecializationDecl::setTemplateKeywordLoc(), clang::EnumDecl::setTemplateSpecializationKind(), shouldIgnoreDueToReservedName(), shouldIgnoreMacro(), clang::StoredDiagnostic::StoredDiagnostic(), and tryConsumeLambdaSpecifierToken().
|
inline |
Definition at line 108 of file SourceLocation.h.
References ID.
Referenced by CheckConstexprFunction(), CheckIdentityFieldAssignment(), clang::Sema::CheckLogicalOperands(), CheckMemaccessSize(), CheckMoveOnConstruction(), clang::Sema::CheckSingleAssignmentConstraints(), CompactMacroExpandedPieces(), 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(), getFirstStackedCallToHeaderFile(), GetFullTypeForDeclarator(), clang::SourceManager::getImmediateExpansionRange(), clang::Lexer::getImmediateMacroName(), clang::Lexer::getImmediateMacroNameForDiagnostics(), clang::Lexer::getIndentationForLine(), getLiteralInfo(), clang::Lexer::getLocForEndOfToken(), getMacroArgExpansionFileIDs(), 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(), overlapWithMacro(), clang::ento::ConditionBRVisitor::patternMatch(), rangesInsideSameMacroArgExpansion(), retrieveMacroLocation(), rewriteToNumberLiteral(), spelledInMacroDefinition(), SuggestInitializationFixit(), and clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode().
|
inlinestatic |
Definition at line 180 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 115 of file SourceLocation.h.
References ID.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnCXXForRangeIdentifier(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnCXXNestedNameSpecifier(), 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::Sema::ActOnPragmaFPValueChangingOption(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnReturnStmt(), clang::Sema::ActOnSEHTryBlock(), clang::Sema::ActOnStartCXXMemberDeclarations(), clang::Sema::ActOnStartLinkageSpecification(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnTemplateName(), clang::Sema::ActOnTemplateParameterList(), clang::Sema::ActOnTemplateTemplateParameter(), clang::Sema::ActOnTemplateTypeArgument(), clang::Sema::ActOnTypenameType(), clang::Sema::ActOnTypeParameter(), clang::Sema::ActOnUsingDeclaration(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVarTemplateSpecialization(), addConstevalToLambdaDeclSpecifier(), addConstexprToLambdaDeclSpecifier(), addEdgeToPath(), clang::ento::PathDiagnosticPiece::addRange(), clang::Sema::AddRangeBasedOptnone(), addStaticToLambdaDeclSpecifier(), assignInheritanceModel(), clang::ASTContext::attachCommentsToJustParsedDecls(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCaptureInit(), clang::SemaObjC::BuildClassMessage(), clang::SemaObjC::BuildClassMessageImplicit(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildCXXFunctionalCastExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildExprRequirement(), clang::SemaObjC::BuildInstanceMessage(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::BuildMemberPointerType(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildPointerType(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), BuildRecoveryCallExpr(), clang::Sema::BuildReferenceType(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildTypeConstraint(), clang::Sema::BuildUsingDeclaration(), clang::ento::ObjCMethodCall::canBeOverridenInSubclass(), checkARCPropertyImpl(), clang::Sema::CheckBaseSpecifier(), clang::Sema::CheckClassTemplate(), CheckConstexprDeclStmt(), CheckConstexprFunctionBody(), CheckConstexprFunctionStmt(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), clang::Sema::CheckEquivalentExceptionSpec(), clang::CheckEquivalentExceptionSpecImpl(), clang::Sema::CheckExceptionSpecSubset(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), CheckExplicitObjectParameter(), checkExportedDecl(), clang::sema::checkExprLifetimeImpl(), clang::Sema::CheckFunctionConstraints(), checkIsValidOpenCLKernelParameter(), 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::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::Sema::DefineDefaultedComparison(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DetectPrecisionLossInComplexDivision(), DiagLocForExplicitInstantiation(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), DiagnosedUnqualifiedCallsToStdFunctions(), clang::Sema::diagnoseIgnoredQualifiers(), DiagnoseMismatchedNewDelete(), diagnoseObjCARCConversion(), clang::SemaObjC::DiagnoseOwningPropertyGetterSynthesis(), clang::Sema::DiagnosePrecisionLossInComplexDivision(), clang::Sema::diagnoseQualifiedDeclaration(), clang::Sema::DiagnoseShadowingLambdaDecls(), DiagnoseStaticSpecifierRestrictions(), DiagnoseTemplateParameterListArityMismatch(), clang::Sema::DiagnoseUnterminatedPragmaAlignPack(), clang::Sema::DiagnoseUseOfDecl(), clang::BackendConsumer::DontCallDiagHandler(), clang::CodeGen::CGOpenMPRuntime::emitCall(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::DiagnosticRenderer::emitDiagnostic(), clang::TextDiagnostic::emitDiagnosticLoc(), clang::TextDiagnostic::emitDiagnosticMessage(), clang::CodeGen::CGDebugInfo::emitFunctionStart(), emitNullabilityConsistencyWarning(), clang::CodeGen::CGDebugInfo::EmitUsingDirective(), EvaluateDefined(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::sema::SemaPPCallbacks::FileChanged(), clang::syntax::FileRange::FileRange(), clang::MacroDirective::findDirectiveAtLoc(), fixItNullability(), fixLocalVarDeclWithSpan(), formImmediatelyDeclaredConstraint(), clang::CIRGen::CIRGenFunction::generateCode(), clang::index::generateUSRForMacro(), clang::CallExpr::getBeginLoc(), 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(), 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(), clang::sema::FunctionScopeInfo::getFirstCoroutineStmtKeyword(), GetFullTypeForDeclarator(), clang::DeclaratorChunk::getFunction(), clang::AnalysisDeclContext::getFunctionName(), clang::FullSourceLoc::getImmediateMacroCallerLoc(), clang::Preprocessor::getLastMacroWithSpelling(), getLastStmtLoc(), clang::FullSourceLoc::getLineNumber(), clang::CIRGen::CIRGenModule::getLoc(), clang::CIRGen::CIRGenFunction::getLoc(), clang::AutoTypeLoc::getLocalSourceRange(), clang::SourceManager::getMacroArgExpandedLocation(), clang::Preprocessor::getMainFileFirstPPTokenLoc(), 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::VarDecl::getSourceRange(), clang::TypeDecl::getSourceRange(), clang::TagDecl::getSourceRange(), clang::ObjCPropertyImplDecl::getSourceRange(), clang::ClassTemplateSpecializationDecl::getSourceRange(), clang::VarTemplateSpecializationDecl::getSourceRange(), clang::FullSourceLoc::getSpellingColumnNumber(), clang::FullSourceLoc::getSpellingLineNumber(), clang::FullSourceLoc::getSpellingLoc(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), clang::VAOptExpansionContext::getVAOptLoc(), handleAvailabilityAttr(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::Preprocessor::HandleEndOfFile(), handleObjCOwnershipTypeAttr(), clang::ExportDecl::hasBraces(), clang::LinkageSpecDecl::hasBraces(), clang::MSAsmStmt::hasBraces(), clang::Declarator::hasEllipsis(), clang::ObjCTypeParamDecl::hasExplicitBound(), clang::DeclRefExpr::hasExplicitTemplateArgs(), clang::MemberExpr::hasExplicitTemplateArgs(), clang::OverloadExpr::hasExplicitTemplateArgs(), clang::DependentScopeDeclRefExpr::hasExplicitTemplateArgs(), clang::CXXDependentScopeMemberExpr::hasExplicitTemplateArgs(), clang::OpenACCWaitClause::hasExprs(), clang::DeclaratorChunk::FunctionTypeInfo::hasMutableQualifier(), clang::concepts::ExprRequirement::hasNoexceptRequirement(), clang::sema::LambdaScopeInfo::hasPotentialCaptures(), clang::sema::LambdaScopeInfo::hasPotentialThisCapture(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::DeclRefExpr::hasTemplateKeyword(), clang::MemberExpr::hasTemplateKeyword(), clang::OverloadExpr::hasTemplateKeyword(), clang::DependentScopeDeclRefExpr::hasTemplateKeyword(), clang::CXXDependentScopeMemberExpr::hasTemplateKeyword(), clang::ento::PathDiagnosticLocation::hasValidLocation(), clang::CodeGen::CodeGenModule::imbueXRayAttrs(), clang::syntax::TokenBuffer::indexExpandedTokens(), clang::TokenLexer::Init(), clang::ASTTemplateKWAndArgsInfo::initializeFrom(), clang::BackendConsumer::InlineAsmDiagHandler(), InventTemplateParameter(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), clang::SourceManager::isBeforeInTranslationUnit(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::AnalysisDeclContext::isBodyAutosynthesizedFromModelFile(), clang::InitListExpr::isExplicit(), clang::ParmVarDecl::isExplicitObjectParameter(), clang::Declarator::isFirstDeclarator(), clang::DeclSpec::isFriendSpecified(), clang::CodeGen::CodeGenModule::isFunctionBlockedByProfileList(), clang::SrcMgr::ExpansionInfo::isFunctionMacroExpansion(), clang::ento::AnalysisManager::isInCodeFile(), clang::Sema::isIncompatibleTypedef(), isInMainFile(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), clang::FullSourceLoc::isInSystemHeader(), clang::ObjCPropertyImplDecl::isIvarNameSpecified(), clang::SrcMgr::ExpansionInfo::isMacroArgExpansion(), clang::FullSourceLoc::isMacroArgExpansion(), clang::SrcMgr::ExpansionInfo::isMacroBodyExpansion(), clang::DeclSpec::isModulePrivateSpecified(), clang::diff::isNodeExcluded(), isNonDriverDiag(), clang::CXXBaseSpecifier::isPackExpansion(), clang::CXXCtorInitializer::isPackExpansion(), clang::UnresolvedUsingValueDecl::isPackExpansion(), clang::UnresolvedUsingTypenameDecl::isPackExpansion(), clang::FriendDecl::isPackExpansion(), clang::ObjCDictionaryElement::isPackExpansion(), clang::LambdaCapture::isPackExpansion(), clang::ParsedAttr::isPackExpansion(), isPairOfFileLocations(), isSameWidthConstantConversion(), clang::DecompositionDeclarator::isSet(), isStandardNew(), clang::MacroDirective::DefInfo::isUndefined(), clang::SourceRange::isValid(), clang::UnqualifiedId::isValid(), clang::VisibleModuleSet::isVisible(), clang::TokenLexer::Lex(), clang::CompilerInstance::loadModule(), LookupMemberExprInRecord(), clang::Sema::LookupOrCreateLabel(), clang::SourceMgrAdapter::mapLocation(), MatchTemplateParameterKind(), clang::Sema::MatchTemplateParametersToScopeSpecifier(), clang::Sema::MergeTypedefNameDecl(), noteLocation(), clang::Sema::notePreviousDefinition(), clang::Sema::NoteTemplateLocation(), clang::OverloadExpr::OverloadExpr(), clang::Parser::ParseTopLevelDecl(), clang::Parser::ParseUnqualifiedId(), populateExecutedLinesWithFunctionSignature(), clang::PrettyStackTraceDecl::print(), clang::PrettyDeclStackTraceEntry::print(), clang::PrettyStackTraceLoc::print(), print(), clang::printSourceLocationAsJson(), clang::ASTReader::ReadComments(), clang::TreeTransform< Derived >::RebuildArraySectionExpr(), clang::TreeTransform< Derived >::RebuildDependentScopeDeclRefExpr(), RedeclarePropertyAccessor(), retrieveMacroLocation(), SelectPropertyForSynthesisFromProtocols(), clang::TemplateSpecializationTypeLoc::set(), clang::comments::BlockCommandComment::setArgs(), clang::comments::HTMLStartTagComment::setAttrs(), clang::comments::BlockCommandComment::setParagraph(), clang::LinkageSpecDecl::setRBraceLoc(), clang::VirtSpecifiers::SetSpecifier(), clang::VarDecl::setTemplateSpecializationKind(), clang::FunctionDecl::setTemplateSpecializationKind(), clang::EnumDecl::setTemplateSpecializationKind(), clang::VisibleModuleSet::setVisible(), clang::XRayFunctionFilter::shouldImbueLocation(), clang::BackendConsumer::SrcMgrDiagHandler(), clang::StoredDiagnostic::StoredDiagnostic(), SuggestParentheses(), clang::Declarator::takeAttributes(), clang::TreeTransform< Derived >::TemporaryBase::TemporaryBase(), clang::syntax::Token::Token(), translateTemplateArgument(), clang::UndefMacroDirective::UndefMacroDirective(), clang::Sema::UnifySection(), clang::Sema::UsualUnaryFPConversions(), clang::ento::ConditionBRVisitor::VisitTrueTest(), warnInvalidLock(), and WarnUndefinedMethod().
void SourceLocation::print | ( | raw_ostream & | OS, |
const SourceManager & | SM | ||
) | const |
Definition at line 60 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 87 of file SourceLocation.cpp.
Referenced by clang::operator<<().
|
friend |
Definition at line 91 of file SourceLocation.h.
|
friend |
Definition at line 92 of file SourceLocation.h.
|
friend |
Definition at line 93 of file SourceLocation.h.
|
friend |
Definition at line 95 of file SourceLocation.h.
|
friend |
Definition at line 93 of file SourceLocation.h.