]> granicus.if.org Git - clang/commitdiff
Add ArrayRef<> interface to get the formal parameters of a BlockDecl.
authorTed Kremenek <kremenek@apple.com>
Fri, 17 Jan 2014 07:15:26 +0000 (07:15 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 17 Jan 2014 07:15:26 +0000 (07:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199471 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h

index 7ca1509fa507d8691ebd3f72341f70b55e002a2e..fc6344c8a1e08707bcd53267a3388837d2fcfdf9 100644 (file)
@@ -3264,6 +3264,12 @@ public:
   typedef ParmVarDecl **param_iterator;
   typedef ParmVarDecl * const *param_const_iterator;
 
+  // ArrayRef access to formal parameters.
+  // FIXME: Should eventual replace iterator access.
+  ArrayRef<ParmVarDecl*> parameters() const {
+    return llvm::makeArrayRef(ParamInfo, param_size());
+  }
+
   bool param_empty() const { return NumParams == 0; }
   param_iterator param_begin()  { return ParamInfo; }
   param_iterator param_end()   { return ParamInfo+param_size(); }