diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 5913a83699c98d37a0e45ed908a0945338457058..7ca1509fa507d8691ebd3f72341f70b55e002a2e 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -1851,6 +1851,12 @@ public: setParams(getASTContext(), NewParamInfo); } + // ArrayRef iterface to parameters. + // FIXME: Should one day replace iterator interface. + ArrayRef<ParmVarDecl*> parameters() const { + return llvm::makeArrayRef(ParamInfo, getNumParams()); + } + const ArrayRef<NamedDecl *> &getDeclsInPrototypeScope() const { return DeclsInPrototypeScope; } diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index c8c233486a6635020e325426fcd732b7cf8f6cab..97d2a7a84f234444c8336d8bd7678c0cd5f7d159 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -314,8 +314,7 @@ public: if (hasStandardSelLocs()) return getStandardSelectorLoc(Index, getSelector(), getSelLocsKind() == SelLoc_StandardWithSpace, - llvm::makeArrayRef(const_cast<ParmVarDecl**>(getParams()), - NumParams), + parameters(), DeclEndLoc); return getStoredSelLocs()[Index]; } @@ -364,6 +363,13 @@ public: return param_begin() + getSelector().getNumArgs(); } + // ArrayRef access to formal parameters. This should eventually + // replace the iterator interface above. + ArrayRef<ParmVarDecl*> parameters() const { + return llvm::makeArrayRef(const_cast<ParmVarDecl**>(getParams()), + NumParams); + } + /// \brief Sets the method's parameters and selector source locations. /// If the method is implicit (not coming from source) \p SelLocs is /// ignored.