clang 22.0.0git
Public Member Functions | Friends | List of all members
clang::NestedNameSpecifierLoc Class Reference

A C++ nested-name-specifier augmented with source location information. More...

#include "clang/AST/NestedNameSpecifierBase.h"

Public Member Functions

 NestedNameSpecifierLoc ()=default
 Construct an empty nested-name-specifier.
 
 NestedNameSpecifierLoc (NestedNameSpecifier Qualifier, void *Data)
 Construct a nested-name-specifier with source location information from.
 
 operator bool () const
 Evaluates true when this nested-name-specifier location is non-empty.
 
bool hasQualifier () const
 Evaluates true when this nested-name-specifier location is non-empty.
 
NestedNameSpecifier getNestedNameSpecifier () const
 Retrieve the nested-name-specifier to which this instance refers.
 
void * getOpaqueData () const
 Retrieve the opaque pointer that refers to source-location data.
 
SourceRange getSourceRange () const LLVM_READONLY
 Retrieve the source range covering the entirety of this nested-name-specifier.
 
SourceRange getLocalSourceRange () const
 Retrieve the source range covering just the last part of this nested-name-specifier, not including the prefix.
 
SourceLocation getBeginLoc () const
 Retrieve the location of the beginning of this nested-name-specifier.
 
SourceLocation getEndLoc () const
 Retrieve the location of the end of this nested-name-specifier.
 
SourceLocation getLocalBeginLoc () const
 Retrieve the location of the beginning of this component of the nested-name-specifier.
 
SourceLocation getLocalEndLoc () const
 Retrieve the location of the end of this component of the nested-name-specifier.
 
NamespaceAndPrefixLoc castAsNamespaceAndPrefix () const
 For a nested-name-specifier that refers to a namespace, retrieve the namespace and its prefix.
 
NamespaceAndPrefixLoc getAsNamespaceAndPrefix () const
 
TypeLoc castAsTypeLoc () const
 For a nested-name-specifier that refers to a type, retrieve the type with source-location information.
 
TypeLoc getAsTypeLoc () const
 
unsigned getDataLength () const
 Determines the data length for the entire nested-name-specifier.
 

Friends

bool operator== (NestedNameSpecifierLoc X, NestedNameSpecifierLoc Y)
 
bool operator!= (NestedNameSpecifierLoc X, NestedNameSpecifierLoc Y)
 

Detailed Description

A C++ nested-name-specifier augmented with source location information.

Definition at line 301 of file NestedNameSpecifierBase.h.

Constructor & Destructor Documentation

◆ NestedNameSpecifierLoc() [1/2]

clang::NestedNameSpecifierLoc::NestedNameSpecifierLoc ( )
default

Construct an empty nested-name-specifier.

Referenced by castAsNamespaceAndPrefix().

◆ NestedNameSpecifierLoc() [2/2]

clang::NestedNameSpecifierLoc::NestedNameSpecifierLoc ( NestedNameSpecifier  Qualifier,
void *  Data 
)
inline

Construct a nested-name-specifier with source location information from.

Definition at line 335 of file NestedNameSpecifierBase.h.

References Data.

Member Function Documentation

◆ castAsNamespaceAndPrefix()

NamespaceAndPrefixLoc clang::NestedNameSpecifierLoc::castAsNamespaceAndPrefix ( ) const
inline

For a nested-name-specifier that refers to a namespace, retrieve the namespace and its prefix.

For example, if this instance refers to a nested-name-specifier ::std::chrono::, the prefix is ::std::. Note that the returned prefix may be empty, if this is the first component of the nested-name-specifier.

Definition at line 174 of file NestedNameSpecifier.h.

References NestedNameSpecifierLoc().

Referenced by getAsNamespaceAndPrefix(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), and clang::RecursiveASTVisitor< Derived >::TraverseNestedNameSpecifierLoc().

◆ castAsTypeLoc()

TypeLoc clang::NestedNameSpecifierLoc::castAsTypeLoc ( ) const
inline

◆ getAsNamespaceAndPrefix()

NamespaceAndPrefixLoc clang::NestedNameSpecifierLoc::getAsNamespaceAndPrefix ( ) const
inline

◆ getAsTypeLoc()

TypeLoc clang::NestedNameSpecifierLoc::getAsTypeLoc ( ) const
inline

◆ getBeginLoc()

SourceLocation NestedNameSpecifierLoc::getBeginLoc ( ) const

◆ getDataLength()

unsigned clang::NestedNameSpecifierLoc::getDataLength ( ) const
inline

Determines the data length for the entire nested-name-specifier.

Definition at line 195 of file NestedNameSpecifier.h.

References getDataLength().

Referenced by getDataLength(), and getLocalSourceRange().

◆ getEndLoc()

SourceLocation clang::NestedNameSpecifierLoc::getEndLoc ( ) const
inline

Retrieve the location of the end of this nested-name-specifier.

Definition at line 231 of file NestedNameSpecifier.h.

References clang::SourceRange::getEnd(), and getLocalSourceRange().

