Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/AST/DeclTemplate.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
// template <std::size_t Index, typename ...T> | // template <std::size_t Index, typename ...T> | ||||
NamedDecl *Params[] = {Index, Ts}; | NamedDecl *Params[] = {Index, Ts}; | ||||
return TemplateParameterList::Create(C, SourceLocation(), SourceLocation(), | return TemplateParameterList::Create(C, SourceLocation(), SourceLocation(), | ||||
llvm::makeArrayRef(Params), | llvm::makeArrayRef(Params), | ||||
SourceLocation(), nullptr); | SourceLocation(), nullptr); | ||||
} | } | ||||
static TemplateParameterList *createDecayParameterList(const ASTContext &C, | |||||
DeclContext *DC) { | |||||
// typename | |||||
auto *T = TemplateTypeParmDecl::Create( | |||||
C, DC, SourceLocation(), SourceLocation(), /*Depth=*/0, /*Position=*/0, | |||||
/*Id=*/nullptr, /*Typename=*/true, /*ParameterPack=*/false, | |||||
/*HasTypeConstraint=*/false); | |||||
NamedDecl *Params[] = {T}; | |||||
return TemplateParameterList::Create(C, SourceLocation(), SourceLocation(), | |||||
llvm::makeArrayRef(Params), | |||||
SourceLocation(), nullptr); | |||||
} | |||||
static TemplateParameterList *createBuiltinTemplateParameterList( | static TemplateParameterList *createBuiltinTemplateParameterList( | ||||
const ASTContext &C, DeclContext *DC, BuiltinTemplateKind BTK) { | const ASTContext &C, DeclContext *DC, BuiltinTemplateKind BTK) { | ||||
switch (BTK) { | switch (BTK) { | ||||
case BTK__make_integer_seq: | case BTK__make_integer_seq: | ||||
return createMakeIntegerSeqParameterList(C, DC); | return createMakeIntegerSeqParameterList(C, DC); | ||||
case BTK__type_pack_element: | case BTK__type_pack_element: | ||||
return createTypePackElementParameterList(C, DC); | return createTypePackElementParameterList(C, DC); | ||||
case BTK__decay: | |||||
return createDecayParameterList(C, DC); | |||||
} | } | ||||
llvm_unreachable("unhandled BuiltinTemplateKind!"); | llvm_unreachable("unhandled BuiltinTemplateKind!"); | ||||
} | } | ||||
void BuiltinTemplateDecl::anchor() {} | void BuiltinTemplateDecl::anchor() {} | ||||
BuiltinTemplateDecl::BuiltinTemplateDecl(const ASTContext &C, DeclContext *DC, | BuiltinTemplateDecl::BuiltinTemplateDecl(const ASTContext &C, DeclContext *DC, | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |