diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2018-06-05 15:11:02 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2018-06-05 15:11:02 +0000 |
commit | 6328f9a988946978501cdb044294fcd5d675b2f7 (patch) | |
tree | 8ad662bedcea15ad31c93c467ae712e023caf66d /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 191bc71541a69cc872a8f313d00b96268b12b0ae (diff) | |
download | bcm5719-llvm-6328f9a988946978501cdb044294fcd5d675b2f7.tar.gz bcm5719-llvm-6328f9a988946978501cdb044294fcd5d675b2f7.zip |
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 3098e0f984c..b57004f7e12 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -4900,7 +4900,7 @@ llvm::Constant *CodeGenModule::GetAddrOfRTTIDescriptor(QualType Ty, // Return a bogus pointer if RTTI is disabled, unless it's for EH. // FIXME: should we even be calling this method if RTTI is disabled // and it's not for EH? - if (!ForEH && !getLangOpts().RTTI) + if ((!ForEH && !getLangOpts().RTTI) || getLangOpts().CUDAIsDevice) return llvm::Constant::getNullValue(Int8PtrTy); if (ForEH && Ty->isObjCObjectPointerType() && |