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
This commit is contained in:
John McCall
2010-08-12 23:36:15 +00:00
parent 0e93f017e5
commit b3732bb3b7
15 changed files with 61 additions and 30 deletions

View File

@@ -225,6 +225,9 @@ void CodeGenModule::setTypeVisibility(llvm::GlobalValue *GV,
bool IsForRTTI) const {
setGlobalVisibility(GV, RD);
if (!CodeGenOpts.HiddenWeakVTables)
return;
// We want to drop the visibility to hidden for weak type symbols.
// This isn't possible if there might be unresolved references
// elsewhere that rely on this symbol being visible.
@@ -260,7 +263,7 @@ void CodeGenModule::setTypeVisibility(llvm::GlobalValue *GV,
// to deal with mixed-visibility symbols.
case TSK_ExplicitSpecialization:
case TSK_ImplicitInstantiation:
if (!CodeGenOpts.EmitWeakTemplatesHidden)
if (!CodeGenOpts.HiddenWeakTemplateVTables)
return;
break;
}