]> granicus.if.org Git - clang/commit
[OpenCL] Make global ctor init function a kernel
authorAnastasia Stulova <anastasia.stulova@arm.com>
Thu, 9 May 2019 13:55:44 +0000 (13:55 +0000)
committerAnastasia Stulova <anastasia.stulova@arm.com>
Thu, 9 May 2019 13:55:44 +0000 (13:55 +0000)
commitf0b138aae25b684d4117897609e61e451685ee3e
treefecb8ace290626b84e2ec61f65963da3e8a22fbd
parente889472f6daf2da06925f0124a983e3f0e10cb61
[OpenCL] Make global ctor init function a kernel

We need to be able to enqueue internal function that initializes
global constructors on the host side. Therefore it has to be
converted to a kernel.

This change factors out common logic for adding kernel metadata
and moves it from CodeGenFunction to CodeGenModule in order to
make it accessible for the extra use case.

Differential revision: https://reviews.llvm.org/D61488

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360342 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenOpenCLCXX/global_init.cl [new file with mode: 0644]