diff options
author | John McCall <rjmccall@apple.com> | 2010-08-12 23:36:15 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-12 23:36:15 +0000 |
commit | 279b5eb6910d64a293e9c0e2887a05c65d8737d7 (patch) | |
tree | 5537a0f31a4265fc8167a0c7dd6868338f1d2b0a /lib/CodeGen/CGRTTI.cpp | |
parent | f18d0d8b39e891460d50f8a8b85029885b264986 (diff) |
Just disable the hidden-visibility optimization for now by hiding it behind
a -cc1 option. The Darwin linker complains about mixed visibility when linking
gcc-built objects with clang-built objects, and the optimization isn't really
that valuable. Platforms with less ornery linkers can feel free to enable this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRTTI.cpp')
-rw-r--r-- | lib/CodeGen/CGRTTI.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index 69171419b6..a3ab6bad8f 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -11,9 +11,11 @@ // //===----------------------------------------------------------------------===// -#include "clang/AST/Type.h" -#include "clang/AST/RecordLayout.h" #include "CodeGenModule.h" +#include "clang/AST/RecordLayout.h" +#include "clang/AST/Type.h" +#include "clang/Frontend/CodeGenOptions.h" + using namespace clang; using namespace CodeGen; @@ -623,10 +625,13 @@ llvm::Constant *RTTIBuilder::BuildTypeInfo(QualType Ty, bool Force) { // GCC only relies on the uniqueness of the type names, not the // type_infos themselves, so we can emit these as hidden symbols. + // But don't do this if we're worried about strict visibility + // compatibility. if (const RecordType *RT = dyn_cast<RecordType>(Ty)) CGM.setTypeVisibility(GV, cast<CXXRecordDecl>(RT->getDecl()), /*ForRTTI*/ true); - else if (Linkage == llvm::GlobalValue::WeakODRLinkage) + else if (CGM.getCodeGenOpts().HiddenWeakVTables && + Linkage == llvm::GlobalValue::WeakODRLinkage) GV->setVisibility(llvm::GlobalValue::HiddenVisibility); return llvm::ConstantExpr::getBitCast(GV, Int8PtrTy); |