]> granicus.if.org Git - clang/commitdiff
When building a type info struct for EH, we always want it to have linkonce_odr linkage.
authorAnders Carlsson <andersca@mac.com>
Mon, 24 Jan 2011 02:12:11 +0000 (02:12 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 24 Jan 2011 02:12:11 +0000 (02:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124096 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGRTTI.cpp

index dd7e059f19f46ea970cf1b496237e2ead13f040a..8af0ecd978bde5be5fc0c78cace39f1a0334e7f0 100644 (file)
@@ -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())