14 #ifndef LLVM_CLANG_AST_TEMPLATENAME_H 15 #define LLVM_CLANG_AST_TEMPLATENAME_H 19 #include "llvm/ADT/FoldingSet.h" 20 #include "llvm/ADT/PointerIntPair.h" 21 #include "llvm/ADT/PointerUnion.h" 22 #include "llvm/Support/PointerLikeTypeTraits.h" 28 class DependentTemplateName;
29 class DiagnosticBuilder;
32 class NestedNameSpecifier;
34 class OverloadedTemplateStorage;
35 struct PrintingPolicy;
36 class QualifiedTemplateName;
37 class SubstTemplateTemplateParmPackStorage;
38 class SubstTemplateTemplateParmStorage;
39 class TemplateArgument;
41 class TemplateTemplateParmDecl;
103 return reinterpret_cast<NamedDecl **
>(
this + 1);
106 return reinterpret_cast<NamedDecl *
const *
>(
this + 1);
133 Parameter(Parameter), Arguments(Arguments) {}
144 void Profile(llvm::FoldingSetNodeID &
ID,
ASTContext &Context);
146 static void Profile(llvm::FoldingSetNodeID &ID,
236 TemplateDecl *getAsTemplateDecl()
const;
264 QualifiedTemplateName *getAsQualifiedTemplateName()
const;
268 DependentTemplateName *getAsDependentTemplateName()
const;
278 bool isDependent()
const;
282 bool isInstantiationDependent()
const;
286 bool containsUnexpandedParameterPack()
const;
297 bool SuppressNNS =
false)
const;
300 void dump(raw_ostream &OS)
const;
307 ID.AddPointer(Storage.getOpaqueValue());
336 Parameter(parameter), Replacement(replacement) {}
342 void Profile(llvm::FoldingSetNodeID &
ID);
344 static void Profile(llvm::FoldingSetNodeID &ID,
377 llvm::PointerIntPair<NestedNameSpecifier *, 1> Qualifier;
385 : Qualifier(NNS, TemplateKeyword? 1 : 0), Template(Template) {}
404 Profile(ID, getQualifier(), hasTemplateKeyword(), getTemplateDecl());
410 ID.AddBoolean(TemplateKeyword);
411 ID.AddPointer(Template);
432 llvm::PointerIntPair<NestedNameSpecifier *, 1, bool> Qualifier;
457 : Qualifier(Qualifier,
false), Identifier(Identifier),
458 CanonicalTemplateName(this) {}
463 : Qualifier(Qualifier,
false),
Identifier(Identifier),
464 CanonicalTemplateName(Canon) {}
468 : Qualifier(Qualifier,
true), Operator(Operator),
469 CanonicalTemplateName(
this) {}
474 : Qualifier(Qualifier,
true), Operator(Operator),
475 CanonicalTemplateName(Canon) {}
486 assert(isIdentifier() &&
"Template name isn't an identifier?");
496 assert(isOverloadedOperator() &&
497 "Template name isn't an overloaded operator?");
505 Profile(ID, getQualifier(), getOperator());
511 ID.AddBoolean(
false);
512 ID.AddPointer(Identifier);
519 ID.AddInteger(Operator);
539 enum { NumLowBitsAvailable = 0 };
544 #endif // LLVM_CLANG_AST_TEMPLATENAME_H TemplateTemplateParmDecl * getParameterPack() const
Retrieve the template template parameter pack being substituted.
static llvm::GlobalValue::DLLStorageClassTypes getStorage(CodeGenModule &CGM, StringRef Name)
void * getAsVoidPointer() const
Retrieve the template name as a void pointer.
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
OverloadedOperatorKind getOperator() const
Return the overloaded operator to which this template name refers.
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
unsigned Size
The number of stored templates or template arguments, depending on which subclass we have...
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
A template template parameter that has been substituted for some other template name.
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
Describes how types, statements, expressions, and declarations should be printed. ...
One of these records is kept for each identifier that is lexed.
TemplateName getUnderlying() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a dependent template name that cannot be resolved prior to template instantiation.
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm()
TemplateName getReplacement() const
A qualified template name, where the qualification is kept to describe the source code as written...
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack()
TemplateTemplateParmDecl * getParameter() const
NamedDecl *const * iterator
void Profile(llvm::FoldingSetNodeID &ID)
A little helper class used to produce diagnostics.
A dependent template name that has not been resolved to a template (or set of templates).
TemplateDecl * getTemplateDecl() const
The template declaration to which this qualified name refers.
OverloadedOperatorKind Operator
The overloaded operator name.
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, OverloadedOperatorKind Operator)
A structure for storing the information associated with a substituted template template parameter...
Represents a C++ template name within the type system.
bool isIdentifier() const
Determine whether this template name refers to an identifier.
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, const IdentifierInfo *Identifier)
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template)
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
static StringRef getIdentifier(const Token &Tok)
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
OverloadedTemplateStorage * getAsOverloadedStorage()
static TemplateName getFromVoidPointer(void *Ptr)
Build a template name from a void pointer.
A structure for storing an already-substituted template template parameter pack.
void Profile(llvm::FoldingSetNodeID &ID)
static void * getAsVoidPointer(clang::TemplateName TN)
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
bool isOverloadedOperator() const
Determine whether this template name refers to an overloaded operator.
UncommonTemplateNameStorage(Kind kind, unsigned size)
void Profile(llvm::FoldingSetNodeID &ID)
static clang::TemplateName getFromVoidPointer(void *Ptr)
Represents a template argument.
Represents a template name that was expressed as a qualified name.
Dataflow Directional Tag Classes.
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
SubstTemplateTemplateParmPackStorage(TemplateTemplateParmDecl *Parameter, unsigned Size, const TemplateArgument *Arguments)
const IdentifierInfo * Identifier
The identifier template name.
The parameter type of a method or function.
A structure for storing the information associated with an overloaded template name.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
static Decl::Kind getKind(const Decl *D)
TemplateDecl * getDecl() const
The template declaration that this qualified name refers to.
A set of overloaded template declarations.
This represents a decl that may have a name.
Implementation class used to describe either a set of overloaded template names or an already-substit...
A single template declaration.