clang 10.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/NestedNameSpecifier.h"`

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

## 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 236 of file NestedNameSpecifier.h.

## Constructor & Destructor Documentation

## ◆ NestedNameSpecifierLoc() [1/2]

clang::NestedNameSpecifierLoc::NestedNameSpecifierLoc | ( |  | ) |
| default

Construct an empty nested-name-specifier.

## ◆ NestedNameSpecifierLoc() [2/2]

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

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

Definition at line 254 of file NestedNameSpecifier.h.

## Member Function Documentation

## ◆ getBeginLoc()

SourceLocation clang::NestedNameSpecifierLoc::getBeginLoc | ( |  | ) | const
| inline

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

Definition at line 292 of file NestedNameSpecifier.h.

References clang::CharSourceRange::getBegin(), and clang::tooling::fixit::internal::getSourceRange().

Referenced by clang::Sema::CheckUsingShadowDecl(), clang::MSPropertyRefExpr::getBeginLoc(), clang::DeclRefExpr::getBeginLoc(), clang::DependentScopeDeclRefExpr::getBeginLoc(), clang::Sema::SubstNestedNameSpecifierLoc(), and clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc().

## ◆ getDataLength()

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

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

Definition at line 333 of file NestedNameSpecifier.h.

References getDataLength().

Referenced by clang::NestedNameSpecifier::dump(), and getDataLength().

## ◆ getEndLoc()

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

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

Definition at line 298 of file NestedNameSpecifier.h.

References clang::CharSourceRange::getEnd(), and clang::tooling::fixit::internal::getSourceRange().

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

## ◆ getLocalBeginLoc()

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

Retrieve the location of the beginning of this component of the nested-name-specifier.

Definition at line 304 of file NestedNameSpecifier.h.

References clang::SourceRange::getBegin().

Referenced by clang::index::IndexingContext::indexNestedNameSpecifierLoc(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), and clang::tooling::RecursiveSymbolVisitor< T >::TraverseNestedNameSpecifierLoc().

## ◆ getLocalEndLoc()

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

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

Definition at line 310 of file NestedNameSpecifier.h.

References clang::SourceRange::getEnd().

Referenced by clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), and clang::tooling::RecursiveSymbolVisitor< T >::TraverseNestedNameSpecifierLoc().

## ◆ getLocalSourceRange()

SourceRange NestedNameSpecifierLoc::getLocalSourceRange | ( |  | ) | const

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 433 of file NestedNameSpecifier.cpp.

References clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, LoadPointer(), LoadSourceLocation(), clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, Offset, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.

Referenced by clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), and getSourceRange().

## ◆ getNestedNameSpecifier()

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

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

Definition at line 267 of file NestedNameSpecifier.h.

Referenced by clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), clang::NestedNameSpecifierLocBuilder::Adopt(), clang::Sema::CheckTypenameType(), clang::DeclRefExpr::DeclRefExpr(), clang::CXXUnresolvedConstructExpr::getBeginLoc(), getExpressionTraitName(), clang::CXXPseudoDestructorExpr::getQualifier(), clang::UsingDirectiveDecl::getQualifier(), clang::OverloadExpr::getQualifier(), clang::NamespaceAliasDecl::getQualifier(), clang::DependentScopeDeclRefExpr::getQualifier(), clang::UsingDecl::getQualifier(), clang::CXXDependentScopeMemberExpr::getQualifier(), clang::UnresolvedUsingValueDecl::getQualifier(), clang::UnresolvedUsingTypenameDecl::getQualifier(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), isEnableIf(), clang::OverloadExpr::OverloadExpr(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::TreeTransform< Derived >::RebuildDependentTemplateSpecializationType(), clang::TreeTransform< Derived >::RebuildElaboratedType(), clang::ElaboratedTypeLoc::setQualifierLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), clang::DependentTemplateSpecializationTypeLoc::setQualifierLoc(), clang::ConceptSpecializationExpr::setTemplateArguments(), clang::TemplateArgumentLocInfo::TemplateArgumentLocInfo(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), clang::tooling::RecursiveSymbolVisitor< T >::TraverseNestedNameSpecifierLoc(), and clang::RecursiveASTVisitor< CallGraph >::TraverseNestedNameSpecifierLoc().

## ◆ getOpaqueData()

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

Retrieve the opaque pointer that refers to source-location data.

Definition at line 272 of file NestedNameSpecifier.h.

References clang::tooling::fixit::internal::getSourceRange().

Referenced by clang::NestedNameSpecifierLocBuilder::Adopt(), clang::ElaboratedTypeLoc::setQualifierLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), clang::DependentTemplateSpecializationTypeLoc::setQualifierLoc(), clang::TemplateArgumentLocInfo::TemplateArgumentLocInfo(), and clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc().

## ◆ getPrefix()

NestedNameSpecifierLoc clang::NestedNameSpecifierLoc::getPrefix | ( |  | ) | const
| inline

Return the prefix of this nested-name-specifier.

For example, if this instance refers to a nested-name-specifier `::std::vector<int>`::, 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 320 of file NestedNameSpecifier.h.

References clang::NestedNameSpecifier::getPrefix().

Referenced by clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), getSourceRange(), clang::ASTImporter::Import(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), and clang::RecursiveASTVisitor< CallGraph >::TraverseNestedNameSpecifierLoc().

## ◆ getSourceRange()

SourceRange NestedNameSpecifierLoc::getSourceRange | ( |  | ) | const

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 421 of file NestedNameSpecifier.cpp.

References clang::First, clang::SourceRange::getBegin(), getLocalSourceRange(), and getPrefix().

Referenced by clang::Sema::CheckUsingShadowDecl(), DiagnoseReinterpretUpDownCast(), clang::NestedNameSpecifierLocBuilder::getSourceRange(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::TreeTransform< Derived >::RebuildDependentNameType(), and TryAddressSpaceCast().

## ◆ getTypeLoc()

TypeLoc NestedNameSpecifierLoc::getTypeLoc | ( |  | ) | const

For a nested-name-specifier that refers to a type, retrieve the type with source-location information.

Definition at line 463 of file NestedNameSpecifier.cpp.

References clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), LoadPointer(), Offset, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.

Referenced by clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), isEnableIf(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), and clang::RecursiveASTVisitor< CallGraph >::TraverseNestedNameSpecifierLoc().

## ◆ hasQualifier()

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

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

Definition at line 263 of file NestedNameSpecifier.h.

Referenced by clang::CXXPseudoDestructorExpr::hasQualifier().

## ◆ operator bool()

clang::NestedNameSpecifierLoc::operator bool | ( |  | ) | const
| inline explicit

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

Definition at line 259 of file NestedNameSpecifier.h.

## Friends And Related Function Documentation

## ◆ operator!=

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

Definition at line 340 of file NestedNameSpecifier.h.

## ◆ operator==

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

Definition at line 335 of file NestedNameSpecifier.h.

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

- include/clang/AST/NestedNameSpecifier.h
- lib/AST/NestedNameSpecifier.cpp