Referenced by getSourceRange(), and clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc().

◆ getLocalBeginLoc()

SourceLocation clang::NestedNameSpecifierLoc::getLocalBeginLoc ( ) const
inline

◆ getLocalEndLoc()

SourceLocation clang::NestedNameSpecifierLoc::getLocalEndLoc ( ) const
inline

◆ getLocalSourceRange()

SourceRange clang::NestedNameSpecifierLoc::getLocalSourceRange ( ) const
inline

Retrieve the source range covering just the last part of this nested-name-specifier, not including the prefix.

For example, if this instance refers to a nested-name-specifier ::std::vector<int>::, the returned source range would cover from "vector" to the last '::'.

Definition at line 199 of file NestedNameSpecifier.h.

References clang::TypeLoc::getBeginLoc(), getDataLength(), clang::NestedNameSpecifier::Global, Kind, clang::NestedNameSpecifier::MicrosoftSuper, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::Null, and clang::NestedNameSpecifier::Type.

Referenced by clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), getEndLoc(), getLocalBeginLoc(), and getLocalEndLoc().

◆ getNestedNameSpecifier()

NestedNameSpecifier clang::NestedNameSpecifierLoc::getNestedNameSpecifier ( ) const
inline

Retrieve the nested-name-specifier to which this instance refers.

Definition at line 348 of file NestedNameSpecifierBase.h.

Referenced by clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), clang::Sema::CheckTypenameType(), llvm::DenseMapInfo< clang::NestedNameSpecifierLoc >::getHashValue(), clang::TagDecl::getQualifier(), clang::UsingDirectiveDecl::getQualifier(), clang::NamespaceAliasDecl::getQualifier(), clang::UsingDecl::getQualifier(), clang::UsingEnumDecl::getQualifier(), clang::UnresolvedUsingValueDecl::getQualifier(), clang::UnresolvedUsingTypenameDecl::getQualifier(), clang::DeclRefExpr::getQualifier(), clang::MemberExpr::getQualifier(), clang::CXXPseudoDestructorExpr::getQualifier(), clang::OverloadExpr::getQualifier(), clang::DependentScopeDeclRefExpr::getQualifier(), clang::CXXDependentScopeMemberExpr::getQualifier(), getRangeOfTypeInNestedNameSpecifier(), clang::ASTImporter::Import(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), isEnableIf(), clang::ConceptReference::print(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::TreeTransform< Derived >::RebuildMemberExpr(), clang::ElaboratedNameTypeLoc< TL, T >::set(), clang::TemplateSpecializationTypeLoc::set(), clang::TagTypeLoc::setQualifierLoc(), clang::MemberPointerTypeLoc::setQualifierLoc(), clang::DeducedTemplateSpecializationTypeLoc::setQualifierLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), clang::DependentTemplateSpecializationTypeLoc::setQualifierLoc(), clang::TemplateArgumentLoc::TemplateArgumentLoc(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), clang::TreeTransform< Derived >::TransformTagType(), clang::TreeTransform< Derived >::TransformTemplateName(), clang::RecursiveASTVisitor< Derived >::TraverseNestedNameSpecifierLoc(), and clang::tooling::RecursiveSymbolVisitor< T >::TraverseNestedNameSpecifierLoc().

◆ getOpaqueData()

void * clang::NestedNameSpecifierLoc::getOpaqueData ( ) const
inline

◆ getSourceRange()

SourceRange clang::NestedNameSpecifierLoc::getSourceRange ( ) const
inline

Retrieve the source range covering the entirety of this nested-name-specifier.

For example, if this instance refers to a nested-name-specifier ::std::vector<int>::, the returned source range would cover from the initial '::' to the last '::'.

Definition at line 227 of file NestedNameSpecifier.h.

References getBeginLoc(), and getEndLoc().

Referenced by clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckFriendAccess(), clang::NestedNameSpecifierLocBuilder::getSourceRange(), clang::ASTImporter::Import(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), and clang::TreeTransform< Derived >::TransformOverloadExprDecls().

◆ hasQualifier()

bool clang::NestedNameSpecifierLoc::hasQualifier ( ) const
inline

Evaluates true when this nested-name-specifier location is non-empty.

Definition at line 344 of file NestedNameSpecifierBase.h.

References bool.

Referenced by clang::MemberExpr::Create(), clang::CXXPseudoDestructorExpr::hasQualifier(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().

◆ operator bool()

clang::NestedNameSpecifierLoc::operator bool ( ) const
inlineexplicit

Evaluates true when this nested-name-specifier location is non-empty.

Definition at line 340 of file NestedNameSpecifierBase.h.

References bool.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( NestedNameSpecifierLoc  X,
NestedNameSpecifierLoc  Y 
)
friend

Definition at line 408 of file NestedNameSpecifierBase.h.

◆ operator==

bool operator== ( NestedNameSpecifierLoc  X,
NestedNameSpecifierLoc  Y 
)
friend

Definition at line 404 of file NestedNameSpecifierBase.h.


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