mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01: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:
parent
54a8d1843d
commit
45e4a653e4
@ -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
|
||||
|
@ -38,4 +38,4 @@ add_llvm_tool(bugpoint
|
||||
intrinsics_gen
|
||||
SUPPORT_PLUGINS
|
||||
)
|
||||
export_executable_symbols(bugpoint)
|
||||
export_executable_symbols_for_plugins(bugpoint)
|
||||
|
@ -27,4 +27,4 @@ add_llvm_tool(llc
|
||||
SUPPORT_PLUGINS
|
||||
)
|
||||
|
||||
export_executable_symbols(llc)
|
||||
export_executable_symbols_for_plugins(llc)
|
||||
|
@ -10,4 +10,3 @@ add_llvm_tool(llvm-stress
|
||||
DEPENDS
|
||||
intrinsics_gen
|
||||
)
|
||||
export_executable_symbols(llvm-stress)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user