diff options
author | Anders Carlsson <andersca@mac.com> | 2011-01-24 02:12:11 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-01-24 02:12:11 +0000 |
commit | e34e3aa7b8dfd0794e5f5293a4aef178eed10a16 (patch) | |
tree | 4b27386c15d8db33dccc20dcf61ce80f2abe718e | |
parent | 3a717f7fbb94ec31b826b48c15fdc965b5910df3 (diff) |
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
-rw-r--r-- | lib/CodeGen/CGRTTI.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<RecordType>(Ty)) { const CXXRecordDecl *RD = cast<CXXRecordDecl>(Record->getDecl()); if (RD->isDynamicClass()) |