14 #ifndef LLVM_CLANG_SEMA_PARSEDTEMPLATE_H 15 #define LLVM_CLANG_SEMA_PARSEDTEMPLATE_H 22 #include "llvm/ADT/SmallVector.h" 51 : Kind(Kind), Arg(Arg), Loc(Loc) { }
66 Arg(Template.getAsOpaquePtr()),
67 SS(SS), Loc(TemplateLoc), EllipsisLoc() { }
77 assert(
Kind ==
Type &&
"Not a template type argument");
83 assert(
Kind ==
NonType &&
"Not a non-type template argument");
84 return static_cast<Expr*
>(Arg);
89 assert(
Kind ==
Template &&
"Not a template template argument");
100 "Only template template arguments can have a scope specifier");
108 "Only template template arguments can have an ellipsis");
149 ParsedTemplateArgument> {
188 return getTrailingObjects<ParsedTemplateArgument>();
202 totalSizeToAlloc<ParsedTemplateArgument>(TemplateArgs.size())))
204 OperatorKind, OpaqueTemplateName, TemplateKind,
205 LAngleLoc, RAngleLoc, TemplateArgs);
206 CleanupList.push_back(TemplateId);
212 getTemplateArgs(), getTemplateArgs() + NumArgs,
227 : SS(SS), TemplateKWLoc(TemplateKWLoc),
228 TemplateNameLoc(TemplateNameLoc), Name(Name), Operator(OperatorKind),
229 Template(OpaqueTemplateName), Kind(TemplateKind),
230 LAngleLoc(LAngleLoc), RAngleLoc(RAngleLoc),
231 NumArgs(TemplateArgs.size()) {
233 std::uninitialized_copy(TemplateArgs.begin(), TemplateArgs.end(),
244 #endif // LLVM_CLANG_SEMA_PARSEDTEMPLATE_H SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that makes a template template argument into a pack expansion...
IdentifierInfo * Name
FIXME: Temporarily stores the name of a specialization.
SourceLocation TemplateNameLoc
TemplateNameLoc - The location of the template name within the source.
Expr * getAsExpr() const
Retrieve the non-type template argument's expression.
The base class of the type hierarchy.
TemplateNameKind Kind
The kind of template that Template refers to.
static TemplateIdAnnotation * Create(CXXScopeSpec SS, SourceLocation TemplateKWLoc, SourceLocation TemplateNameLoc, IdentifierInfo *Name, OverloadedOperatorKind OperatorKind, ParsedTemplateTy OpaqueTemplateName, TemplateNameKind TemplateKind, SourceLocation LAngleLoc, SourceLocation RAngleLoc, ArrayRef< ParsedTemplateArgument > TemplateArgs, SmallVectorImpl< TemplateIdAnnotation *> &CleanupList)
Creates a new TemplateIdAnnotation with NumArgs arguments and appends it to List. ...
Stores a list of template parameters for a TemplateDecl and its derived classes.
Information about a template-id annotation token.
One of these records is kept for each identifier that is lexed.
SourceLocation getLocation() const
Retrieve the location of the template argument.
A non-type template parameter, stored as an expression.
ParsedType getAsType() const
Retrieve the template type argument's type.
ParsedTemplateArgument * getTemplateArgs()
Retrieves a pointer to the template arguments.
Represents a C++ nested-name-specifier or a global scope specifier.
SourceLocation TemplateKWLoc
TemplateKWLoc - The location of the template keyword.
SourceLocation LAngleLoc
The location of the '<' before the template argument list.
Defines the clang::TemplateNameKind enum.
ParsedTemplateArgument(const CXXScopeSpec &SS, ParsedTemplateTy Template, SourceLocation TemplateLoc)
Create a template template argument.
KindType
Describes the kind of template argument that was parsed.
ParsedTemplateArgument(KindType Kind, void *Arg, SourceLocation Loc)
Create a template type argument or non-type template argument.
This represents one expression.
This file defines the classes used to store parsed information about declaration-specifiers and decla...
Defines an enumeration for C++ overloaded operators.
TemplateNameKind
Specifies the kind of template name that an identifier refers to.
ParsedTemplateArgument()
Build an empty template argument.
const CXXScopeSpec & getScopeSpec() const
Retrieve the nested-name-specifier that precedes the template name in a template template argument...
Represents the parsed form of a C++ template argument.
Encodes a location in the source.
KindType getKind() const
Determine what kind of template argument we have.
A template type parameter, stored as a type.
Dataflow Directional Tag Classes.
ParsedTemplateTy getAsTemplate() const
Retrieve the template template argument's template name.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
CXXScopeSpec SS
The nested-name-specifier that precedes the template name.
SourceLocation RAngleLoc
The location of the '>' after the template argument list.
bool isInvalid() const
Determine whether the given template argument is invalid.
ParsedTemplateArgument getTemplatePackExpansion(SourceLocation EllipsisLoc) const
Retrieve a pack expansion of the given template template argument.
OverloadedOperatorKind Operator
FIXME: Temporarily stores the overloaded operator kind.
SourceRange getTemplateParamsRange(TemplateParameterList const *const *Params, unsigned NumParams)
Retrieves the range of the given template parameter lists.
Defines the clang::SourceLocation class and associated facilities.
A trivial tuple used to represent a source range.
A template template argument, stored as a template name.
unsigned NumArgs
NumArgs - The number of template arguments.
static OpaquePtr getFromOpaquePtr(void *P)
ParsedTemplateTy Template
The declaration of the template corresponding to the template-name.