Skip to content

Commit ab3b898

Browse files
committed
Revert "enable plugins for clang-tidy"
This reverts commit 3689272 which breaks the build when LLVM_INSTALL_TOOLCHAIN_ONLY is enabled with: CMake Error at cmake/modules/AddLLVM.cmake:683 (add_dependencies): The dependency target "clang-tidy-headers" of target "CTTestTidyModule" does not exist.
1 parent 4810051 commit ab3b898

File tree

9 files changed

+2
-139
lines changed

9 files changed

+2
-139
lines changed

clang-tools-extra/clang-tidy/tool/CMakeLists.txt

+2-11
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,11 @@ clang_target_link_libraries(clangTidyMain
2929
clangToolingCore
3030
)
3131

32-
# Support plugins.
33-
if(CLANG_PLUGIN_SUPPORT)
34-
set(support_plugins SUPPORT_PLUGINS)
35-
endif()
36-
3732
add_clang_tool(clang-tidy
3833
ClangTidyToolMain.cpp
39-
40-
DEPENDS
34+
)
35+
add_dependencies(clang-tidy
4136
clang-resource-headers
42-
${support_plugins}
4337
)
4438
clang_target_link_libraries(clang-tidy
4539
PRIVATE
@@ -56,9 +50,6 @@ target_link_libraries(clang-tidy
5650
${ALL_CLANG_TIDY_CHECKS}
5751
)
5852

59-
if(CLANG_PLUGIN_SUPPORT)
60-
export_executable_symbols_for_plugins(clang-tidy)
61-
endif()
6253

6354
install(PROGRAMS clang-tidy-diff.py
6455
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"

clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "../GlobList.h"
2121
#include "clang/Tooling/CommonOptionsParser.h"
2222
#include "llvm/Support/InitLLVM.h"
23-
#include "llvm/Support/PluginLoader.h"
2423
#include "llvm/Support/Process.h"
2524
#include "llvm/Support/Signals.h"
2625
#include "llvm/Support/TargetSelect.h"
@@ -387,11 +386,6 @@ getVfsFromFile(const std::string &OverlayFile,
387386

388387
int clangTidyMain(int argc, const char **argv) {
389388
llvm::InitLLVM X(argc, argv);
390-
391-
// Enable help for -load option, if plugins are enabled.
392-
if (cl::Option *LoadOpt = cl::getRegisteredOptions().lookup("load"))
393-
LoadOpt->addCategory(ClangTidyCategory);
394-
395389
llvm::Expected<CommonOptionsParser> OptionsParser =
396390
CommonOptionsParser::create(argc, argv, ClangTidyCategory,
397391
cl::ZeroOrMore);

clang-tools-extra/docs/ReleaseNotes.rst

-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ Improvements to clang-tidy
7676
- Added support for `NOLINTBEGIN` ... `NOLINTEND` comments to suppress
7777
Clang-Tidy warnings over multiple lines.
7878

79-
- Added support for external plugin checks with `-load`.
80-
8179
New checks
8280
^^^^^^^^^^
8381

clang-tools-extra/docs/clang-tidy/Contributing.rst

-20
Original file line numberDiff line numberDiff line change
@@ -634,26 +634,6 @@ This keeps the test directory from getting cluttered.
634634
.. _FileCheck: https://llvm.org/docs/CommandGuide/FileCheck.html
635635
.. _test/clang-tidy/google-readability-casting.cpp: https://reviews.llvm.org/diffusion/L/browse/clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.cpp
636636

637-
Out-of-tree check plugins
638-
-------------------------
639-
640-
Developing an out-of-tree check as a plugin largely follows the steps
641-
outlined above. The plugin is a shared library whose code lives outside
642-
the clang-tidy build system. Build and link this shared library against
643-
LLVM as done for other kinds of Clang plugins.
644-
645-
The plugin can be loaded by passing `-load` to `clang-tidy` in addition to the
646-
names of the checks to enable.
647-
648-
.. code-block:: console
649-
650-
$ clang-tidy --checks=-*,my-explicit-constructor -list-checks -load myplugin.so
651-
652-
There is no expectations regarding ABI and API stability, so the plugin must be
653-
compiled against the version of clang-tidy that will be loading the plugin.
654-
655-
The plugins can use threads, TLS, or any other facilities available to in-tree
656-
code which is accessible from the external headers.
657637

658638
Running clang-tidy on LLVM
659639
--------------------------

clang-tools-extra/docs/clang-tidy/index.rst

-9
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,6 @@ An overview of all the command-line options:
218218
--list-checks -
219219
List all enabled checks and exit. Use with
220220
-checks=* to list all available checks.
221-
-load=<plugin> -
222-
Load the dynamic object ``plugin``. This
223-
object should register new static analyzer
224-
or clang-tidy passes. Once loaded, the
225-
object will add new command line options
226-
to run various analyses. To see the new
227-
complete list of passes, use the
228-
:option:`--list-checks` and
229-
:option:`-load` options together.
230221
-p=<string> - Build path
231222
--quiet -
232223
Run clang-tidy in quiet mode. This suppresses

clang-tools-extra/test/CMakeLists.txt

-17
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUN
1717

1818
llvm_canonicalize_cmake_booleans(
1919
CLANG_TIDY_ENABLE_STATIC_ANALYZER
20-
LLVM_ENABLE_PLUGINS
2120
)
2221

2322
configure_lit_site_cfg(
@@ -79,22 +78,6 @@ foreach(dep ${LLVM_UTILS_DEPS})
7978
endif()
8079
endforeach()
8180

82-
llvm_add_library(
83-
CTTestTidyModule
84-
MODULE clang-tidy/CTTestTidyModule.cpp
85-
PLUGIN_TOOL clang-tidy
86-
DEPENDS clang-tidy-headers)
87-
88-
if(TARGET CTTestTidyModule)
89-
list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello)
90-
target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}")
91-
if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
92-
set(LLVM_LINK_COMPONENTS
93-
Support
94-
)
95-
endif()
96-
endif()
97-
9881
add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
9982
${CMAKE_CURRENT_BINARY_DIR}
10083
DEPENDS ${CLANG_TOOLS_TEST_DEPS}

clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp

-66
This file was deleted.

clang-tools-extra/test/lit.cfg.py

-6
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,3 @@
149149
"clangd", "benchmarks")
150150
config.substitutions.append(('%clangd-benchmark-dir',
151151
'%s' % (clangd_benchmarks_dir)))
152-
config.substitutions.append(('%llvmshlibdir', config.clang_libs_dir))
153-
config.substitutions.append(('%pluginext', config.llvm_plugin_ext))
154-
155-
# Plugins (loadable modules)
156-
if config.has_plugins and config.llvm_plugin_ext:
157-
config.available_features.add('plugins')

clang-tools-extra/test/lit.site.cfg.py.in

-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import sys
44

55
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
66
config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
7-
config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"
87
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
98
config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
109
config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
1110
config.clang_libs_dir = "@SHLIBDIR@"
1211
config.python_executable = "@Python3_EXECUTABLE@"
1312
config.target_triple = "@TARGET_TRIPLE@"
1413
config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@
15-
config.has_plugins = @LLVM_ENABLE_PLUGINS@
1614

1715
# Support substitution of the tools and libs dirs with user parameters. This is
1816
# used when we can't determine the tool dir at configuration time.

0 commit comments

Comments
 (0)