[cfe-commits] r151701 - /cfe/trunk/include/clang/AST/DeclCXX.h

Eric Christopher echristo at apple.com
Tue Feb 28 19:25:27 PST 2012


Author: echristo
Date: Tue Feb 28 21:25:27 2012
New Revision: 151701

URL: http://llvm.org/viewvc/llvm-project?rev=151701&view=rev
Log:
Add some iterators for grabbing lambda expression contexts.

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

Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=151701&r1=151700&r2=151701&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Tue Feb 28 21:25:27 2012
@@ -997,6 +997,14 @@
   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() {





More information about the cfe-commits mailing list