[C++11] Support for capturing of variable length arrays in lambda expression.
Differential Revision: http://reviews.llvm.org/D4368 llvm-svn: 216649
This commit is contained in:
@@ -691,6 +691,14 @@ void CodeGenFunction::StartFunction(GlobalDecl GD,
|
||||
CXXThisValue = EmitLoadOfLValue(ThisLValue,
|
||||
SourceLocation()).getScalarVal();
|
||||
}
|
||||
for (auto *FD : MD->getParent()->fields()) {
|
||||
if (FD->hasCapturedVLAType()) {
|
||||
auto *ExprArg = EmitLoadOfLValue(EmitLValueForLambdaField(FD),
|
||||
SourceLocation()).getScalarVal();
|
||||
auto VAT = FD->getCapturedVLAType();
|
||||
VLASizeMap[VAT->getSizeExpr()] = ExprArg;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Not in a lambda; just use 'this' from the method.
|
||||
// FIXME: Should we generate a new load for each use of 'this'? The
|
||||
|
||||
Reference in New Issue
Block a user