diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 12 |
2 files changed, 4 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 3d84b262a8f..5b88ef1830f 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -92,7 +92,7 @@ void CodeGenFunction::EmitDecl(const Decl &D) { case Decl::Label: // __label__ x; case Decl::Import: case Decl::OMPThreadPrivate: - case Decl::OMPCapturedField: + case Decl::OMPCapturedExpr: case Decl::Empty: // None of these decls require codegen support. return; diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 46b7923e2c6..b378cc6dea5 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -1535,16 +1535,10 @@ emitScheduleClause(CodeGenFunction &CGF, const OMPLoopDirective &S, M2 = C->getSecondScheduleModifier(); if (const auto *Ch = C->getChunkSize()) { if (auto *ImpRef = cast_or_null<DeclRefExpr>(C->getHelperChunkSize())) { - if (OuterRegion) { - const VarDecl *ImpVar = cast<VarDecl>(ImpRef->getDecl()); - CGF.EmitVarDecl(*ImpVar); - CGF.EmitStoreThroughLValue( - CGF.EmitAnyExpr(Ch), - CGF.MakeAddrLValue(CGF.GetAddrOfLocalVar(ImpVar), - ImpVar->getType())); - } else { + if (OuterRegion) + CGF.EmitVarDecl(*cast<VarDecl>(ImpRef->getDecl())); + else Ch = ImpRef; - } } if (!C->getHelperChunkSize() || !OuterRegion) { Chunk = CGF.EmitScalarExpr(Ch); |