[CUDA][HIP] Externalize kernels in anonymous name space
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Fri, 8 Apr 2022 02:57:56 +0000 (22:57 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Mon, 11 Apr 2022 01:56:28 +0000 (21:56 -0400)
commit4ea1d435099f992cc16127619b0feb64e070630d
tree92cb58efa87516e44eeae38ddc106a7def55f1eb
parenta91c77ee2858263efa789c05e7b82d3c0af9d314
[CUDA][HIP] Externalize kernels in anonymous name space

kernels in anonymous name space needs to have unique name
to avoid duplicate symbols.

Fixes: https://github.com/llvm/llvm-project/issues/54560

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D123353
clang/include/clang/AST/ASTContext.h
clang/lib/AST/ASTContext.cpp
clang/lib/CodeGen/CGCUDANV.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/test/CodeGenCUDA/kernel-in-anon-ns.cu [new file with mode: 0644]