clang 10.0.0git

Functions
clang::TypeName Namespace Reference

## Functions
std::string | getFullyQualifiedName (QualType QT, const ASTContext &Ctx, const PrintingPolicy &Policy, bool WithGlobalNsPrefix=false)
| Get the fully qualified name for a type. More...
QualType | getFullyQualifiedType (QualType QT, const ASTContext &Ctx, bool WithGlobalNsPrefix=false)
| Generates a QualType that can be used to name the same type if used at the end of the current translation unit. More...
static NestedNameSpecifier * | createNestedNameSpecifier (const ASTContext &Ctx, const NamespaceDecl *Namesp, bool WithGlobalNsPrefix)
| Create a NestedNameSpecifier for Namesp and its enclosing scopes. More...
static NestedNameSpecifier * | createNestedNameSpecifier (const ASTContext &Ctx, const TypeDecl *TD, bool FullyQualify, bool WithGlobalNsPrefix)
| Create a NestedNameSpecifier for TagDecl and its enclosing scopes. More...
static NestedNameSpecifier * | createNestedNameSpecifierForScopeOf (const ASTContext &Ctx, const Decl *Decl, bool FullyQualified, bool WithGlobalNsPrefix)
| Create a nested name specifier for the declaring context of the type. More...
static NestedNameSpecifier * | getFullyQualifiedNestedNameSpecifier (const ASTContext &Ctx, NestedNameSpecifier *Scope, bool WithGlobalNsPrefix)
| Return a fully qualified version of this name specifier. More...
static bool | getFullyQualifiedTemplateName (const ASTContext &Ctx, TemplateName &TName, bool WithGlobalNsPrefix)
static bool | getFullyQualifiedTemplateArgument (const ASTContext &Ctx, TemplateArgument &Arg, bool WithGlobalNsPrefix)
static const Type * | getFullyQualifiedTemplateType (const ASTContext &Ctx, const Type *TypePtr, bool WithGlobalNsPrefix)
static NestedNameSpecifier * | createOuterNNS (const ASTContext &Ctx, const Decl *D, bool FullyQualify, bool WithGlobalNsPrefix)
static NestedNameSpecifier * | createNestedNameSpecifierForScopeOf (const ASTContext &Ctx, const Type *TypePtr, bool FullyQualified, bool WithGlobalNsPrefix)
| Create a nested name specifier for the declaring context of the type. More...

## Function Documentation

## ◆ createNestedNameSpecifier() [1/2]

NestedNameSpecifier * clang::TypeName::createNestedNameSpecifier | ( | const ASTContext & | Ctx,
|  | const NamespaceDecl * | Namesp,
|  | bool | WithGlobalNsPrefix
| ) |  |
| static

Create a NestedNameSpecifier for Namesp and its enclosing scopes.

Parameters

  [in] | Ctx | - the AST Context to be used.
  [in] | Namesp | - the NamespaceDecl for which a NestedNameSpecifier is requested.
  [in] | WithGlobalNsPrefix | - Indicate whether the global namespace specifier "::" should be prepended or not.

Definition at line 339 of file QualTypeNames.cpp.

References clang::NestedNameSpecifier::Create(), createOuterNNS(), clang::Decl::getDeclContext(), and clang::NamespaceDecl::isInline().

Referenced by createNestedNameSpecifierForScopeOf(), createOuterNNS(), and getFullyQualifiedNestedNameSpecifier().

## ◆ createNestedNameSpecifier() [2/2]

NestedNameSpecifier * clang::TypeName::createNestedNameSpecifier | ( | const ASTContext & | Ctx,
|  | const TypeDecl * | TD,
|  | bool | FullyQualify,
|  | bool | WithGlobalNsPrefix
| ) |  |
| static

Create a NestedNameSpecifier for TagDecl and its enclosing scopes.

Parameters

  [in] | Ctx | - the AST Context to be used.
  [in] | TD | - the TagDecl for which a NestedNameSpecifier is requested.
  [in] | FullyQualify | - Convert all template arguments into fully qualified names.
  [in] | WithGlobalNsPrefix | - Indicate whether the global namespace specifier "::" should be prepended or not.

Definition at line 355 of file QualTypeNames.cpp.

References clang::NestedNameSpecifier::Create(), createOuterNNS(), and clang::TypeDecl::getTypeForDecl().

## ◆ createNestedNameSpecifierForScopeOf() [1/2]

static NestedNameSpecifier * clang::TypeName::createNestedNameSpecifierForScopeOf | ( | const ASTContext & | Ctx,
|  | const Decl * | Decl,
|  | bool | FullyQualified,
|  | bool | WithGlobalNsPrefix
| ) |  |
| static

Create a nested name specifier for the declaring context of the type.

Definition at line 264 of file QualTypeNames.cpp.

References createNestedNameSpecifier(), clang::Decl::getDeclContext(), clang::DeclContext::getRedeclContext(), clang::NestedNameSpecifier::GlobalSpecifier(), and clang::DeclContext::isTranslationUnit().

Referenced by createNestedNameSpecifierForScopeOf(), getFullyQualifiedTemplateName(), and getFullyQualifiedType().

## ◆ createNestedNameSpecifierForScopeOf() [2/2]

static NestedNameSpecifier* clang::TypeName::createNestedNameSpecifierForScopeOf | ( | const ASTContext & | Ctx,
|  | const Type * | TypePtr,
|  | bool | FullyQualified,
|  | bool | WithGlobalNsPrefix
| ) |  |
| static

