ASTContext &Ctx,
28 constNamespaceDecl *Namesp,
29 boolWithGlobalNsPrefix);
42 constASTContext &Ctx,
constTypeDecl *TD,
43 boolFullyQualify,
boolWithGlobalNsPrefix);
46 constASTContext &Ctx,
constDecl *
decl,
47 boolFullyQualified,
boolWithGlobalNsPrefix);
50 constASTContext &Ctx, NestedNameSpecifier *scope,
boolWithGlobalNsPrefix);
54 boolWithGlobalNsPrefix) {
55 boolChanged =
false;
61assert(ArgTDecl !=
nullptr);
68Ctx, NNS, WithGlobalNsPrefix);
77Ctx, ArgTDecl,
true, WithGlobalNsPrefix);
84Ctx.getQualifiedTemplateName(NNS,
85 false, UnderlyingTN);
93 boolWithGlobalNsPrefix) {
94 boolChanged =
false;
119 boolWithGlobalNsPrefix) {
123assert(!isa<DependentTemplateSpecializationType>(TypePtr));
126 if(
const auto*TST = dyn_cast<const TemplateSpecializationType>(TypePtr)) {
127 boolMightHaveChanged =
false;
133Ctx, Arg, WithGlobalNsPrefix);
134FQArgs.push_back(Arg);
139 if(MightHaveChanged) {
140 QualTypeQT = Ctx.getTemplateSpecializationType(
141TST->getTemplateName(), FQArgs,
142TST->getCanonicalTypeInternal());
148}
else if(
const auto*TSTRecord = dyn_cast<const RecordType>(TypePtr)) {
153 if(
const auto*TSTDecl =
154dyn_cast<ClassTemplateSpecializationDecl>(TSTRecord->getDecl())) {
157 boolMightHaveChanged =
false;
159 for(
unsigned intI = 0,
E= TemplateArgs.
size(); I !=
E; ++I) {
164Ctx, Arg, WithGlobalNsPrefix);
165FQArgs.push_back(Arg);
170 if(MightHaveChanged) {
172 QualTypeQT = Ctx.getTemplateSpecializationType(
174TSTRecord->getCanonicalTypeInternal());
187 boolWithGlobalNsPrefix) {
189 if(
const auto*NS = dyn_cast<NamespaceDecl>(DC)) {
190 while(NS && NS->isInline()) {
192NS = dyn_cast<NamespaceDecl>(NS->getDeclContext());
194 if(NS && NS->getDeclName()) {
198}
else if(
const auto*TD = dyn_cast<TagDecl>(DC)) {
200}
else if(
const auto*TDD = dyn_cast<TypedefNameDecl>(DC)) {
202Ctx, TDD, FullyQualify, WithGlobalNsPrefix);
212 boolWithGlobalNsPrefix) {
213 switch(
Scope->getKind()) {
219Ctx,
Scope->getAsNamespace(), WithGlobalNsPrefix);
227 Scope->getAsNamespaceAlias()->getNamespace()->getCanonicalDecl(),
234Ctx,
Scope->getPrefix(), WithGlobalNsPrefix);
242TD = TagDeclType->getDecl();
250}
else if(
const auto*TDD = dyn_cast<TypedefType>(
Type)) {
258llvm_unreachable(
"bad NNS kind");
265 boolFullyQualified,
boolWithGlobalNsPrefix) {
269 const auto*Outer = dyn_cast<NamedDecl>(DC);
270 const auto*OuterNS = dyn_cast<NamespaceDecl>(DC);
271 if(Outer && !(OuterNS && OuterNS->isAnonymousNamespace())) {
272 if(
const auto*CxxDecl = dyn_cast<CXXRecordDecl>(DC)) {
274CxxDecl->getDescribedClassTemplate()) {
285 if(ClassTempl->spec_begin() != ClassTempl->spec_end()) {
286 Decl= *(ClassTempl->spec_begin());
287Outer = dyn_cast<NamedDecl>(
Decl);
288OuterNS = dyn_cast<NamespaceDecl>(
Decl);
295}
else if(
const auto*TD = dyn_cast<TagDecl>(Outer)) {
297Ctx, TD, FullyQualified, WithGlobalNsPrefix);
298}
else if(isa<TranslationUnitDecl>(Outer)) {
317 boolFullyQualified,
boolWithGlobalNsPrefix) {
318 if(!TypePtr)
return nullptr;
322 if(
const auto*TDT = dyn_cast<TypedefType>(TypePtr)) {
323 Decl= TDT->getDecl();
324}
else if(
const auto*TagDeclType = dyn_cast<TagType>(TypePtr)) {
325 Decl= TagDeclType->getDecl();
326}
else if(
const auto*TST = dyn_cast<TemplateSpecializationType>(TypePtr)) {
327 Decl= TST->getTemplateName().getAsTemplateDecl();
332 if(!
Decl)
return nullptr;
335Ctx,
Decl, FullyQualified, WithGlobalNsPrefix);
340 boolWithGlobalNsPrefix) {
341 while(Namespace && Namespace->isInline()) {
343Namespace = dyn_cast<NamespaceDecl>(Namespace->getDeclContext());
345 if(!Namespace)
return nullptr;
347 boolFullyQualified =
true;
350 createOuterNNS(Ctx, Namespace, FullyQualified, WithGlobalNsPrefix),
357 boolWithGlobalNsPrefix) {
359 if(isa<const TemplateSpecializationType>(TypePtr) ||
360isa<const RecordType>(TypePtr)) {
376 boolWithGlobalNsPrefix) {
383QT = Ctx.getPointerType(QT);
385QT = Ctx.getQualifiedType(QT, Quals);
389 if(
auto*MPT = dyn_cast<MemberPointerType>(QT.
getTypePtr())) {
396QT = Ctx.getMemberPointerType(QT,
Class.getTypePtr());
398QT = Ctx.getQualifiedType(QT, Quals);
406 boolIsLValueRefTy = isa<LValueReferenceType>(QT.
getTypePtr());
412QT = Ctx.getLValueReferenceType(QT);
414QT = Ctx.getRValueReferenceType(QT);
416QT = Ctx.getQualifiedType(QT, Quals);
424 while(isa<SubstTemplateTypeParmType>(QT.
getTypePtr())) {
428QT = cast<SubstTemplateTypeParmType>(QT.
getTypePtr())->desugar();
431QT = Ctx.getQualifiedType(QT, Quals);
441 if(
const auto*ETypeInput = dyn_cast<ElaboratedType>(QT.
getTypePtr())) {
442QT = ETypeInput->getNamedType();
444Keyword = ETypeInput->getKeyword();
450QT = Ctx.getQualifiedType(UT->getUnderlyingType(), PrefixQualifiers);
461 if(isa<const TemplateSpecializationType>(QT.
getTypePtr()) ||
472QT = Ctx.getElaboratedType(Keyword, Prefix, QT);
474QT = Ctx.getQualifiedType(QT, PrefixQualifiers);
481 boolWithGlobalNsPrefix) {
Defines the C++ template declaration subclasses.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Declaration of a class template.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
bool isTranslationUnit() const
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
Decl - This represents one declaration (or definition), e.g.
DeclContext * getDeclContext()
Represent a C++ namespace.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
static NestedNameSpecifier * Create(const ASTContext &Context, NestedNameSpecifier *Prefix, const IdentifierInfo *II)
Builds a specifier combining a prefix and an identifier.
static NestedNameSpecifier * GlobalSpecifier(const ASTContext &Context)
Returns the nested name specifier representing the global scope.
@ NamespaceAlias
A namespace alias, stored as a NamespaceAliasDecl*.
@ TypeSpec
A type, stored as a Type*.
@ TypeSpecWithTemplate
A type that was preceded by the 'template' keyword, stored as a Type*.
@ Super
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
@ Identifier
An identifier, stored as an IdentifierInfo*.
@ Global
The global specifier '::'. There is no stored value.
@ Namespace
A namespace, stored as a NamespaceDecl*.
A (possibly-)qualified type.
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)
Qualifiers getLocalQualifiers() const
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifie...
Represents a template name as written in source code.
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
The collection of all-type qualifiers we support.
Scope - A scope is a transient data structure that is used while parsing the program.
Represents the declaration of a struct/union/class/enum.
A template argument list.
unsigned size() const
Retrieve the number of template arguments in this template argument list.
Represents a template argument.
QualType getAsType() const
Retrieve the type for a type template argument.
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
@ Template
The template argument is a template name that was provided for a template template parameter.
@ Type
The template argument is a type.
ArgKind getKind() const
Return the kind of stored template argument.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Represents a C++ template name within the type system.
TemplateDecl * getAsTemplateDecl(bool IgnoreDeduced=false) const
Retrieve the underlying template declaration that this template name refers to, if known.
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
UsingShadowDecl * getAsUsingShadowDecl() const
Retrieve the using shadow declaration through which the underlying template declaration is introduced...
Represents a declaration of a type.
const Type * getTypeForDecl() const
The base class of the type hierarchy.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
const T * getAs() const
Member-template getAs<specific type>'.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
static NestedNameSpecifier * createOuterNNS(const ASTContext &Ctx, const Decl *D, bool FullyQualify, bool WithGlobalNsPrefix)
static bool getFullyQualifiedTemplateName(const ASTContext &Ctx, TemplateName &TName, bool WithGlobalNsPrefix)
static const Type * getFullyQualifiedTemplateType(const ASTContext &Ctx, const Type *TypePtr, bool WithGlobalNsPrefix)
static NestedNameSpecifier * getFullyQualifiedNestedNameSpecifier(const ASTContext &Ctx, NestedNameSpecifier *scope, bool WithGlobalNsPrefix)
Return a fully qualified version of this name specifier.
static bool getFullyQualifiedTemplateArgument(const ASTContext &Ctx, TemplateArgument &Arg, bool WithGlobalNsPrefix)
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.
std::string getFullyQualifiedName(QualType QT, const ASTContext &Ctx, const PrintingPolicy &Policy, bool WithGlobalNsPrefix=false)
Get the fully qualified name for a type.
static NestedNameSpecifier * createNestedNameSpecifier(const ASTContext &Ctx, const NamespaceDecl *Namesp, bool WithGlobalNsPrefix)
Create a NestedNameSpecifier for Namesp and its enclosing scopes.
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 transla...
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
The JSON file list parser is used to communicate input to InstallAPI.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
@ None
No keyword precedes the qualified type name.
@ Class
The "class" keyword introduces the elaborated-type-specifier.
Describes how types, statements, expressions, and declarations should be printed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4