1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00

Don't export symbols from clang/opt/llc if plugins are disabled.

The only reason we export symbols from these tools is to support
plugins; if we don't have plugins, exporting symbols just bloats the
executable and makes LTO less effective.

See review of D75879 for the discussion that led to this patch.

Differential Revision: https://reviews.llvm.org/D76527
This commit is contained in:
Eli Friedman 2020-03-20 14:00:19 -07:00
parent 54a8d1843d
commit 45e4a653e4
6 changed files with 11 additions and 5 deletions

View File

@ -1029,6 +1029,13 @@ function(export_executable_symbols target)
endif()
endfunction()
# Export symbols if LLVM plugins are enabled.
function(export_executable_symbols_for_plugins target)
if(LLVM_ENABLE_PLUGINS)
export_executable_symbols(${target})
endif()
endfunction()
if(NOT LLVM_TOOLCHAIN_TOOLS)
set (LLVM_TOOLCHAIN_TOOLS
llvm-ar

View File

@ -38,4 +38,4 @@ add_llvm_tool(bugpoint
intrinsics_gen
SUPPORT_PLUGINS
)
export_executable_symbols(bugpoint)
export_executable_symbols_for_plugins(bugpoint)

View File

@ -27,4 +27,4 @@ add_llvm_tool(llc
SUPPORT_PLUGINS
)
export_executable_symbols(llc)
export_executable_symbols_for_plugins(llc)

View File

@ -10,4 +10,3 @@ add_llvm_tool(llvm-stress
DEPENDS
intrinsics_gen
)
export_executable_symbols(llvm-stress)

View File

@ -39,7 +39,7 @@ add_llvm_tool(opt
intrinsics_gen
SUPPORT_PLUGINS
)
export_executable_symbols(opt)
export_executable_symbols_for_plugins(opt)
if(LLVM_BUILD_EXAMPLES)
target_link_libraries(opt PRIVATE ExampleIRTransforms)

View File

@ -16,7 +16,7 @@ if (NOT WIN32)
add_llvm_unittest(PluginsTests
PluginsTest.cpp
)
export_executable_symbols(PluginsTests)
export_executable_symbols_for_plugins(PluginsTests)
target_link_libraries(PluginsTests PRIVATE LLVMTestingSupport)
set(LLVM_LINK_COMPONENTS)