aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
diff options
context:
space:
mode:
authorYaxun (Sam) Liu <yaxun.liu@amd.com>2025-03-03 10:23:35 -0500
committerGitHub <noreply@github.com>2025-03-03 10:23:35 -0500
commitd37a39207bc15507e602e41b7655f615c10c9a1d (patch)
tree09a4042032ccad2a0e9d049ddb98de736536c902 /llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
parentcb940306d4a3078b53141221985ca8893a9a2cb6 (diff)
downloadllvm-d37a39207bc15507e602e41b7655f615c10c9a1d.zip
llvm-d37a39207bc15507e602e41b7655f615c10c9a1d.tar.gz
llvm-d37a39207bc15507e602e41b7655f615c10c9a1d.tar.bz2
[CUDA][HIP] fix virtual dtor host/device attr (#128926)
Currently if CUDA/HIP users use template class with virtual dtor and std::string data member with C++20 and MSVC. When the template class is explicitly instantiated, there is error about host function called by host device function (used to be undefined symbols in linking stage before member destructors were checked by deferred diagnostics). It was caused by clang inferring host/device attributes for default dtors. Since all dtors of member and parent classes have implicit host device attrs, clang infers the virtual dtor have implicit host and device attrs. Since virtual dtor of explicitly instantiated template class must be emitted, this causes constexpr dtor of std::string emitted, which calls a host function which was not emitted on device side. This is a serious issue since it prevents users from using std::string with C++20 on Windows. When inferring host device attr of virtual dtor of explicit template class instantiation, clang should be conservative since it is sure to be emitted. Since an implicit host device function may call a host function, clang cannot assume it is always available on device. This guarantees dtors that may call host functions not to have implicit device attr, therefore will not be emitted on device side. Fixes: https://github.com/llvm/llvm-project/issues/108548 Fixes: SWDEV-517435
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp')
0 files changed, 0 insertions, 0 deletions