diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-13 16:35:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-13 16:35:30 +0000 |
commit | 9daa7bfdff7256cef693d7bf10084881bcb9253c (patch) | |
tree | 8902ff401da72f1c89e61f0f6dcf47dfb0088b5c /lib/Sema/SemaExpr.cpp | |
parent | 3b66d7b73536ccf8612504f1edb56fa360a73947 (diff) |
Keep track of the set of array index variables we use when we
synthesize a by-copy captured array in a lambda. This information will
be needed by IR generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 9bd1074116..0d43afcd81 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -9642,6 +9642,7 @@ static ExprResult captureInLambda(Sema &S, LambdaScopeInfo *LSI, bool InitializingArray = false; QualType BaseType = FieldType; QualType SizeType = S.Context.getSizeType(); + LSI->ArrayIndexStarts.push_back(LSI->ArrayIndexVars.size()); while (const ConstantArrayType *Array = S.Context.getAsConstantArrayType(BaseType)) { InitializingArray = true; @@ -9660,7 +9661,8 @@ static ExprResult captureInLambda(Sema &S, LambdaScopeInfo *LSI, S.Context.getTrivialTypeSourceInfo(SizeType, Loc), SC_None, SC_None); IndexVariables.push_back(IterationVar); - + LSI->ArrayIndexVars.push_back(IterationVar); + // Create a reference to the iteration variable. ExprResult IterationVarRef = S.BuildDeclRefExpr(IterationVar, SizeType, VK_LValue, Loc); |