[CUDA][HIP] Do not emit type info when compiling for device
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 5 Jun 2018 15:11:02 +0000 (15:11 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 5 Jun 2018 15:11:02 +0000 (15:11 +0000)
commit6328f9a988946978501cdb044294fcd5d675b2f7
tree8ad662bedcea15ad31c93c467ae712e023caf66d
parent191bc71541a69cc872a8f313d00b96268b12b0ae
[CUDA][HIP] Do not emit type info when compiling for device

CUDA/HIP does not support RTTI on device side, therefore there
is no point of emitting type info when compiling for device.

Emitting type info for device not only clutters the IR with useless
global variables, but also causes undefined symbol at linking
since vtable for cxxabiv1::class_type_info has external linkage.

Differential Revision: https://reviews.llvm.org/D47694

llvm-svn: 334021
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCUDA/device-vtable.cu