aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-13 15:44:47 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-13 15:44:47 +0000
commitda8962a6198bc4bf09a38209db99551b2b0a41a0 (patch)
treef9fb9bbc7de4c93b4deb623c4dd567dccadeaa24 /lib/Sema/SemaLambda.cpp
parente88a71f00e9dce979dfb409459d54c92e5075a42 (diff)
Move the storage of lambda captures and capture initializers from
LambdaExpr over to the CXXRecordDecl. This allows us to eliminate the back-link from the closure type to the LambdaExpr, which will simplify and lazify AST deserialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150393 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r--lib/Sema/SemaLambda.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp
index 2bd69edb07..44b388364a 100644
--- a/lib/Sema/SemaLambda.cpp
+++ b/lib/Sema/SemaLambda.cpp
@@ -28,12 +28,8 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
DC = DC->getParent();
// Start constructing the lambda class.
- CXXRecordDecl *Class = CXXRecordDecl::Create(Context, TTK_Class, DC,
- Intro.Range.getBegin(),
- /*IdLoc=*/Intro.Range.getBegin(),
- /*Id=*/0);
- Class->startDefinition();
- Class->makeLambda();
+ CXXRecordDecl *Class = CXXRecordDecl::CreateLambda(Context, DC,
+ Intro.Range.getBegin());
CurContext->addDecl(Class);
// Build the call operator; we don't really have all the relevant information
@@ -472,7 +468,6 @@ 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