mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 07:00:46 +03:00
-fvisibility=hidden: Only hide function *definitions*, don't touch declarations (#2923)
This commit is contained in:
parent
7966987178
commit
deaaab8cf3
7 changed files with 73 additions and 59 deletions
|
@ -574,13 +574,6 @@ 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
|
||||
|
@ -981,12 +974,6 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
|
|||
}
|
||||
}
|
||||
|
||||
// if this function is naked, we take over right away! no standard processing!
|
||||
if (fd->naked) {
|
||||
DtoDefineNakedFunction(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fd->fbody) {
|
||||
return;
|
||||
}
|
||||
|
@ -1002,6 +989,16 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (opts::defaultToHiddenVisibility && !fd->isExport()) {
|
||||
func->setVisibility(LLGlobalValue::HiddenVisibility);
|
||||
}
|
||||
|
||||
// if this function is naked, we take over right away! no standard processing!
|
||||
if (fd->naked) {
|
||||
DtoDefineNakedFunction(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
SCOPE_EXIT {
|
||||
if (irFunc->isDynamicCompiled()) {
|
||||
defineDynamicCompiledFunction(gIR, irFunc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue