From: Eric Christopher Date: Wed, 29 Feb 2012 03:25:27 +0000 (+0000) Subject: Add some iterators for grabbing lambda expression contexts. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=441b3bb6eb3b43f5ad740d5cc6ad5c27823b6681;p=clang Add some iterators for grabbing lambda expression contexts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151701 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index b2773027e0..2314548942 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -997,6 +997,14 @@ public: void getCaptureFields(llvm::DenseMap &Captures, FieldDecl *&ThisCapture) const; + typedef const LambdaExpr::Capture* capture_const_iterator; + capture_const_iterator captures_begin() const { + return isLambda() ? getLambdaData().Captures : NULL; + } + capture_const_iterator captures_end() const { + return isLambda() ? captures_begin() + getLambdaData().NumCaptures : NULL; + } + /// getConversions - Retrieve the overload set containing all of the /// conversion functions in this class. UnresolvedSetImpl *getConversionFunctions() {