diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-02-11 05:35:55 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-02-11 05:35:55 +0000 |
commit | 4244be25bd7c438ac755813ff33e6e80ca6b6f34 (patch) | |
tree | 070f65691c352cc73445c89a3be0f36b69a0d938 /clang/lib/CodeGen | |
parent | fe26def35c61d4773b5378a1e797033538f96bf8 (diff) | |
download | bcm5719-llvm-4244be25bd7c438ac755813ff33e6e80ca6b6f34.tar.gz bcm5719-llvm-4244be25bd7c438ac755813ff33e6e80ca6b6f34.zip |
[OPENMP] Rename OMPCapturedFieldDecl to OMPCapturedExprDecl, NFC.
OMPCapturedExprDecl allows caopturing not only of fielddecls, but also
other expressions. It also allows to simplify codegen for several
clauses.
llvm-svn: 260492
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); |