From 96225a52988bad555bcb1a6c55c2906be9e87284 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 24 Dec 2015 23:58:25 +0000 Subject: [PATCH] [Sema] ArrayRef-ize ActOnTemplateParameterList. NFC llvm-svn: 256400 --- clang/include/clang/Sema/Sema.h | 2 +- clang/lib/Parse/ParseDecl.cpp | 4 ++-- clang/lib/Parse/ParseDeclCXX.cpp | 4 ++-- clang/lib/Parse/ParseTemplate.cpp | 10 ++++------ clang/lib/Sema/SemaTemplate.cpp | 6 +++--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index a6317ba313ea..8b2235d5bd18 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -5583,7 +5583,7 @@ public: SourceLocation ExportLoc, SourceLocation TemplateLoc, SourceLocation LAngleLoc, - Decl **Params, unsigned NumParams, + ArrayRef Params, SourceLocation RAngleLoc); /// \brief The context in which we are checking a template parameter list. diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index c85ea4a11fe0..e69bb2745c43 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1974,8 +1974,8 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes( // Recover as if it were an explicit specialization. TemplateParameterLists FakedParamLists; FakedParamLists.push_back(Actions.ActOnTemplateParameterList( - 0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, nullptr, - 0, LAngleLoc)); + 0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, None, + LAngleLoc)); ThisDecl = Actions.ActOnTemplateDeclarator(getCurScope(), FakedParamLists, D); diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index d0baee15ecd0..a4de9751f9a0 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -1662,8 +1662,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // "template<>", so that we treat this construct as a class // template specialization. FakedParamLists.push_back(Actions.ActOnTemplateParameterList( - 0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, nullptr, - 0, LAngleLoc)); + 0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, None, + LAngleLoc)); TemplateParams = &FakedParamLists; } } diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp index 4fcd8b346c73..a4dcdb1e2a09 100644 --- a/clang/lib/Parse/ParseTemplate.cpp +++ b/clang/lib/Parse/ParseTemplate.cpp @@ -126,8 +126,7 @@ Parser::ParseTemplateDeclarationOrSpecialization(unsigned Context, Actions.ActOnTemplateParameterList(CurTemplateDepthTracker.getDepth(), ExportLoc, TemplateLoc, LAngleLoc, - TemplateParams.data(), - TemplateParams.size(), RAngleLoc)); + TemplateParams, RAngleLoc)); if (!TemplateParams.empty()) { isSpecialization = false; @@ -280,8 +279,8 @@ Parser::ParseSingleDeclarationAfterTemplate( // Recover as if it were an explicit specialization. TemplateParameterLists FakedParamLists; FakedParamLists.push_back(Actions.ActOnTemplateParameterList( - 0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, nullptr, - 0, LAngleLoc)); + 0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, None, + LAngleLoc)); return ParseFunctionDefinition( DeclaratorInfo, ParsedTemplateInfo(&FakedParamLists, @@ -631,8 +630,7 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) { TemplateParameterList *ParamList = Actions.ActOnTemplateParameterList(Depth, SourceLocation(), TemplateLoc, LAngleLoc, - TemplateParams.data(), - TemplateParams.size(), + TemplateParams, RAngleLoc); // Grab a default argument (if available). diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 9ef927f1c1c1..4f2d6c3497f0 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -814,14 +814,14 @@ Sema::ActOnTemplateParameterList(unsigned Depth, SourceLocation ExportLoc, SourceLocation TemplateLoc, SourceLocation LAngleLoc, - Decl **Params, unsigned NumParams, + ArrayRef Params, SourceLocation RAngleLoc) { if (ExportLoc.isValid()) Diag(ExportLoc, diag::warn_template_export_unsupported); return TemplateParameterList::Create(Context, TemplateLoc, LAngleLoc, - (NamedDecl**)Params, NumParams, - RAngleLoc); + (NamedDecl**)Params.data(), + Params.size(), RAngleLoc); } static void SetNestedNameSpecifier(TagDecl *T, const CXXScopeSpec &SS) {