diff options
author | Sergey Dmitriev <serguei.n.dmitriev@intel.com> | 2019-10-15 18:42:47 +0000 |
---|---|---|
committer | Sergey Dmitriev <serguei.n.dmitriev@intel.com> | 2019-10-15 18:42:47 +0000 |
commit | 5836c356fa6e17d0e10a2f9e0e111b7236dc15fb (patch) | |
tree | d11c2d7c5593e1921d789504949047f0c40bb475 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 215a8d948d6600dcbfd68dfc8d5331a86b1d5591 (diff) | |
download | bcm5719-llvm-5836c356fa6e17d0e10a2f9e0e111b7236dc15fb.tar.gz bcm5719-llvm-5836c356fa6e17d0e10a2f9e0e111b7236dc15fb.zip |
[Clang][OpenMP Offload] Move offload registration code to the wrapper
The final list of OpenMP offload targets becomes known only at the link time and since offload registration code depends on the targets list it makes sense to delay offload registration code generation to the link time instead of adding it to the host part of every fat object. This patch moves offload registration code generation from clang to the offload wrapper tool.
This is the last part of the OpenMP linker script elimination patch https://reviews.llvm.org/D64943
Differential Revision: https://reviews.llvm.org/D68746
llvm-svn: 374937
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c97e7b22170..8eb2176ca3a 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -414,12 +414,7 @@ void CodeGenModule::Release() { OpenMPRuntime->emitRequiresDirectiveRegFun()) { AddGlobalCtor(OpenMPRequiresDirectiveRegFun, 0); } - if (llvm::Function *OpenMPRegistrationFunction = - OpenMPRuntime->emitRegistrationFunction()) { - auto ComdatKey = OpenMPRegistrationFunction->hasComdat() ? - OpenMPRegistrationFunction : nullptr; - AddGlobalCtor(OpenMPRegistrationFunction, 0, ComdatKey); - } + OpenMPRuntime->createOffloadEntriesAndInfoMetadata(); OpenMPRuntime->clear(); } if (PGOReader) { |