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 | 75286a747031c9e7c55843f42c7cd1e47f2f2135 (patch) | |
| tree | fb9ea603fbca37d0566a442858333e2b8d27f6f3 /clang/lib/CodeGen/CGRTTI.cpp | |
| parent | 68d3424b8c9083e1ecf0b4898e45d016cc31094a (diff) | |
| download | bcm5719-llvm-75286a747031c9e7c55843f42c7cd1e47f2f2135.tar.gz bcm5719-llvm-75286a747031c9e7c55843f42c7cd1e47f2f2135.zip | |
When building a type info struct for EH, we always want it to have linkonce_odr linkage.
llvm-svn: 124096
Diffstat (limited to 'clang/lib/CodeGen/CGRTTI.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGRTTI.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGRTTI.cpp b/clang/lib/CodeGen/CGRTTI.cpp index dd7e059f19f..8af0ecd978b 100644 --- a/clang/lib/CodeGen/CGRTTI.cpp +++ b/clang/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()) |

