[clang] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel (PR #115821)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 27 06:01:12 PST 2024


================
@@ -1780,6 +1786,15 @@ void CXXNameMangler::mangleDeviceStubName(const IdentifierInfo *II) {
       << II->getName();
 }
 
+void CXXNameMangler::mangleOCLDeviceStubName(const IdentifierInfo *II) {
+  // <source-name> ::= <positive length number> __clang_ocl_kern_imp_
+  // <identifier> <number> ::= [n] <non-negative decimal integer> <identifier>
+  // ::= <unqualified source code identifier>
+  StringRef OCLDeviceStubNamePrefix = "__clang_ocl_kern_imp_";
----------------
shiltian wrote:

I'd suggest using some symbols that a regular user-defined function can't be named to avoid conflict.

https://github.com/llvm/llvm-project/pull/115821


More information about the cfe-commits mailing list