diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-04-17 08:57:16 +0200 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2019-04-04 06:32:19 +0000 |
commit | f16c0ba7e94c6b34d516bb79ac22482fb4d96765 (patch) | |
tree | 1e187cd3b24b41934023b37f28c46bf9beab2088 /tools/driver/driver.cpp | |
parent | 5bc2854d75179b6fe8069ced87b8b86b0243ebf8 (diff) |
[Driver] Statically link tools into clang executable
This enables running tidy/clazy from the "clang" executable (driver) and
thus avoids separate extra invocations for the tools resulting in a
speed up.
This is a cherry pick from commit 7f349701d3ea0c47be3a43e265699dddd3fd55cf
Change-Id: I70da78852e1343d3aef4228f4c1093d126311948
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'tools/driver/driver.cpp')
-rw-r--r-- | tools/driver/driver.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index 51143e3d8c..14ee14884c 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -512,3 +512,18 @@ int main(int argc_, const char **argv_) { // failing command. return Res; } + +// This anchor is used to force the linker to link the clang-tidy plugin. +extern volatile int ClangTidyPluginAnchorSource; +static int LLVM_ATTRIBUTE_UNUSED ClangTidyPluginAnchorDestination = + ClangTidyPluginAnchorSource; + +// This anchor is used to force the linker to link the clang-include-fixer +// plugin. +extern volatile int ClangIncludeFixerPluginAnchorSource; +static int LLVM_ATTRIBUTE_UNUSED ClangIncludeFixerPluginAnchorDestination = + ClangIncludeFixerPluginAnchorSource; + +// This anchor is used to force the linker to link the clazy plugin. +extern volatile int ClazyPluginAnchorSource; +static int LLVM_ATTRIBUTE_UNUSED ClazyPluginAnchorDestination = ClazyPluginAnchorSource; |