diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-07-03 21:17:51 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-07-03 21:17:51 +0000 |
commit | 52de7439bc593908843b0edf58a8b8b5f48a7b7e (patch) | |
tree | f7baa388a996b503c442cb706b80738b74b81745 /include/clang/AST/DeclTemplate.h | |
parent | be2741280dff4165895ae9a8a3bbce3f542b6ade (diff) |
[AST] Use ArrayRef in more interfaces
ArrayRef is a little better than passing around a pointer/length pair.
No functional change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/DeclTemplate.h')
-rw-r--r-- | include/clang/AST/DeclTemplate.h | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index 94bae7ba69..fd422932fd 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -184,7 +184,7 @@ class TemplateArgumentList final // Constructs an instance with an internal Argument list, containing // a copy of the Args array. (Called by CreateCopy) - TemplateArgumentList(const TemplateArgument *Args, unsigned NumArgs); + TemplateArgumentList(ArrayRef<TemplateArgument> Args); public: /// \brief Type used to indicate that the template argument list itself is a @@ -194,16 +194,14 @@ public: /// \brief Create a new template argument list that copies the given set of /// template arguments. static TemplateArgumentList *CreateCopy(ASTContext &Context, - const TemplateArgument *Args, - unsigned NumArgs); + ArrayRef<TemplateArgument> Args); /// \brief Construct a new, temporary template argument list on the stack. /// /// The template argument list does not own the template arguments /// provided. - explicit TemplateArgumentList(OnStackType, const TemplateArgument *Args, - unsigned NumArgs) - : Arguments(Args), NumArguments(NumArgs) {} + explicit TemplateArgumentList(OnStackType, ArrayRef<TemplateArgument> Args) + : Arguments(Args.data()), NumArguments(Args.size()) {} /// \brief Produces a shallow copy of the given template argument list. /// @@ -1583,8 +1581,7 @@ protected: DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, ClassTemplateDecl *SpecializedTemplate, - const TemplateArgument *Args, - unsigned NumArgs, + ArrayRef<TemplateArgument> Args, ClassTemplateSpecializationDecl *PrevDecl); explicit ClassTemplateSpecializationDecl(ASTContext &C, Kind DK); @@ -1594,8 +1591,7 @@ public: Create(ASTContext &Context, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, ClassTemplateDecl *SpecializedTemplate, - const TemplateArgument *Args, - unsigned NumArgs, + ArrayRef<TemplateArgument> Args, ClassTemplateSpecializationDecl *PrevDecl); static ClassTemplateSpecializationDecl * CreateDeserialized(ASTContext &C, unsigned ID); @@ -1811,8 +1807,7 @@ class ClassTemplatePartialSpecializationDecl SourceLocation IdLoc, TemplateParameterList *Params, ClassTemplateDecl *SpecializedTemplate, - const TemplateArgument *Args, - unsigned NumArgs, + ArrayRef<TemplateArgument> Args, const ASTTemplateArgumentListInfo *ArgsAsWritten, ClassTemplatePartialSpecializationDecl *PrevDecl); @@ -1827,8 +1822,7 @@ public: SourceLocation StartLoc, SourceLocation IdLoc, TemplateParameterList *Params, ClassTemplateDecl *SpecializedTemplate, - const TemplateArgument *Args, - unsigned NumArgs, + ArrayRef<TemplateArgument> Args, const TemplateArgumentListInfo &ArgInfos, QualType CanonInjectedType, ClassTemplatePartialSpecializationDecl *PrevDecl); @@ -2442,8 +2436,8 @@ protected: SourceLocation StartLoc, SourceLocation IdLoc, VarTemplateDecl *SpecializedTemplate, QualType T, TypeSourceInfo *TInfo, - StorageClass S, const TemplateArgument *Args, - unsigned NumArgs); + StorageClass S, + ArrayRef<TemplateArgument> Args); explicit VarTemplateSpecializationDecl(Kind DK, ASTContext &Context); @@ -2451,8 +2445,8 @@ public: static VarTemplateSpecializationDecl * Create(ASTContext &Context, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, VarTemplateDecl *SpecializedTemplate, QualType T, - TypeSourceInfo *TInfo, StorageClass S, const TemplateArgument *Args, - unsigned NumArgs); + TypeSourceInfo *TInfo, StorageClass S, + ArrayRef<TemplateArgument> Args); static VarTemplateSpecializationDecl *CreateDeserialized(ASTContext &C, unsigned ID); @@ -2655,7 +2649,7 @@ class VarTemplatePartialSpecializationDecl ASTContext &Context, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, TemplateParameterList *Params, VarTemplateDecl *SpecializedTemplate, QualType T, TypeSourceInfo *TInfo, - StorageClass S, const TemplateArgument *Args, unsigned NumArgs, + StorageClass S, ArrayRef<TemplateArgument> Args, const ASTTemplateArgumentListInfo *ArgInfos); VarTemplatePartialSpecializationDecl(ASTContext &Context) @@ -2668,8 +2662,8 @@ public: Create(ASTContext &Context, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, TemplateParameterList *Params, VarTemplateDecl *SpecializedTemplate, QualType T, - TypeSourceInfo *TInfo, StorageClass S, const TemplateArgument *Args, - unsigned NumArgs, const TemplateArgumentListInfo &ArgInfos); + TypeSourceInfo *TInfo, StorageClass S, ArrayRef<TemplateArgument> Args, + const TemplateArgumentListInfo &ArgInfos); static VarTemplatePartialSpecializationDecl *CreateDeserialized(ASTContext &C, unsigned ID); |