Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-tidy] Stop linking against clangSema #113373

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

Endilll
Copy link
Contributor

@Endilll Endilll commented Oct 22, 2024

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

This is bad layering-wise. The only fix needed now is to anchor `SemaConsumer` vtable, which is also done here.
@llvmbot
Copy link
Member

llvmbot commented Oct 22, 2024

@llvm/pr-subscribers-clang-tools-extra

@llvm/pr-subscribers-clang-tidy

Author: Vlad Serebrennikov (Endilll)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/113373.diff

2 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/CMakeLists.txt (-1)
  • (modified) clang-tools-extra/clang-tidy/ClangTidy.cpp (+1)
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

Copy link
Contributor

@cor3ntin cor3ntin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for this!

@Endilll Endilll merged commit d8ef7b6 into llvm:main Oct 23, 2024
11 checks passed
@Endilll Endilll deleted the break-clang-tidy-to-sema-dependence branch October 23, 2024 16:37
@frobtech frobtech mentioned this pull request Oct 25, 2024
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
This is bad layering-wise. The only fix needed now is to anchor
`SemaConsumer` vtable, which is also done in this patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants