14 #ifndef LLVM_CLANG_AST_TEMPLATENAME_H
15 #define LLVM_CLANG_AST_TEMPLATENAME_H
19 #include "llvm/ADT/FoldingSet.h"
20 #include "llvm/ADT/PointerUnion.h"
25 class DependentTemplateName;
26 class DiagnosticBuilder;
29 class NestedNameSpecifier;
31 class OverloadedTemplateStorage;
32 struct PrintingPolicy;
33 class QualifiedTemplateName;
34 class SubstTemplateTemplateParmPackStorage;
35 class SubstTemplateTemplateParmStorage;
36 class TemplateArgument;
38 class TemplateTemplateParmDecl;
100 return reinterpret_cast<NamedDecl **
>(
this + 1);
103 return reinterpret_cast<NamedDecl *
const *
>(
this + 1);
130 Parameter(Parameter), Arguments(Arguments) { }
143 static void Profile(llvm::FoldingSetNodeID &
ID,
285 bool SuppressNNS =
false)
const;
288 void dump(raw_ostream &OS)
const;
295 ID.AddPointer(Storage.getOpaqueValue());
309 const DiagnosticBuilder &
operator<<(
const DiagnosticBuilder &DB,
330 void Profile(llvm::FoldingSetNodeID &
ID);
332 static void Profile(llvm::FoldingSetNodeID &
ID,
363 llvm::PointerIntPair<NestedNameSpecifier *, 1> Qualifier;
373 : Qualifier(NNS, TemplateKeyword? 1 : 0),
374 Template(Template) { }
399 ID.AddBoolean(TemplateKeyword);
400 ID.AddPointer(Template);
419 llvm::PointerIntPair<NestedNameSpecifier *, 1, bool> Qualifier;
446 : Qualifier(Qualifier,
false), Identifier(Identifier),
447 CanonicalTemplateName(this) { }
452 : Qualifier(Qualifier,
false), Identifier(Identifier),
453 CanonicalTemplateName(Canon) { }
455 DependentTemplateName(NestedNameSpecifier *Qualifier,
457 : Qualifier(Qualifier,
true), Operator(Operator),
458 CanonicalTemplateName(this) { }
460 DependentTemplateName(NestedNameSpecifier *Qualifier,
463 : Qualifier(Qualifier,
true), Operator(Operator),
464 CanonicalTemplateName(Canon) { }
475 assert(
isIdentifier() &&
"Template name isn't an identifier?");
486 "Template name isn't an overloaded operator?");
500 ID.AddBoolean(
false);
501 ID.AddPointer(Identifier);
508 ID.AddInteger(Operator);
529 enum { NumLowBitsAvailable = 0 };
static llvm::GlobalValue::DLLStorageClassTypes getStorage(CodeGenModule &CGM, StringRef Name)
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool SuppressNNS=false) const
Print the template name.
TemplateName getReplacement() const
unsigned Size
The number of stored templates or template arguments, depending on which subclass we have...
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
OverloadedOperatorKind getOperator() const
Return the overloaded operator to which this template name refers.
static clang::TemplateName getFromVoidPointer(void *Ptr)
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
TemplateTemplateParmDecl * getParameterPack() const
Retrieve the template template parameter pack being substituted.
A template template parameter that has been substituted for some other template name.
void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context)
Describes how types, statements, expressions, and declarations should be printed. ...
TemplateTemplateParmDecl * getParameter() const
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
One of these records is kept for each identifier that is lexed.
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template.
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.
bool isIdentifier() const
Determine whether this template name refers to an identifier.
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm()
A qualified template name, where the qualification is kept to describe the source code as written...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
TemplateArgument getArgumentPack() const
Retrieve the template template argument pack with which this parameter was substituted.
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
TemplateDecl * getTemplateDecl() const
The template declaration to which this qualified name refers.
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack()
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
void Profile(llvm::FoldingSetNodeID &ID)
TemplateName getUnderlying() const
bool containsUnexpandedParameterPack() const
Determines whether this template name contains an unexpanded parameter pack (for C++0x variadic templ...
A dependent template name that has not been resolved to a template (or set of templates).
static void * getAsVoidPointer(clang::TemplateName TN)
OverloadedOperatorKind Operator
The overloaded operator name.
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, OverloadedOperatorKind Operator)
bool isInstantiationDependent() const
Determines whether this is a template name that somehow depends on a template parameter.
void Profile(llvm::FoldingSetNodeID &ID)
A structure for storing the information associated with a substituted template template parameter...
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
Represents a C++ template name within the type system.
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.
A template template parameter pack that has been substituted for a template template argument pack...
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)
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
UncommonTemplateNameStorage(Kind kind, unsigned size)
void Profile(llvm::FoldingSetNodeID &ID)
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const
Retrieve the substituted template template parameter, if known.
Represents a template argument.
Represents a template name that was expressed as a qualified 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.
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
bool isDependent() const
Determines whether this is a dependent template name.
bool isOverloadedOperator() const
Determine whether this template name refers to an overloaded operator.
SubstTemplateTemplateParmPackStorage(TemplateTemplateParmDecl *Parameter, unsigned Size, const TemplateArgument *Arguments)
const IdentifierInfo * Identifier
The identifier template name.
bool isNull() const
Determine whether this template name is NULL.
TemplateDecl * getDecl() const
The template declaration that this qualified name refers to.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
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.
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
A set of overloaded template declarations.
NamedDecl - This represents a decl with a name.
void dump() const
Debugging aid that dumps the template name to standard error.
Implementation class used to describe either a set of overloaded template names or an already-substit...
A single template declaration.
NamedDecl *const * iterator