diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-05-09 13:55:44 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-05-09 13:55:44 +0000 |
commit | e6cf6c78f88ffb7eed69b0eaa60785eab9df2b88 (patch) | |
tree | bfe60eb40c0baae3646a31c2524fbe8bc1b27e9a /clang/lib/CodeGen/CodeGenModule.h | |
parent | 9db0e72570f73e4e8aaf870201f2c1bc738baee3 (diff) | |
download | bcm5719-llvm-e6cf6c78f88ffb7eed69b0eaa60785eab9df2b88.tar.gz bcm5719-llvm-e6cf6c78f88ffb7eed69b0eaa60785eab9df2b88.zip |
[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
llvm-svn: 360342
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 83ddac70b0a..2f5b736c36a 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1315,6 +1315,19 @@ public: llvm::Value * createOpenCLIntToSamplerConversion(const Expr *E, CodeGenFunction &CGF); + /// OpenCL v1.2 s5.6.4.6 allows the compiler to store kernel argument + /// information in the program executable. The argument information stored + /// includes the argument name, its type, the address and access qualifiers + /// used. This helper can be used to generate metadata for source code kernel + /// function as well as generated implicitly kernels. If a kernel is generated + /// implicitly null value has to be passed to the last two parameters, + /// otherwise all parameters must have valid non-null values. + /// \param FN is a pointer to IR function being generated. + /// \param FD is a pointer to function declaration if any. + /// \param CGF is a pointer to CodeGenFunction that generates this function. + void GenOpenCLArgMetadata(llvm::Function *Fn, const FunctionDecl *FD=nullptr, + CodeGenFunction *CGF=nullptr); + /// Get target specific null pointer. /// \param T is the LLVM type of the null pointer. /// \param QT is the clang QualType of the null pointer. |