diff options
author | Eric Christopher <echristo@apple.com> | 2012-02-29 03:25:27 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-02-29 03:25:27 +0000 |
commit | 441b3bb6eb3b43f5ad740d5cc6ad5c27823b6681 (patch) | |
tree | a486ffab38bb234f1451f18fac11068755b32e9c | |
parent | c07b18ed2b207b17cf8d770966e5c1e52d46f4ec (diff) |
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
-rw-r--r-- | include/clang/AST/DeclCXX.h | 8 |
1 files changed, 8 insertions, 0 deletions
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<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() { |