diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-03-04 09:22:22 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-03-04 09:22:22 +0000 |
commit | c5b1d320b856559db375e8effc2fe9b04bfaf6ee (patch) | |
tree | 46c64c995cf2180a8a7c9ff2d54e6c18ccc9b72f /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 678f65a9b4d808fe2f476c43d5acc884927c0377 (diff) | |
download | llvm-c5b1d320b856559db375e8effc2fe9b04bfaf6ee.zip llvm-c5b1d320b856559db375e8effc2fe9b04bfaf6ee.tar.gz llvm-c5b1d320b856559db375e8effc2fe9b04bfaf6ee.tar.bz2 |
[OPENMP 4.0] Codegen for 'declare reduction' construct.
Emit function for 'combiner' part of 'declare reduction' construct and
'initialilzer' part, if any.
llvm-svn: 262699
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e171abe..fad3199 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1543,10 +1543,17 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) { } } - // If this is OpenMP device, check if it is legal to emit this global - // normally. - if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD)) - return; + if (LangOpts.OpenMP) { + // If this is OpenMP device, check if it is legal to emit this global + // normally. + if (OpenMPRuntime && OpenMPRuntime->emitTargetGlobal(GD)) + return; + if (auto *DRD = dyn_cast<OMPDeclareReductionDecl>(Global)) { + if (MustBeEmitted(Global)) + EmitOMPDeclareReduction(DRD); + return; + } + } // Ignore declarations, they will be emitted on their first use. if (const auto *FD = dyn_cast<FunctionDecl>(Global)) { |