diff options
| author | Diana Picus <diana.picus@linaro.org> | 2016-11-07 10:01:43 +0000 |
|---|---|---|
| committer | Diana Picus <diana.picus@linaro.org> | 2016-11-07 10:01:43 +0000 |
| commit | 1e2b7e667216ec4efceceeb77b681197b17a233d (patch) | |
| tree | 7dd65a62bdb244dd3b89ff1e6a07d2425e0fdc36 /clang/lib/CodeGen | |
| parent | 1071ac193589338bc055e338926d661ab5bf93f6 (diff) | |
| download | bcm5719-llvm-1e2b7e667216ec4efceceeb77b681197b17a233d.tar.gz bcm5719-llvm-1e2b7e667216ec4efceceeb77b681197b17a233d.zip | |
Revert "[OPENMP] Fixed capturing of VLA variables."
This reverts commit r286098 because the modified test breaks on many of the
buildbots.
llvm-svn: 286102
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 11 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index a5eee2e4120..74c552583c4 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -2127,11 +2127,12 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { if (auto *FD = LambdaCaptureFields.lookup(VD)) return EmitCapturedFieldLValue(*this, FD, CXXABIThisValue); else if (CapturedStmtInfo) { - 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); + 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); } LValue CapLVal = EmitCapturedFieldLValue(*this, CapturedStmtInfo->lookup(VD), diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 4dd12ea3df0..b09d8c8807d 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -307,7 +307,7 @@ CodeGenFunction::GenerateOpenMPCapturedStmtFunction(const CapturedStmt &S) { if (ArgLVal.getType()->isLValueReferenceType()) { ArgAddr = EmitLoadOfReference( ArgAddr, ArgLVal.getType()->castAs<ReferenceType>()); - } else if (!VarTy->isVariablyModifiedType() || !VarTy->isPointerType()) { + } else { assert(ArgLVal.getType()->isPointerType()); ArgAddr = EmitLoadOfPointer( ArgAddr, ArgLVal.getType()->castAs<PointerType>()); |

