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 | b3732bb3b76a4e12212f5e672ab281bd96ff906d (patch) | |
tree | 11485047f9cec4b171682dd3be091f5b2f4c8327 /clang/lib/CodeGen/CGRTTI.cpp | |
parent | 0e93f017e5fecf01b207a60cc94964ffbe525348 (diff) | |
download | bcm5719-llvm-b3732bb3b76a4e12212f5e672ab281bd96ff906d.tar.gz bcm5719-llvm-b3732bb3b76a4e12212f5e672ab281bd96ff906d.zip |
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.
llvm-svn: 110979
Diffstat (limited to 'clang/lib/CodeGen/CGRTTI.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGRTTI.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGRTTI.cpp b/clang/lib/CodeGen/CGRTTI.cpp index 69171419b66..a3ab6bad8fa 100644 --- a/clang/lib/CodeGen/CGRTTI.cpp +++ b/clang/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); |