From: Anders Carlsson Date: Mon, 24 Jan 2011 02:12:11 +0000 (+0000) Subject: When building a type info struct for EH, we always want it to have linkonce_odr linkage. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e34e3aa7b8dfd0794e5f5293a4aef178eed10a16;p=clang When building a type info struct for EH, we always want it to have linkonce_odr linkage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124096 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index dd7e059f19..8af0ecd978 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -350,6 +350,12 @@ getTypeInfoLinkage(CodeGenModule &CGM, QualType Ty) { return llvm::GlobalValue::InternalLinkage; case ExternalLinkage: + if (!CGM.getLangOptions().RTTI) { + // RTTI is not enabled, which means that this type info struct is going + // to be used for exception handling. Give it linkonce_odr linkage. + return llvm::GlobalValue::LinkOnceODRLinkage; + } + if (const RecordType *Record = dyn_cast(Ty)) { const CXXRecordDecl *RD = cast(Record->getDecl()); if (RD->isDynamicClass())