File tree Expand file tree Collapse file tree 16 files changed +41
-40
lines changed Expand file tree Collapse file tree 16 files changed +41
-40
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ clang_target_link_libraries(clangTidyMain
33
33
# Support plugins.
34
34
if (CLANG_PLUGIN_SUPPORT )
35
35
set (support_plugins SUPPORT_PLUGINS )
36
- set (export_symbols EXPORT_SYMBOLS_FOR_PLUGINS )
37
36
endif ()
38
37
39
38
add_clang_tool (clang-tidy
@@ -42,7 +41,6 @@ add_clang_tool(clang-tidy
42
41
DEPENDS
43
42
clang-resource-headers
44
43
${support_plugins}
45
- ${export_symbols}
46
44
)
47
45
clang_target_link_libraries (clang-tidy
48
46
PRIVATE
@@ -59,6 +57,10 @@ target_link_libraries(clang-tidy
59
57
${ALL_CLANG_TIDY_CHECKS}
60
58
)
61
59
60
+ if (CLANG_PLUGIN_SUPPORT )
61
+ export_executable_symbols_for_plugins (clang-tidy )
62
+ endif ()
63
+
62
64
install (PROGRAMS clang-tidy-diff.py
63
65
DESTINATION "${CMAKE_INSTALL_DATADIR} /clang"
64
66
COMPONENT clang-tidy )
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ macro(add_clang_tool name)
160
160
AND (NOT LLVM_DISTRIBUTION_COMPONENTS OR ${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS )
161
161
)
162
162
set (get_obj_args ${ARGN} )
163
- list (FILTER get_obj_args EXCLUDE REGEX "^( SUPPORT_PLUGINS|EXPORT_SYMBOLS_FOR_PLUGINS) $" )
163
+ list (FILTER get_obj_args EXCLUDE REGEX "^SUPPORT_PLUGINS$" )
164
164
generate_llvm_objects (${name} ${get_obj_args} )
165
165
add_custom_target (${name} DEPENDS llvm-driver clang-resource-headers )
166
166
else ()
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ add_clang_tool(clang-linker-wrapper
31
31
32
32
DEPENDS
33
33
${tablegen_deps}
34
- EXPORT_SYMBOLS_FOR_PLUGINS
35
34
)
36
35
37
36
set (CLANG_LINKER_WRAPPER_LIB_DEPS
@@ -42,3 +41,5 @@ target_link_libraries(clang-linker-wrapper
42
41
PRIVATE
43
42
${CLANG_LINKER_WRAPPER_LIB_DEPS}
44
43
)
44
+
45
+ export_executable_symbols_for_plugins (clang-linker-wrapper )
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ set( LLVM_LINK_COMPONENTS
9
9
10
10
add_clang_tool (clang-repl
11
11
ClangRepl.cpp
12
-
13
- EXPORT_SYMBOLS_FOR_PLUGINS
14
12
)
15
13
16
14
if (MSVC )
@@ -63,6 +61,8 @@ clang_target_link_libraries(clang-repl PRIVATE
63
61
clangInterpreter
64
62
)
65
63
64
+ export_executable_symbols_for_plugins (clang-repl )
65
+
66
66
# The clang-repl binary can get huge with static linking in debug mode.
67
67
# Some 32-bit targets use PLT slots with limited branch range by default and we
68
68
# start to exceed this limit, e.g. when linking for arm-linux-gnueabihf with
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ set( LLVM_LINK_COMPONENTS
21
21
# Support plugins.
22
22
if (CLANG_PLUGIN_SUPPORT )
23
23
set (support_plugins SUPPORT_PLUGINS )
24
- set (export_symbols EXPORT_SYMBOLS_FOR_PLUGINS )
25
24
endif ()
26
25
27
26
add_clang_tool (clang
@@ -36,7 +35,6 @@ add_clang_tool(clang
36
35
ARMTargetParserTableGen
37
36
AArch64TargetParserTableGen
38
37
${support_plugins}
39
- ${export_symbols}
40
38
GENERATE_DRIVER
41
39
)
42
40
@@ -56,6 +54,11 @@ else()
56
54
set_target_properties (clang PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION} )
57
55
endif ()
58
56
57
+ # Support plugins.
58
+ if (CLANG_PLUGIN_SUPPORT )
59
+ export_executable_symbols_for_plugins (clang )
60
+ endif ()
61
+
59
62
add_dependencies (clang clang-resource-headers )
60
63
61
64
if (NOT CLANG_LINKS_TO_CREATE )
Original file line number Diff line number Diff line change @@ -11,18 +11,9 @@ set( LLVM_LINK_COMPONENTS
11
11
TargetParser
12
12
)
13
13
14
- option (FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON )
15
-
16
- # Enable support for plugins, which need access to symbols from flang-new
17
- if (FLANG_PLUGIN_SUPPORT )
18
- set (export_symbols EXPORT_SYMBOLS_FOR_PLUGINS )
19
- endif ()
20
-
21
14
add_flang_tool (flang-new
22
15
driver.cpp
23
16
fc1_main.cpp
24
-
25
- ${export_symbols}
26
17
)
27
18
28
19
target_link_libraries (flang-new
@@ -37,4 +28,11 @@ clang_target_link_libraries(flang-new
37
28
clangBasic
38
29
)
39
30
31
+ option (FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON )
32
+
33
+ # Enable support for plugins, which need access to symbols from flang-new
34
+ if (FLANG_PLUGIN_SUPPORT )
35
+ export_executable_symbols_for_plugins (flang-new )
36
+ endif ()
37
+
40
38
install (TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR} " )
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ macro(add_lld_tool name)
44
44
AND (NOT LLVM_DISTRIBUTION_COMPONENTS OR ${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS )
45
45
)
46
46
set (get_obj_args ${ARGN} )
47
- list (FILTER get_obj_args EXCLUDE REGEX "^( SUPPORT_PLUGINS|EXPORT_SYMBOLS_FOR_PLUGINS) $" )
47
+ list (FILTER get_obj_args EXCLUDE REGEX "^SUPPORT_PLUGINS$" )
48
48
generate_llvm_objects (${name} ${get_obj_args} )
49
49
add_custom_target (${name} DEPENDS llvm-driver )
50
50
else ()
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ add_lld_tool(lld
8
8
9
9
SUPPORT_PLUGINS
10
10
GENERATE_DRIVER
11
- EXPORT_SYMBOLS_FOR_PLUGINS
12
11
)
12
+ export_executable_symbols_for_plugins (lld )
13
13
14
14
function (lld_target_link_libraries target type )
15
15
if (TARGET obj.${target} )
Original file line number Diff line number Diff line change @@ -1010,7 +1010,7 @@ endmacro()
1010
1010
1011
1011
macro (add_llvm_executable name )
1012
1012
cmake_parse_arguments (ARG
1013
- "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH;SUPPORT_PLUGINS;EXPORT_SYMBOLS;EXPORT_SYMBOLS_FOR_PLUGINS "
1013
+ "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH;SUPPORT_PLUGINS;EXPORT_SYMBOLS"
1014
1014
"ENTITLEMENTS;BUNDLE_PATH"
1015
1015
""
1016
1016
${ARGN} )
@@ -1081,12 +1081,6 @@ macro(add_llvm_executable name)
1081
1081
endif ()
1082
1082
endif ()
1083
1083
1084
- if (ARG_EXPORT_SYMBOLS )
1085
- export_executable_symbols (${name} )
1086
- elseif (ARG_EXPORT_SYMBOLS_FOR_PLUGINS )
1087
- export_executable_symbols_for_plugins (${name} )
1088
- endif ()
1089
-
1090
1084
if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB )
1091
1085
set (USE_SHARED USE_SHARED )
1092
1086
endif ()
@@ -1118,6 +1112,10 @@ macro(add_llvm_executable name)
1118
1112
endif ()
1119
1113
1120
1114
llvm_codesign (${name} ENTITLEMENTS ${ARG_ENTITLEMENTS} BUNDLE_PATH ${ARG_BUNDLE_PATH} )
1115
+
1116
+ if (ARG_EXPORT_SYMBOLS )
1117
+ export_executable_symbols (${name} )
1118
+ endif ()
1121
1119
endmacro (add_llvm_executable name )
1122
1120
1123
1121
# add_llvm_pass_plugin(name [NO_MODULE] ...)
Original file line number Diff line number Diff line change @@ -37,5 +37,5 @@ add_llvm_tool(bugpoint
37
37
DEPENDS
38
38
intrinsics_gen
39
39
SUPPORT_PLUGINS
40
- EXPORT_SYMBOLS_FOR_PLUGINS
41
40
)
41
+ export_executable_symbols_for_plugins (bugpoint )
Original file line number Diff line number Diff line change @@ -30,5 +30,6 @@ add_llvm_tool(llc
30
30
DEPENDS
31
31
intrinsics_gen
32
32
SUPPORT_PLUGINS
33
- EXPORT_SYMBOLS_FOR_PLUGINS
34
33
)
34
+
35
+ export_executable_symbols_for_plugins (llc )
Original file line number Diff line number Diff line change @@ -21,6 +21,5 @@ add_llvm_tool(llvm-lto2
21
21
22
22
DEPENDS
23
23
intrinsics_gen
24
-
25
- EXPORT_SYMBOLS_FOR_PLUGINS
26
24
)
25
+ export_executable_symbols_for_plugins (llvm-lto2 )
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ add_llvm_tool(opt
45
45
DEPENDS
46
46
intrinsics_gen
47
47
SUPPORT_PLUGINS
48
- EXPORT_SYMBOLS_FOR_PLUGINS
49
48
50
49
)
51
50
target_link_libraries (opt PRIVATE LLVMOptDriver )
51
+
52
+ export_executable_symbols_for_plugins (opt )
Original file line number Diff line number Diff line change @@ -62,14 +62,8 @@ else()
62
62
LIST (APPEND LLVM_OPTIONAL_SOURCES ${MLGO_TESTS} )
63
63
endif ()
64
64
65
- # Export symbols from the plugins shared objects.
66
- if (NOT WIN32 )
67
- set (export_symbols EXPORT_SYMBOLS_FOR_PLUGINS )
68
- endif ()
69
-
70
65
add_llvm_unittest_with_input_files (AnalysisTests
71
66
${ANALYSIS_TEST_SOURCES}
72
- ${export_symbols}
73
67
)
74
68
75
69
add_dependencies (AnalysisTests intrinsics_gen )
@@ -82,5 +76,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
82
76
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-brtl" )
83
77
endif ()
84
78
79
+ # Export symbols from the plugins shared objects.
80
+ if (NOT WIN32 )
81
+ export_executable_symbols_for_plugins (AnalysisTests )
82
+ endif ()
83
+
85
84
add_subdirectory (InlineAdvisorPlugin )
86
85
add_subdirectory (InlineOrderPlugin )
Original file line number Diff line number Diff line change @@ -6,9 +6,8 @@ if (NOT WIN32 AND NOT CYGWIN)
6
6
set (LLVM_LINK_COMPONENTS Support Passes Core AsmParser )
7
7
add_llvm_unittest (PluginsTests
8
8
PluginsTest.cpp
9
-
10
- EXPORT_SYMBOLS_FOR_PLUGINS
11
9
)
10
+ export_executable_symbols_for_plugins (PluginsTests )
12
11
target_link_libraries (PluginsTests PRIVATE LLVMTestingSupport )
13
12
14
13
unset (LLVM_LINK_COMPONENTS )
Original file line number Diff line number Diff line change @@ -102,9 +102,9 @@ add_mlir_tool(mlir-opt
102
102
DEPENDS
103
103
${LIBS}
104
104
SUPPORT_PLUGINS
105
- EXPORT_SYMBOLS_FOR_PLUGINS
106
105
)
107
106
target_link_libraries (mlir-opt PRIVATE ${LIBS} )
108
107
llvm_update_compile_flags (mlir-opt )
109
108
110
109
mlir_check_all_link_libraries (mlir-opt )
110
+ export_executable_symbols_for_plugins (mlir-opt )
You can’t perform that action at this time.
0 commit comments