aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-10 07:45:31 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-10 07:45:31 +0000
commit4d8d22bfaed6e5d7da6b5556415b18c43b44e36c (patch)
treee426e3c83c502004ea93b36f96ae13503f7f3566 /lib/Sema/SemaLambda.cpp
parent864b1cf13b288c5099911e1265431ffdcac060a4 (diff)
Extend CXXRecordDecl with a function that determines the mapping from
the variables captured by a lambda to the fields that store the captured values. To be used in IRgen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150235 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r--lib/Sema/SemaLambda.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp
index 73ef229a6b..6e9bea781d 100644
--- a/lib/Sema/SemaLambda.cpp
+++ b/lib/Sema/SemaLambda.cpp
@@ -32,7 +32,7 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
/*IdLoc=*/Intro.Range.getBegin(),
/*Id=*/0);
Class->startDefinition();
- Class->setLambda(true);
+ Class->makeLambda();
CurContext->addDecl(Class);
// Build the call operator; we don't really have all the relevant information
@@ -408,6 +408,7 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc,
CaptureDefault, Captures,
ExplicitParams, CaptureInits,
Body->getLocEnd());
+ Class->setLambda(Lambda);
// C++11 [expr.prim.lambda]p2:
// A lambda-expression shall not appear in an unevaluated operand