aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorAnastasia Stulova <anastasia.stulova@arm.com>2019-05-09 13:55:44 +0000
committerAnastasia Stulova <anastasia.stulova@arm.com>2019-05-09 13:55:44 +0000
commite6cf6c78f88ffb7eed69b0eaa60785eab9df2b88 (patch)
treebfe60eb40c0baae3646a31c2524fbe8bc1b27e9a /clang/lib/CodeGen/CodeGenModule.h
parent9db0e72570f73e4e8aaf870201f2c1bc738baee3 (diff)
downloadllvm-e6cf6c78f88ffb7eed69b0eaa60785eab9df2b88.zip
llvm-e6cf6c78f88ffb7eed69b0eaa60785eab9df2b88.tar.gz
llvm-e6cf6c78f88ffb7eed69b0eaa60785eab9df2b88.tar.bz2
[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.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 83ddac7..2f5b736 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.