]> granicus.if.org Git - clang/commit
[OPENMP] Mark global tors/dtors as used.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 9 May 2018 14:15:18 +0000 (14:15 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 9 May 2018 14:15:18 +0000 (14:15 +0000)
commitee2737c903af692b95c335d0ff1587064d13ca59
tree667f77a22fe8de929b9f7bfce4469723a5aa2264
parent442dc06868eabebc595a167195064eaaa03e45a9
[OPENMP] Mark global tors/dtors as used.

If the global variables are marked as declare target and they need
ctors/dtors, these ctors/dtors are emitted and then invoked by the
offloading runtime library. They are not explicitly used in the emitted
code and thus can be optimized out. Patch marks these functions as used,
so the optimizer cannot remove these function during the optimization
phase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331879 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGOpenMPRuntime.cpp
test/OpenMP/declare_target_codegen.cpp