Create a nested name specifier for the declaring context of the type.

Definition at line 316 of file QualTypeNames.cpp.

References createNestedNameSpecifierForScopeOf(), and clang::Type::getAsCXXRecordDecl().

## ◆ createOuterNNS()

static NestedNameSpecifier* clang::TypeName::createOuterNNS | ( | const ASTContext & | Ctx,
|  | const Decl * | D,
|  | bool | FullyQualify,
|  | bool | WithGlobalNsPrefix
| ) |  |
| static

Definition at line 186 of file QualTypeNames.cpp.

References createNestedNameSpecifier(), clang::Decl::getDeclContext(), clang::NestedNameSpecifier::GlobalSpecifier(), and clang::DeclContext::isTranslationUnit().

Referenced by createNestedNameSpecifier().

## ◆ getFullyQualifiedName()

std::string clang::TypeName::getFullyQualifiedName | ( | QualType | QT,
|  | const ASTContext & | Ctx,
|  | const PrintingPolicy & | Policy,
|  | bool | WithGlobalNsPrefix = `false`
| ) |  |

Get the fully qualified name for a type.

This includes full qualification of all template parameters etc.

Parameters

  [in] | QT | - the type for which the fully qualified name will be returned.
  [in] | Ctx | - the ASTContext to be used.
  [in] | WithGlobalNsPrefix | - If true, then the global namespace specifier "::" will be prepended to the fully qualified name.

Definition at line 463 of file QualTypeNames.cpp.

References clang::QualType::getAsString(), and getFullyQualifiedType().

## ◆ getFullyQualifiedNestedNameSpecifier()

static NestedNameSpecifier * clang::TypeName::getFullyQualifiedNestedNameSpecifier | ( | const ASTContext & | Ctx,
|  | NestedNameSpecifier * | scope,
|  | bool | WithGlobalNsPrefix
| ) |  |
| static

Return a fully qualified version of this name specifier.

Definition at line 211 of file QualTypeNames.cpp.

References createNestedNameSpecifier(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsType(), clang::NamespaceDecl::getCanonicalDecl(), clang::NestedNameSpecifier::getKind(), clang::NamespaceAliasDecl::getNamespace(), clang::NestedNameSpecifier::getPrefix(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.

Referenced by getFullyQualifiedTemplateName().

## ◆ getFullyQualifiedTemplateArgument()

static bool clang::TypeName::getFullyQualifiedTemplateArgument | ( | const ASTContext & | Ctx,
|  | TemplateArgument & | Arg,
|  | bool | WithGlobalNsPrefix
| ) |  |
| static

Definition at line 90 of file QualTypeNames.cpp.

References clang::TemplateArgument::getAsTemplate(), clang::TemplateArgument::getAsType(), getFullyQualifiedTemplateName(), getFullyQualifiedType(), clang::TemplateArgument::getKind(), clang::TemplateArgument::Template, and clang::TemplateArgument::Type.

Referenced by getFullyQualifiedTemplateType().

## ◆ getFullyQualifiedTemplateName()

static bool clang::TypeName::getFullyQualifiedTemplateName | ( | const ASTContext & | Ctx,
|  | TemplateName & | TName,
|  | bool | WithGlobalNsPrefix
| ) |  |
| static

Definition at line 56 of file QualTypeNames.cpp.

References createNestedNameSpecifierForScopeOf(), clang::TemplateName::getAsQualifiedTemplateName(), clang::TemplateName::getAsTemplateDecl(), getFullyQualifiedNestedNameSpecifier(), clang::ASTContext::getQualifiedTemplateName(), clang::QualifiedTemplateName::getQualifier(), and clang::QualifiedTemplateName::hasTemplateKeyword().

Referenced by getFullyQualifiedTemplateArgument().

## ◆ getFullyQualifiedTemplateType()

static const Type* clang::TypeName::getFullyQualifiedTemplateType | ( | const ASTContext & | Ctx,
|  | const Type * | TypePtr,
|  | bool | WithGlobalNsPrefix
| ) |  |
| static

Definition at line 116 of file QualTypeNames.cpp.

References getFullyQualifiedTemplateArgument(), clang::ASTContext::getTemplateSpecializationType(), clang::QualType::getTypePtr(), and clang::TemplateArgumentList::size().

Referenced by getFullyQualifiedType().

## ◆ getFullyQualifiedType()

QualType clang::TypeName::getFullyQualifiedType | ( | QualType | QT,
|  | const ASTContext & | Ctx,
|  | bool | WithGlobalNsPrefix = `false`
| ) |  |

Generates a QualType that can be used to name the same type if used at the end of the current translation unit.

Return the fully qualified type, including fully-qualified versions of any template parameters.

This ignores issues such as type shadowing.

Parameters

  [in] | QT | - the type for which the fully qualified type will be returned.
  [in] | Ctx | - the ASTContext to be used.
  [in] | WithGlobalNsPrefix | - Indicate whether the global namespace specifier "::" should be prepended or not.

Definition at line 368 of file QualTypeNames.cpp.

References createNestedNameSpecifierForScopeOf(), clang::ETK_None, clang::ASTContext::getElaboratedType(), getFullyQualifiedTemplateType(), clang::QualType::getLocalQualifiers(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getMemberPointerType(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::ASTContext::getRValueReferenceType(), clang::QualType::getTypePtr(), and clang::QualType::hasLocalQualifiers().

Referenced by getFullyQualifiedName(), and getFullyQualifiedTemplateArgument().