Revert D133266 "[MinGW] Reject explicit non-default visibility applied to dllexport/dllimport declaration"
This reverts commit 91d8324366.
The combo dllexport protected makes sense and is used by PlayStation.
Will change the patch to allow dllexport protected.
This commit is contained in:
@@ -1099,6 +1099,8 @@ llvm::ConstantInt *CodeGenModule::getSize(CharUnits size) {
|
||||
|
||||
void CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV,
|
||||
const NamedDecl *D) const {
|
||||
if (GV->hasDLLExportStorageClass() || GV->hasDLLImportStorageClass())
|
||||
return;
|
||||
// Internal definitions always have default visibility.
|
||||
if (GV->hasLocalLinkage()) {
|
||||
GV->setVisibility(llvm::GlobalValue::DefaultVisibility);
|
||||
@@ -1109,14 +1111,6 @@ void CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV,
|
||||
// Set visibility for definitions, and for declarations if requested globally
|
||||
// or set explicitly.
|
||||
LinkageInfo LV = D->getLinkageAndVisibility();
|
||||
if (GV->hasDLLExportStorageClass() || GV->hasDLLImportStorageClass()) {
|
||||
// Reject explicit non-default visibility on dllexport/dllimport.
|
||||
if (LV.isVisibilityExplicit() && LV.getVisibility() != DefaultVisibility)
|
||||
getDiags().Report(D->getLocation(),
|
||||
diag::err_non_default_visibility_dllstorage)
|
||||
<< (GV->hasDLLExportStorageClass() ? "dllexport" : "dllimport");
|
||||
return;
|
||||
}
|
||||
if (LV.isVisibilityExplicit() || getLangOpts().SetVisibilityForExternDecls ||
|
||||
!GV->isDeclarationForLinker())
|
||||
GV->setVisibility(GetLLVMVisibility(LV.getVisibility()));
|
||||
|
||||
Reference in New Issue
Block a user