]> granicus.if.org Git - clang/commitdiff
Add some iterators for grabbing lambda expression contexts.
authorEric Christopher <echristo@apple.com>
Wed, 29 Feb 2012 03:25:27 +0000 (03:25 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 29 Feb 2012 03:25:27 +0000 (03:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151701 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclCXX.h

index b2773027e00406bbd789c3700253ed9b6dcf71b9..2314548942220692a2a5798cc11fd4b7383a73ce 100644 (file)
@@ -997,6 +997,14 @@ public:
   void getCaptureFields(llvm::DenseMap<const VarDecl *, FieldDecl *> &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() {