clang
9.0.0
|
Encodes a location in the source. More...
#include "clang/Basic/SourceLocation.h"
Public Member Functions | |
bool | isFileID () const |
bool | isMacroID () const |
bool | isValid () const |
Return true if this is a valid SourceLocation object. More... | |
bool | isInvalid () const |
SourceLocation | getLocWithOffset (int Offset) const |
Return a source location with the specified offset from this SourceLocation. More... | |
unsigned | getRawEncoding () const |
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it. More... | |
void * | getPtrEncoding () const |
When a SourceLocation itself cannot be used, this returns an (opaque) pointer encoding for it. More... | |
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 (unsigned Encoding) |
Turn a raw encoding of a SourceLocation object into a real SourceLocation. More... | |
static SourceLocation | getFromPtrEncoding (const void *Encoding) |
Turn a pointer encoding of a SourceLocation object back into a real SourceLocation. More... | |
static bool | isPairOfFileLocations (SourceLocation Start, SourceLocation End) |
Friends | |
class | ASTReader |
class | ASTWriter |
class | SourceManager |
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.
LLVM_DUMP_METHOD void SourceLocation::dump | ( | const SourceManager & | SM | ) | const |
Definition at line 77 of file SourceLocation.cpp.
|
inlinestatic |
Turn a pointer encoding of a SourceLocation object back into a real SourceLocation.
Definition at line 169 of file SourceLocation.h.
Referenced by clang::ImplicitCallPoint::getLocation().
|
inlinestatic |
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
Definition at line 150 of file SourceLocation.h.
References X.
Referenced by checkAllProps(), clang::Lexer::ComputePreamble(), diagnoseRedundantReturnTypeQualifiers(), fillAtomicQualLoc(), clang::DependentDiagnostic::getAccessLoc(), clang::Token::getAnnotationEndLoc(), clang::serialization::PPEntityOffset::getBegin(), clang::serialization::PPSkippedRange::getBegin(), clang::DesignatedInitExpr::getBeginLoc(), clang::InitializedEntity::getCaptureLoc(), clang::DeclarationNameInfo::getCXXLiteralOperatorNameLoc(), clang::DeclarationNameInfo::getCXXOperatorNameRange(), clang::Designator::getDotLoc(), clang::DesignatedInitExpr::Designator::getDotLoc(), clang::Designator::getEllipsisLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getEllipsisLoc(), clang::DesignatedInitExpr::Designator::getEllipsisLoc(), clang::serialization::PPEntityOffset::getEnd(), clang::serialization::PPSkippedRange::getEnd(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocBeg(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocEnd(), clang::SrcMgr::ExpansionInfo::getExpansionLocEnd(), clang::SrcMgr::ExpansionInfo::getExpansionLocStart(), clang::Designator::getFieldLoc(), clang::DesignatedInitExpr::Designator::getFieldLoc(), llvm::PointerLikeTypeTraits< clang::SourceLocation >::getFromVoidPointer(), clang::SrcMgr::FileInfo::getIncludeLoc(), clang::ObjCTypeParamList::getLAngleLoc(), clang::Designator::getLBracketLoc(), clang::DesignatedInitExpr::Designator::getLBracketLoc(), clang::Token::getLocation(), clang::serialization::DeclOffset::getLocation(), clang::MMToken::getLocation(), clang::DeclaratorChunk::FunctionTypeInfo::getLParenLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getMutableLoc(), clang::ObjCTypeParamList::getRAngleLoc(), clang::Designator::getRBracketLoc(), clang::DesignatedInitExpr::Designator::getRBracketLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::InitializedEntity::getReturnLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getRParenLoc(), clang::SrcMgr::ExpansionInfo::getSpellingLoc(), clang::InitializedEntity::getThrowLoc(), clang::BackendConsumer::InlineAsmDiagHandler(), isDiagnosedResult(), clang::SrcMgr::ExpansionInfo::isMacroArgExpansion(), clang::SrcMgr::ExpansionInfo::isMacroBodyExpansion(), LoadSourceLocation(), clang::ASTReader::ReadMismatchingDeleteExpressions(), clang::ASTReader::ReadPendingInstantiations(), clang::ASTReader::ReadReferencedSelectors(), clang::ASTReader::ReadUndefinedButUsed(), clang::ASTReader::ReadUntranslatedSourceLocation(), clang::ASTReader::ReadUsedVTables(), clang::ASTReader::ReadWeakUndeclaredIdentifiers(), and clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr().
|
inline |
Return a source location with the specified offset from this SourceLocation.
Definition at line 132 of file SourceLocation.h.
References Offset.
Referenced by clang::Sema::ActOnComment(), clang::comments::Sema::actOnVerbatimBlockStart(), clang::comments::Sema::actOnVerbatimLine(), addFixitForObjCARCConversion(), clang::html::AddHeaderFooterInternalBuiltinCSS(), clang::Lexer::AdvanceToTokenCharacter(), clang::format::AffectedRangeManager::affectsCharSourceRange(), applyEditsToTemp(), applyRewrite(), clang::TokenConcatenation::AvoidConcat(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), clang::tooling::callArgs(), CheckMoveOnConstruction(), checkRangeForMacroArgExpansion(), clang::edit::EditedSource::clearRewrites(), ConvertBackendLocation(), clang::CreateModernObjCRewriter(), clang::CreateObjCRewriter(), EmitAlphaCounter(), clang::markup::EmitRange(), clang::syntax::Token::endLocation(), clang::format::Environment::Environment(), clang::ASTReader::FindFileRegionDecls(), clang::arcmt::trans::findLocationAfterSemi(), clang::Lexer::findLocationAfterToken(), clang::PreprocessingRecord::findMacroDefinition(), findPlaceholderEnd(), findPreviousTokenStart(), FixDigraph(), getBeginningOfFileToken(), clang::Lexer::GetBeginningOfToken(), clang::SourceManager::getBufferData(), clang::comments::BlockCommandComment::getCommandNameBeginLoc(), 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(), clang::ASTUnit::getLocation(), clang::Lexer::getLocForEndOfToken(), clang::SourceManager::getMacroArgExpandedLocation(), GetMappedTokenLoc(), clang::comments::HTMLStartTagComment::Attribute::getNameLocEnd(), clang::SourceManager::getPresumedLoc(), clang::Lexer::getSourceLocation(), clang::comments::HTMLTagComment::getTagNameSourceRange(), clang::ScratchBuffer::getToken(), clang::Preprocessor::HandleEndOfFile(), HandlePopUpPieceEndTag(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::TokenLexer::isParsingPreprocessorDirective(), clang::ASTUnit::mapLocationFromPreamble(), clang::ASTUnit::mapLocationToPreamble(), mustSynthesizeSetterGetterMethod(), clang::tooling::name(), clang::Parser::ParseConstraintExpression(), clang::Sema::ParseObjCSelectorExpression(), clang::Parser::ParseTopLevelDecl(), PrintPreprocessedTokens(), clang::edit::Commit::replaceText(), clang::format::WhitespaceManager::replaceWhitespaceInToken(), RewriteOneForwardClassDecl(), rewriteToNSEnumDecl(), rewriteToNSMacroDecl(), rewriteToObjCProperty(), scanToNextArgument(), SelectDigraphErrorMessage(), clang::DiagnosticsEngine::SetDelayedDiagnostic(), clang::CoverageSourceInfo::SourceRangeSkipped(), clang::Preprocessor::SplitToken(), sumOffsets(), clang::SourceManager::translateLineCol(), clang::ASTReader::TranslateSourceLocation(), clang::tooling::RecursiveSymbolVisitor< T >::TraverseNestedNameSpecifierLoc(), clang::Sema::tryToRecoverWithCall(), updateConsecutiveMacroArgTokens(), and Write_RethrowObject().
|
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 161 of file SourceLocation.h.
Referenced by llvm::PointerLikeTypeTraits< clang::SourceLocation >::getAsVoidPointer().
|
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 144 of file SourceLocation.h.
Referenced by clang::ASTWriter::AddSourceLocation(), clang::syntax::TokenCollector::Builder::build(), clang::edit::EditedSource::canInsertInOffset(), checkAllAtProps(), checkAllProps(), checkWeakGCAttrs(), clang::Lexer::ComputePreamble(), clang::SrcMgr::ExpansionInfo::create(), clang::DesignatedInitExpr::Designator::Designator(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::Designator::getArrayRange(), getAsmSrcLocInfo(), clang::Designator::getField(), clang::DeclaratorChunk::getFunction(), llvm::DenseMapInfo< clang::Sema::FunctionDeclAndLoc >::getHashValue(), clang::ModuleMapParser::getLocation(), clang::tooling::SymbolOccurrence::getNameRanges(), clang::DeclaratorChunk::getPointer(), clang::ObjCTypeParamDecl::getSourceRange(), clang::syntax::TokenCollector::CollectPPExpansions::MacroExpands(), clang::operator<(), clang::operator==(), clang::edit::EditsReceiver::remove(), SaveSourceLocation(), clang::Token::setAnnotationEndLoc(), clang::DeclarationNameInfo::setCXXLiteralOperatorNameLoc(), clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::Token::setLocation(), clang::serialization::DeclOffset::setLocation(), clang::UnqualifiedId::setOperatorFunctionId(), clang::Designator::setRBracketLoc(), clang::Token::startToken(), and clang::TemplateArgumentLocInfo::TemplateArgumentLocInfo().
|
inline |
Definition at line 98 of file SourceLocation.h.
Referenced by clang::syntax::TokenCollector::Builder::build(), buildFixItInsertionLine(), checkRangesForMacroArgExpansion(), clang::edit::EditedSource::clearRewrites(), CompactMacroExpandedPieces(), clang::Parser::Diag(), clang::tooling::DiagnosticMessage::DiagnosticMessage(), clang::DoPrintPreprocessedInput(), clang::syntax::TokenBuffer::expansionStartingAt(), clang::syntax::FileRange::FileRange(), getBeginningOfFileToken(), clang::Lexer::GetBeginningOfToken(), clang::SourceManager::getBufferData(), clang::SourceManager::getDecomposedExpansionLoc(), clang::SourceManager::getDecomposedSpellingLoc(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getExpansionRange(), clang::SourceManager::getFileLoc(), clang::edit::Commit::Edit::getFileLocation(), getFunctionSourceLocation(), clang::Lexer::getImmediateMacroName(), clang::SourceManager::getImmediateSpellingLoc(), clang::edit::Commit::Edit::getInsertFromRange(), clang::SourceManager::getMacroArgExpandedLocation(), clang::ASTContext::getRawCommentForDeclNoCache(), clang::Lexer::getSourceLocation(), clang::SourceManager::getSpellingLoc(), clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic(), HandlePopUpPieceEndTag(), clang::Lexer::isAtEndOfMacroExpansion(), isPairOfFileLocations(), clang::TokenLexer::isParsingPreprocessorDirective(), clang::Rewriter::isRewritable(), clang::TokenLexer::Lex(), clang::syntax::TokenCollector::CollectPPExpansions::MacroExpands(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), clang::Parser::ParseConstraintExpression(), printLocation(), clang::printSourceLocationAsJson(), clang::VAOptExpansionContext::sawVAOptFollowedByOpeningParens(), SuggestParentheses(), clang::SourceManager::translateLineCol(), and updateConsecutiveMacroArgTokens().
|
inline |
Definition at line 107 of file SourceLocation.h.
Referenced by clang::Sema::ActOnBaseSpecifier(), clang::Sema::ActOnCaseStmt(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPScheduleClause(), addConstevalToLambdaDeclSpecifier(), addEdgeToPath(), clang::ASTUnit::addFileLevelDecl(), AddRangeLocationAbbrev(), clang::Declarator::AddTypeInfo(), clang::Sema::AtomicPropertySetterGetterRules(), clang::Sema::BuildClassMessage(), clang::Sema::BuildInstanceMessage(), BuildNonArrayForRange(), checkAllProps(), CheckCXX98CompatAccessibleCopy(), clang::Sema::CheckEquivalentExceptionSpec(), CheckIdentityFieldAssignment(), CheckImplicitConversion(), CheckLists(), clang::Preprocessor::checkModuleIsAvailable(), checkNullabilityConsistency(), clang::Sema::CheckSpecializationInstantiationRedecl(), clang::Lexer::ComputePreamble(), clang::CreateModernObjCRewriter(), clang::CreateObjCRewriter(), clang::CodeGen::CGDebugInfo::CreateTempMacroFile(), clang::Parser::Diag(), clang::Sema::DiagnoseEqualityWithExtraParens(), diagnoseLogicalNotOnLHSofCheck(), clang::Sema::diagnoseNullResettableSynthesizedSetters(), DiagnoseSelfAssignment(), clang::Sema::DiagnoseShadowingLambdaDecls(), clang::VerifyDiagnosticConsumer::Directive::Directive(), DoMarkVarDeclReferenced(), clang::DiagnosticRenderer::emitDiagnostic(), clang::markup::EmitLocation(), clang::CodeGen::CodeGenFunction::EmitOMPArraySectionExpr(), clang::DiagnosticRenderer::emitStoredDiagnostic(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), extendLeft(), extendRight(), clang::Declarator::ExtendWithDeclSpec(), clang::PPConditionalDirectiveRecord::findConditionalDirectiveRegionLoc(), clang::arcmt::trans::findLocationAfterSemi(), findPreviousTokenKind(), findPreviousTokenStart(), GenerateFixForUnusedDecl(), GenerateNewArgTokens(), clang::index::generateUSRForMacro(), clang::Lexer::getAsCharRange(), clang::CallExpr::getBeginLoc(), clang::CompoundLiteralExpr::getBeginLoc(), clang::InitListExpr::getBeginLoc(), clang::DesignatedInitExpr::Designator::getBeginLoc(), clang::ModuleMap::getContainingModuleMapFile(), clang::ASTWriter::getDeclID(), clang::CXXTemporaryObjectExpr::getEndLoc(), clang::CallExpr::getEndLoc(), clang::MemberExpr::getEndLoc(), clang::InitListExpr::getEndLoc(), clang::SrcMgr::ExpansionInfo::getExpansionLocEnd(), clang::Lexer::getIndentationForLine(), clang::ObjCTypeParamTypeLoc::getLocalSourceRange(), clang::ObjCObjectTypeLoc::getLocalSourceRange(), clang::Lexer::getLocForEndOfToken(), clang::SourceManager::getMacroArgExpandedLocation(), getMissingDeclaratorIdLoc(), clang::Preprocessor::getModuleHeaderToIncludeForDiagnostics(), getNoteDiagForInvalidRedeclaration(), getNullabilityCompletenessCheckFileID(), getNumberOfModules(), getPaddingDiagFromTagKind(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getRawCommentForDeclNoCache(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::ObjCTypeParamDecl::getSourceRange(), clang::DeclaratorChunk::getSourceRange(), clang::ClassTemplateSpecializationDecl::getSourceRange(), clang::SrcMgr::ExpansionInfo::getSpellingLoc(), hasSuperInitCall(), clang::ASTImporter::Import(), clang::index::IndexingContext::indexTopLevelDecl(), clang::UsingDecl::isAccessDeclaration(), clang::UnresolvedUsingValueDecl::isAccessDeclaration(), clang::sema::FunctionScopeInfo::isCoroutine(), clang::OMPClause::isImplicit(), IsInAnyMacroBody(), clang::SourceManager::isInMainFile(), clang::ASTUnit::isInMainFileID(), clang::ASTUnit::isInPreambleFileID(), clang::CXXUnresolvedConstructExpr::isListInitialization(), clang::SrcMgr::ExpansionInfo::isMacroArgExpansion(), isPreprocessedEntityIfInFileID(), clang::Parser::ObjCTypeParamListScope::leave(), clang::Lexer::makeFileCharRange(), makeRangeFromFileLocs(), makeStandaloneDiagnostic(), mapDiagnosticRanges(), clang::ASTUnit::mapLocationFromPreamble(), clang::ASTUnit::mapLocationToPreamble(), syntax::TreeBuilder::markChildToken(), clang::Sema::MarkFunctionReferenced(), MarkVarDeclODRUsed(), clang::Sema::notePreviousDefinition(), clang::Parser::ParseUnqualifiedId(), clang::Sema::PerformCopyInitialization(), clang::PrettyStackTraceDecl::print(), printLoc(), ReadLineMarkerFlags(), recordNullabilitySeen(), clang::CodeGen::CGDebugInfo::remapDIPath(), clang::edit::Commit::replaceText(), clang::Sema::RequireCompleteDeclContext(), RewriteOneForwardClassDecl(), clang::arcmt::trans::MigrationContext::rewritePropertyAttribute(), rewriteToNSMacroDecl(), scanToNextArgument(), clang::sema::FunctionScopeInfo::setFirstCoroutineStmt(), clang::CXXScopeSpec::SetInvalid(), clang::CodeGen::CGDebugInfo::setLocation(), clang::Declarator::SetRangeBegin(), clang::Declarator::SetRangeEnd(), clang::DiagnosticsEngine::setSeverity(), clang::EnumDecl::setTemplateSpecializationKind(), shouldIgnoreDueToReservedName(), shouldIgnoreMacro(), clang::CoverageSourceInfo::SourceRangeSkipped(), clang::StoredDiagnostic::StoredDiagnostic(), clang::Declarator::takeAttributes(), clang::SourceManager::translateLineCol(), and tryConsumeLambdaSpecifierToken().
|
inline |
Definition at line 99 of file SourceLocation.h.
Referenced by clang::arcmt::trans::MigrationContext::addPropertyAttribute(), checkAllAtProps(), CheckIdentityFieldAssignment(), clang::Sema::CheckLogicalOperands(), CheckMemaccessSize(), CheckMoveOnConstruction(), checkRangesForMacroArgExpansion(), CompactMacroExpandedPieces(), clang::Sema::DiagnoseAlwaysNonNullPointer(), DiagnoseBinOpPrecedence(), clang::Sema::DiagnoseCommaOperator(), diagnoseDynamicExceptionSpecification(), clang::Sema::DiagnoseEqualityWithExtraParens(), DiagnoseNullConversion(), DiagnoseSelfAssignment(), DiagnoseSwitchLabelsFallthrough(), diagnoseTautologicalComparison(), clang::DiagnosticRenderer::emitDiagnostic(), FindLocsWithCommonFileID(), clang::PreprocessingRecord::findMacroDefinition(), clang::Sema::findMacroSpelling(), clang::Lexer::findNextToken(), findPreviousTokenKind(), findPreviousTokenStart(), clang::arcmt::trans::findSemiAfterLocation(), fixItNullability(), clang::TypedefNameDecl::getAnonDeclWithTypedefName(), getFirstStackedCallToHeaderFile(), clang::SourceManager::getImmediateExpansionRange(), clang::SourceManager::getImmediateMacroCallerLoc(), clang::Lexer::getImmediateMacroName(), clang::Lexer::getImmediateMacroNameForDiagnostics(), clang::Lexer::getIndentationForLine(), getLiteralInfo(), clang::Lexer::getLocForEndOfToken(), getMacroArgExpansionFileIDs(), clang::ento::CheckerContext::getMacroNameOrSpelling(), GetMappedTokenLoc(), clang::ASTContext::getRawCommentForDeclNoCache(), getTopMostMacro(), handleObjCOwnershipTypeAttr(), clang::html::HighlightMacros(), isArgumentExpandedFromMacro(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), IsEnumConstOrFromMacro(), IsFromSameFile(), isFunctionMacroExpansion(), isIdenticalStmt(), IsInAnyMacroBody(), clang::SourceManager::isInSystemMacro(), clang::SourceManager::isMacroArgExpansion(), clang::SourceManager::isMacroBodyExpansion(), isOriginMacroBody(), isPointerToConst(), IsTailPaddedMemberArray(), clang::Preprocessor::LexAfterModuleImport(), LocPropertyAttribute(), lookThroughRangesV3Condition(), LookThroughTransitiveAssignmentsAndCommaOperators(), clang::Lexer::makeFileCharRange(), mapDiagnosticRanges(), maybeRecoverWithZeroInitialization(), clang::edit::Commit::replaceText(), retrieveMacroLocation(), clang::arcmt::trans::MigrationContext::rewritePropertyAttribute(), rewriteToNumberLiteral(), clang::CoverageSourceInfo::SourceRangeSkipped(), SuggestInitializationFixit(), and updateConsecutiveMacroArgTokens().
|
inlinestatic |
Definition at line 173 of file SourceLocation.h.
References dump(), isFileID(), isValid(), and SM.
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 106 of file SourceLocation.h.
Referenced by clang::Sema::ActOnCXXTryBlock(), clang::Sema::ActOnFinishExportDecl(), clang::Sema::ActOnFinishLinkageSpecification(), clang::Sema::ActOnModuleDecl(), clang::Sema::ActOnOpenMPOrderedClause(), clang::Sema::ActOnSEHTryBlock(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTemplateParameterList(), clang::Sema::ActOnTypenameType(), clang::Sema::ActOnUsingDirective(), clang::Sema::AddCFAuditedAttribute(), addConstevalToLambdaDeclSpecifier(), addConstexprToLambdaDeclSpecifier(), clang::ento::PathDiagnosticPiece::addRange(), clang::Sema::AddRangeBasedOptnone(), clang::CodeGen::ApplyDebugLocation::ApplyDebugLocation(), assignInheritanceModel(), clang::Sema::AtomicPropertySetterGetterRules(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCaptureInit(), clang::Sema::BuildClassMessage(), clang::Sema::BuildCXXFunctionalCastExpr(), buildFixItInsertionLine(), clang::Sema::BuildInstanceMessage(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildQualifiedTemplateIdExpr(), BuildRecoveryCallExpr(), clang::ObjCMethodCall::canBeOverridenInSubclass(), clang::Sema::CheckBaseSpecifier(), clang::comments::Sema::checkBlockCommandEmptyParagraph(), clang::Sema::CheckCompletedCoroutineBody(), CheckConstexprDeclStmt(), clang::Sema::CheckConstexprFunctionBody(), CheckConstexprFunctionStmt(), clang::Sema::checkDeclIsAllowedInOpenMPTarget(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExceptionSpecSubset(), checkExportedDecl(), clang::Preprocessor::checkModuleIsAvailable(), checkNestingOfRegions(), clang::Sema::checkNonTrivialCUnionInInitializer(), clang::Sema::CheckPureMethod(), checkRangesForMacroArgExpansion(), checkScheduleModifiers(), clang::Sema::CheckSpecializationInstantiationRedecl(), CheckTemplateArgumentAddressOfObjectOrFunction(), CompactMacroExpandedPieces(), clang::Lexer::ComputePreamble(), clang::UnresolvedLookupExpr::Create(), clang::DependentScopeDeclRefExpr::Create(), clang::CXXDependentScopeMemberExpr::Create(), clang::UnresolvedMemberExpr::Create(), clang::ento::PathDiagnosticLocation::createEndOfPath(), clang::ento::PathDiagnosticLocation::createMemberLoc(), clang::Preprocessor::CreateString(), clang::CXXMethodDecl::CXXMethodDecl(), clang::DeclRefExpr::DeclRefExpr(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitCopyConstructor(), clang::Sema::DefineImplicitDefaultConstructor(), clang::Sema::DefineImplicitDestructor(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DefineImplicitMoveConstructor(), diagExportedUnnamedDecl(), DiagLocForExplicitInstantiation(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), DiagnoseMismatchedNewDelete(), diagnoseObjCARCConversion(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), DiagnoseTemplateParameterListArityMismatch(), clang::Sema::DiagnoseUnterminatedPragmaPack(), clang::tooling::DiagnosticMessage::DiagnosticMessage(), diagReturnOnAllocFailure(), clang::CodeGen::CGOpenMPRuntime::emitCall(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::DiagnosticRenderer::emitDiagnostic(), clang::TextDiagnostic::emitDiagnosticMessage(), emitNullabilityConsistencyWarning(), clang::DiagnosticRenderer::emitStoredDiagnostic(), EvaluateDefined(), clang::BuiltinTypeLoc::expandBuiltinRange(), clang::NestedNameSpecifierLocBuilder::Extend(), clang::sema::SemaPPCallbacks::FileChanged(), clang::syntax::FileRange::FileRange(), clang::MacroDirective::findDirectiveAtLoc(), fixItNullability(), clang::TypeLoc::getBeginLoc(), clang::MemberExpr::getBeginLoc(), clang::SourceManager::getDecomposedIncludedLoc(), clang::DeclarationNameInfo::getEndLoc(), clang::CXXConstructExpr::getEndLoc(), clang::CXXFunctionalCastExpr::getEndLoc(), clang::CXXUnresolvedConstructExpr::getEndLoc(), clang::CXXMemberCallExpr::getExprLoc(), clang::SourceManager::getFileCharacteristic(), clang::sema::FunctionScopeInfo::getFirstCoroutineStmtKeyword(), clang::DeclaratorChunk::getFunction(), getLastStmtLoc(), clang::SourceManager::getMacroArgExpandedLocation(), getMissingDeclaratorIdLoc(), clang::ASTReader::getModuleImportLoc(), syntax::TreeBuilder::getRange(), clang::Rewriter::getRewrittenText(), clang::VarDecl::getSourceRange(), clang::ClassTemplateSpecializationDecl::getSourceRange(), clang::TypeDecl::getSourceRange(), clang::TagDecl::getSourceRange(), getTargetEntryUniqueInfo(), clang::VAOptExpansionContext::getVAOptLoc(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandlePopUpPieceEndTag(), clang::LinkageSpecDecl::hasBraces(), clang::MSAsmStmt::hasBraces(), clang::ExportDecl::hasBraces(), clang::Declarator::hasEllipsis(), clang::arcmt::CapturedDiagList::hasErrors(), clang::ObjCTypeParamDecl::hasExplicitBound(), clang::sema::LambdaScopeInfo::hasPotentialCaptures(), clang::sema::LambdaScopeInfo::hasPotentialThisCapture(), clang::CodeGen::CodeGenModule::imbueXRayAttrs(), clang::TokenLexer::Init(), clang::ASTTemplateKWAndArgsInfo::initializeFrom(), clang::BackendConsumer::InlineAsmDiagHandler(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), clang::Lexer::isAtStartOfMacroExpansion(), clang::SourceManager::isBeforeInTranslationUnit(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::SanitizerBlacklist::isBlacklistedLocation(), clang::AnalysisDeclContext::isBodyAutosynthesizedFromModelFile(), IsBuiltInOrStandardCXX11Attribute(), IsCommonTypo(), clang::InitListExpr::isExplicit(), clang::Declarator::isFirstDeclarator(), clang::ento::AnalysisManager::isInCodeFile(), isInMainFile(), clang::CodeGen::CodeGenModule::isInSanitizerBlacklist(), clang::ento::CallEvent::isInSystemHeader(), clang::ObjCPropertyImplDecl::isIvarNameSpecified(), clang::SrcMgr::ExpansionInfo::isMacroBodyExpansion(), clang::DeclSpec::isModulePrivateSpecified(), clang::diff::isNodeExcluded(), isNonDriverDiag(), clang::LambdaCapture::isPackExpansion(), clang::CXXBaseSpecifier::isPackExpansion(), clang::ObjCDictionaryElement::isPackExpansion(), clang::ParsedAttr::isPackExpansion(), clang::CXXCtorInitializer::isPackExpansion(), clang::UnresolvedUsingValueDecl::isPackExpansion(), clang::UnresolvedUsingTypenameDecl::isPackExpansion(), isPairOfFileLocations(), clang::TokenLexer::isParsingPreprocessorDirective(), isSameWidthConstantConversion(), clang::DecompositionDeclarator::isSet(), isTargetEnvironment(), clang::MacroDirective::DefInfo::isUndefined(), clang::SourceRange::isValid(), clang::UnqualifiedId::isValid(), clang::Parser::ObjCTypeParamListScope::leave(), clang::TokenLexer::Lex(), clang::CompilerInstance::loadModule(), loadModuleMapForModuleBuild(), LookThroughTransitiveAssignmentsAndCommaOperators(), LookupMemberExprInRecord(), clang::Sema::LookupOrCreateLabel(), clang::Sema::MarkMemberReferenced(), MatchTemplateParameterKind(), mustSynthesizeSetterGetterMethod(), clang::Sema::notePreviousDefinition(), clang::OverloadExpr::OverloadExpr(), ParseAlignPragma(), clang::Parser::ParseOpenMPParensExpr(), clang::Parser::ParseUnqualifiedId(), clang::ento::PathDiagnosticLocation::PathDiagnosticLocation(), PerformConstructorInitialization(), clang::PrettyStackTraceLoc::print(), clang::PrettyDeclStackTraceEntry::print(), clang::PrettyStackTraceDecl::print(), PrintFloatingLiteral(), PrintMacroDefinition(), clang::printSourceLocationAsJson(), clang::TreeTransform< Derived >::RebuildDependentScopeDeclRefExpr(), clang::CodeGen::CGDebugInfo::remapDIPath(), RewriteOneForwardClassDecl(), clang::arcmt::trans::MigrationContext::rewritePropertyAttribute(), rewriteToNSEnumDecl(), clang::comments::BlockCommandComment::setArgs(), clang::comments::HTMLStartTagComment::setAttrs(), clang::DiagnosticsEngine::SetDelayedDiagnostic(), clang::comments::BlockCommandComment::setParagraph(), clang::ClassTemplateSpecializationDecl::setPointOfInstantiation(), clang::VarTemplateSpecializationDecl::setPointOfInstantiation(), clang::LinkageSpecDecl::setRBraceLoc(), clang::VarDecl::setTemplateSpecializationKind(), clang::FunctionDecl::setTemplateSpecializationKind(), clang::EnumDecl::setTemplateSpecializationKind(), clang::VisibleModuleSet::setVisible(), clang::XRayFunctionFilter::shouldImbueLocation(), clang::CoverageSourceInfo::SourceRangeSkipped(), clang::StoredDiagnostic::StoredDiagnostic(), SuggestParentheses(), takeDeclAttributes(), clang::TreeTransform< Derived >::TemporaryBase::TemporaryBase(), clang::syntax::Token::Token(), toLevel(), clang::TreeTransform< Derived >::TransformOverloadExprDecls(), translateTemplateArgument(), tryConsumeLambdaSpecifierToken(), clang::UndefMacroDirective::UndefMacroDirective(), VersionNumberSeparator(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ento::taint::TaintBugVisitor::VisitNode(), clang::ASTNodeImporter::VisitUnresolvedLookupExpr(), clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl(), and warnInvalidLock().
void SourceLocation::print | ( | raw_ostream & | OS, |
const SourceManager & | SM | ||
) | const |
Definition at line 43 of file SourceLocation.cpp.
References clang::PresumedLoc::getColumn(), clang::SourceManager::getExpansionLoc(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::SourceManager::getPresumedLoc(), clang::SourceManager::getSpellingLoc(), clang::PresumedLoc::isInvalid(), and print().
Referenced by clang::comments::Token::dump(), clang::arcmt::trans::MigrationContext::dumpGCAttrs(), clang::Preprocessor::DumpLocation(), clang::PrettyStackTraceLoc::print(), clang::PrettyDeclStackTraceEntry::print(), print(), clang::PrettyStackTraceDecl::print(), printLocation(), clang::PrintingCodeCompleteConsumer::ProcessOverloadCandidates(), and clang::DiagnosticsEngine::SetDelayedDiagnostic().
LLVM_DUMP_METHOD std::string SourceLocation::printToString | ( | const SourceManager & | SM | ) | const |
Definition at line 70 of file SourceLocation.cpp.
|
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.
Referenced by clang::tooling::Transformer::run().