From 59f779213626990295f21b93d3f18f432513da34 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 24 Jun 2016 04:05:48 +0000 Subject: Use more ArrayRefs No functional change is intended, just a small refactoring. llvm-svn: 273647 --- clang/lib/AST/Decl.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'clang/lib/AST/Decl.cpp') diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 09ba90a3ea0..d59c4b422b3 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -2793,7 +2793,7 @@ unsigned FunctionDecl::getMinRequiredArguments() const { return getNumParams(); unsigned NumRequiredArgs = 0; - for (auto *Param : params()) + for (auto *Param : parameters()) if (!Param->isParameterPack() && !Param->hasDefaultArg()) ++NumRequiredArgs; return NumRequiredArgs; @@ -4099,8 +4099,10 @@ void IndirectFieldDecl::anchor() { } IndirectFieldDecl::IndirectFieldDecl(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName N, - QualType T, NamedDecl **CH, unsigned CHS) - : ValueDecl(IndirectField, DC, L, N, T), Chaining(CH), ChainingSize(CHS) { + QualType T, + MutableArrayRef CH) + : ValueDecl(IndirectField, DC, L, N, T), Chaining(CH.data()), + ChainingSize(CH.size()) { // In C++, indirect field declarations conflict with tag declarations in the // same scope, so add them to IDNS_Tag so that tag redeclaration finds them. if (C.getLangOpts().CPlusPlus) @@ -4109,16 +4111,15 @@ IndirectFieldDecl::IndirectFieldDecl(ASTContext &C, DeclContext *DC, IndirectFieldDecl * IndirectFieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, - IdentifierInfo *Id, QualType T, NamedDecl **CH, - unsigned CHS) { - return new (C, DC) IndirectFieldDecl(C, DC, L, Id, T, CH, CHS); + IdentifierInfo *Id, QualType T, + llvm::MutableArrayRef CH) { + return new (C, DC) IndirectFieldDecl(C, DC, L, Id, T, CH); } IndirectFieldDecl *IndirectFieldDecl::CreateDeserialized(ASTContext &C, unsigned ID) { return new (C, ID) IndirectFieldDecl(C, nullptr, SourceLocation(), - DeclarationName(), QualType(), nullptr, - 0); + DeclarationName(), QualType(), None); } SourceRange EnumConstantDecl::getSourceRange() const { -- cgit v1.2.3