Remove the -fhidden-weak-vtables -cc1 option. It was dead,
gross, and increasingly replaced through other mechanisms. llvm-svn: 201011
This commit is contained in:
@@ -423,73 +423,6 @@ void CodeGenModule::setTLSMode(llvm::GlobalVariable *GV,
|
||||
GV->setThreadLocalMode(TLM);
|
||||
}
|
||||
|
||||
/// Set the symbol visibility of type information (vtable and RTTI)
|
||||
/// associated with the given type.
|
||||
void CodeGenModule::setTypeVisibility(llvm::GlobalValue *GV,
|
||||
const CXXRecordDecl *RD,
|
||||
TypeVisibilityKind TVK) const {
|
||||
setGlobalVisibility(GV, RD);
|
||||
|
||||
if (!CodeGenOpts.HiddenWeakVTables)
|
||||
return;
|
||||
|
||||
// We never want to drop the visibility for RTTI names.
|
||||
if (TVK == TVK_ForRTTIName)
|
||||
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.
|
||||
|
||||
// This should be kept roughly in sync with setThunkVisibility
|
||||
// in CGVTables.cpp.
|
||||
|
||||
// Preconditions.
|
||||
if (GV->getLinkage() != llvm::GlobalVariable::LinkOnceODRLinkage ||
|
||||
GV->getVisibility() != llvm::GlobalVariable::DefaultVisibility)
|
||||
return;
|
||||
|
||||
// Don't override an explicit visibility attribute.
|
||||
if (RD->getExplicitVisibility(NamedDecl::VisibilityForType))
|
||||
return;
|
||||
|
||||
switch (RD->getTemplateSpecializationKind()) {
|
||||
// We have to disable the optimization if this is an EI definition
|
||||
// because there might be EI declarations in other shared objects.
|
||||
case TSK_ExplicitInstantiationDefinition:
|
||||
case TSK_ExplicitInstantiationDeclaration:
|
||||
return;
|
||||
|
||||
// Every use of a non-template class's type information has to emit it.
|
||||
case TSK_Undeclared:
|
||||
break;
|
||||
|
||||
// In theory, implicit instantiations can ignore the possibility of
|
||||
// an explicit instantiation declaration because there necessarily
|
||||
// must be an EI definition somewhere with default visibility. In
|
||||
// practice, it's possible to have an explicit instantiation for
|
||||
// an arbitrary template class, and linkers aren't necessarily able
|
||||
// to deal with mixed-visibility symbols.
|
||||
case TSK_ExplicitSpecialization:
|
||||
case TSK_ImplicitInstantiation:
|
||||
return;
|
||||
}
|
||||
|
||||
// If there's a key function, there may be translation units
|
||||
// that don't have the key function's definition. But ignore
|
||||
// this if we're emitting RTTI under -fno-rtti.
|
||||
if (!(TVK != TVK_ForRTTI) || LangOpts.RTTI) {
|
||||
// FIXME: what should we do if we "lose" the key function during
|
||||
// the emission of the file?
|
||||
if (Context.getCurrentKeyFunction(RD))
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, drop the visibility to hidden.
|
||||
GV->setVisibility(llvm::GlobalValue::HiddenVisibility);
|
||||
GV->setUnnamedAddr(true);
|
||||
}
|
||||
|
||||
StringRef CodeGenModule::getMangledName(GlobalDecl GD) {
|
||||
const NamedDecl *ND = cast<NamedDecl>(GD.getDecl());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user