[cfe-commits] r124633 - in /cfe/trunk: lib/CodeGen/CodeGenModule.cpp test/CodeGenCXX/visibility-hidden-extern-templates.cpp

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Mon Jan 31 20:38:40 PST 2011

>> // Set visibility for definitions. NamedDecl::LinkageInfo LV =
>> D->getLinkageAndVisibility(); -  if (LV.visibilityExplicit() ||
>> !GV->hasAvailableExternallyLinkage()) -
>> GV->setVisibility(GetLLVMVisibility(LV.visibility())); +
>> GV->setVisibility(GetLLVMVisibility(LV.visibility())); }
> Following GCC's lead, we should only restrict the visibility of
> external symbols (i.e. declarations and available_externally
> definitions) if they have an explicit visibility attribute.  The idea
> is to allow users to build with -fvisibility=hidden and
> -fvisibility-inlines-hidden without needing to carefully tag all
> external declarations with default visibility.  It leads to
> sub-optimal code, but it's absolutely required for compatibility.

That will create a case were one file will have a default visibility 
available_externally constant and another will have a hidden external 
one. This is OK, but we would have to update the linker to accept it.

Is that (changing the linker) OK?

> John.


More information about the cfe-commits mailing list