summaryrefslogtreecommitdiffstats
path: root/include/clang/Sema/ScopeInfo.h
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-01-07 04:59:52 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-01-07 04:59:52 +0000
commit72899c34e3d1abfffa241ad0ce5c4bf175e5ea51 (patch)
tree2a9209442a417053e832e18b7a3416e787789642 /include/clang/Sema/ScopeInfo.h
parent9f03b62036a7abc0a227b17f4a49b9eefced9450 (diff)
More lambda work: semantic analysis of capturing 'this'. It's a bit complicated, but we have to be careful about when exactly captures are marked given PotentiallyPotentiallyEvaluated contexts. (Actually, it's not 100% correct yet, but it's close enough for the moment.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147723 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/ScopeInfo.h')
-rw-r--r--include/clang/Sema/ScopeInfo.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/clang/Sema/ScopeInfo.h b/include/clang/Sema/ScopeInfo.h
index 6a6f395c87..4d49a5a88a 100644
--- a/include/clang/Sema/ScopeInfo.h
+++ b/include/clang/Sema/ScopeInfo.h
@@ -189,15 +189,20 @@ public:
/// \brief A mapping from the set of captured variables to the
/// fields (within the lambda class) that represent the captured variables.
llvm::DenseMap<VarDecl *, FieldDecl *> CapturedVariables;
-
+
/// \brief The list of captured variables, starting with the explicit
/// captures and then finishing with any implicit captures.
llvm::SmallVector<Capture, 4> Captures;
-
+
+ // \brief Whether we have already captured 'this'.
+ bool CapturesCXXThis;
+
/// \brief The number of captures in the \c Captures list that are
/// explicit captures.
unsigned NumExplicitCaptures;
-
+
+ LambdaCaptureDefault Default;
+
/// \brief The field associated with the captured 'this' pointer.
FieldDecl *ThisCapture;
@@ -208,8 +213,9 @@ public:
QualType ReturnType;
LambdaScopeInfo(DiagnosticsEngine &Diag, CXXRecordDecl *Lambda)
- : FunctionScopeInfo(Diag), Lambda(Lambda),
- NumExplicitCaptures(0), ThisCapture(0) , HasImplicitReturnType(false)
+ : FunctionScopeInfo(Diag), Lambda(Lambda), CapturesCXXThis(false),
+ NumExplicitCaptures(0), Default(LCD_None), ThisCapture(0),
+ HasImplicitReturnType(false)
{
Kind = SK_Lambda;
}