diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-11-07 08:07:25 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-11-07 08:07:25 +0000 |
commit | 420537fad8a227095255d65890b6c7b992325a75 (patch) | |
tree | 8e2af4538cd9f351722c7461c5dd4e046f520350 /clang/lib/CodeGen/CGExpr.cpp | |
parent | 8e06631b09f7bc735f8753df9e3ffb9818c855d8 (diff) | |
download | bcm5719-llvm-420537fad8a227095255d65890b6c7b992325a75.tar.gz bcm5719-llvm-420537fad8a227095255d65890b6c7b992325a75.zip |
[OPENMP] Fixed capturing of VLA variables.
After some changes in codegen capturing of VLA variables in OpenMP
regions was broken, causing compiler crash. Patch fixes this issue.
llvm-svn: 286098
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 74c552583c4..a5eee2e4120 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -2127,12 +2127,11 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { if (auto *FD = LambdaCaptureFields.lookup(VD)) return EmitCapturedFieldLValue(*this, FD, CXXABIThisValue); else if (CapturedStmtInfo) { - auto it = LocalDeclMap.find(VD); - if (it != LocalDeclMap.end()) { - if (auto RefTy = VD->getType()->getAs<ReferenceType>()) { - return EmitLoadOfReferenceLValue(it->second, RefTy); - } - return MakeAddrLValue(it->second, T); + auto I = LocalDeclMap.find(VD); + if (I != LocalDeclMap.end()) { + if (auto RefTy = VD->getType()->getAs<ReferenceType>()) + return EmitLoadOfReferenceLValue(I->second, RefTy); + return MakeAddrLValue(I->second, T); } LValue CapLVal = EmitCapturedFieldLValue(*this, CapturedStmtInfo->lookup(VD), |