mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 07:30:43 +03:00
Add option '-fvisibility=<hidden|default>' able to hide symbols not marked as 'export' on non-Windows targets. Resolves #2431 (#2894)
This commit is contained in:
parent
41e2ed034f
commit
7bcd6d34dd
8 changed files with 90 additions and 0 deletions
|
@ -574,6 +574,13 @@ void DtoDeclareFunction(FuncDeclaration *fdecl) {
|
|||
: LLGlobalValue::DLLExportStorageClass);
|
||||
}
|
||||
|
||||
// Hide non-exported symbols
|
||||
if (opts::defaultToHiddenVisibility &&
|
||||
!fdecl->isImportedSymbol() &&
|
||||
!fdecl->isExport()) {
|
||||
func->setVisibility(LLGlobalValue::HiddenVisibility);
|
||||
}
|
||||
|
||||
IF_LOG Logger::cout() << "func = " << *func << std::endl;
|
||||
|
||||
// add func to IRFunc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue