[cfe-commits] r69468 - /cfe/trunk/include/clang/AST/DeclObjC.h

Anders Carlsson andersca at mac.com
Sat Apr 18 13:18:05 PDT 2009


Author: andersca
Date: Sat Apr 18 15:18:04 2009
New Revision: 69468

URL: http://llvm.org/viewvc/llvm-project?rev=69468&view=rev
Log:
Add functions for iterating over the argument types of an ObjCMethodDecl.

Modified:
    cfe/trunk/include/clang/AST/DeclObjC.h

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=69468&r1=69467&r2=69468&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Sat Apr 18 15:18:04 2009
@@ -15,6 +15,7 @@
 #define LLVM_CLANG_AST_DECLOBJC_H
 
 #include "clang/AST/Decl.h"
+#include "llvm/ADT/STLExtras.h"
 
 namespace clang {
 class Expr;
@@ -200,6 +201,17 @@
     ParamInfo.set(List, Num, C);
   }
 
+  // Iterator access to parameter types.
+  typedef std::const_mem_fun_t<QualType, ParmVarDecl> deref_fun;
+  typedef llvm::mapped_iterator<param_iterator, deref_fun> arg_type_iterator;
+
+  arg_type_iterator arg_type_begin() const {
+    return llvm::map_iterator(param_begin(), deref_fun(&ParmVarDecl::getType));
+  }
+  arg_type_iterator arg_type_end() const {
+    return llvm::map_iterator(param_end(), deref_fun(&ParmVarDecl::getType));
+  }
+  
   /// createImplicitParams - Used to lazily create the self and cmd
   /// implict parameters. This must be called prior to using getSelfDecl()
   /// or getCmdDecl(). The call is ignored if the implicit paramters





More information about the cfe-commits mailing list