[clang-tools-extra] [clang-tidy] Stop linking against clangSema (PR #113373)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 22 12:47:57 PDT 2024


https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/113373

This is bad layering-wise. The only fix needed now is to anchor `SemaConsumer` vtable, which is also done in this patch.

>From 5a227a152392cc0725a1b104c8d7832621a9ec46 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: Tue, 22 Oct 2024 22:46:35 +0300
Subject: [PATCH] [clang-tidy] Stop linking against clangSema

This is bad layering-wise. The only fix needed now is to anchor `SemaConsumer` vtable, which is also done here.
---
 clang-tools-extra/clang-tidy/CMakeLists.txt | 1 -
 clang-tools-extra/clang-tidy/ClangTidy.cpp  | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang-tools-extra/clang-tidy/CMakeLists.txt b/clang-tools-extra/clang-tidy/CMakeLists.txt
index 83a3236131dc93..93117cf1d6373a 100644
--- a/clang-tools-extra/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/CMakeLists.txt
@@ -35,7 +35,6 @@ clang_target_link_libraries(clangTidy
   clangFrontend
   clangLex
   clangRewrite
-  clangSema
   clangSerialization
   clangTooling
   clangToolingCore
diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp
index c4cac7d27b77c2..9c8c93c5d16c72 100644
--- a/clang-tools-extra/clang-tidy/ClangTidy.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp
@@ -336,6 +336,7 @@ class ClangTidyASTConsumer : public MultiplexConsumer {
   std::unique_ptr<ClangTidyProfiling> Profiling;
   std::unique_ptr<ast_matchers::MatchFinder> Finder;
   std::vector<std::unique_ptr<ClangTidyCheck>> Checks;
+  void anchor() override {};
 };
 
 } // namespace



More information about the cfe-commits mailing list