[clang-tools-extra] [llvm] [clang-tidy] Remove deprecated zircon module (PR #215063)
Zeyi Xu via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 8 23:46:41 PDT 2026
https://github.com/zeyi2 created https://github.com/llvm/llvm-project/pull/215063
None
>From c35c2dc8adb2ff4e3d3da2f69598cda03f6f4232 Mon Sep 17 00:00:00 2001
From: Zeyi Xu <mitchell.xu2 at gmail.com>
Date: Sun, 9 Aug 2026 14:46:25 +0800
Subject: [PATCH] [clang-tidy] Remove deprecated zircon module
---
clang-tools-extra/clang-tidy/CMakeLists.txt | 2 -
.../clang-tidy/ClangTidyForceLinker.h | 5 ---
.../fuchsia/TemporaryObjectsCheck.cpp | 10 +----
.../clang-tidy/zircon/CMakeLists.txt | 25 -------------
.../clang-tidy/zircon/ZirconTidyModule.cpp | 37 -------------------
clang-tools-extra/clangd/TidyFastChecks.inc | 2 -
clang-tools-extra/docs/ReleaseNotes.md | 7 ++++
.../docs/clang-tidy/checks/list.md | 2 -
.../checks/zircon/temporary-objects.md | 11 ------
clang-tools-extra/docs/clang-tidy/index.rst | 1 -
.../temporary-objects-deprecated-alias.cpp | 18 ---------
.../clang-tools-extra/clang-tidy/BUILD.gn | 1 -
.../clang-tidy/zircon/BUILD.gn | 14 -------
.../clang-tools-extra/clang-tidy/BUILD.bazel | 10 -----
14 files changed, 8 insertions(+), 137 deletions(-)
delete mode 100644 clang-tools-extra/clang-tidy/zircon/CMakeLists.txt
delete mode 100644 clang-tools-extra/clang-tidy/zircon/ZirconTidyModule.cpp
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/zircon/temporary-objects.md
delete mode 100644 clang-tools-extra/test/clang-tidy/checkers/fuchsia/temporary-objects-deprecated-alias.cpp
delete mode 100644 llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/zircon/BUILD.gn
diff --git a/clang-tools-extra/clang-tidy/CMakeLists.txt b/clang-tools-extra/clang-tidy/CMakeLists.txt
index 9ee9255fbe17b..270e7b37d5327 100644
--- a/clang-tools-extra/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/CMakeLists.txt
@@ -75,7 +75,6 @@ add_subdirectory(openmp)
add_subdirectory(performance)
add_subdirectory(portability)
add_subdirectory(readability)
-add_subdirectory(zircon)
set(ALL_CLANG_TIDY_CHECKS
clangTidyAndroidModule
clangTidyAbseilModule
@@ -98,7 +97,6 @@ set(ALL_CLANG_TIDY_CHECKS
clangTidyPerformanceModule
clangTidyPortabilityModule
clangTidyReadabilityModule
- clangTidyZirconModule
)
if(CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS)
diff --git a/clang-tools-extra/clang-tidy/ClangTidyForceLinker.h b/clang-tools-extra/clang-tidy/ClangTidyForceLinker.h
index 2450384016e25..87f99e8aab610 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyForceLinker.h
+++ b/clang-tools-extra/clang-tidy/ClangTidyForceLinker.h
@@ -132,11 +132,6 @@ extern volatile int ReadabilityModuleAnchorSource;
[[maybe_unused]] static int ReadabilityModuleAnchorDestination =
ReadabilityModuleAnchorSource;
-// This anchor is used to force the linker to link the ZirconModule.
-extern volatile int ZirconModuleAnchorSource;
-[[maybe_unused]] static int ZirconModuleAnchorDestination =
- ZirconModuleAnchorSource;
-
} // namespace clang::tidy
#endif
diff --git a/clang-tools-extra/clang-tidy/fuchsia/TemporaryObjectsCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/TemporaryObjectsCheck.cpp
index 2fa83b41869ea..a29eda7289aa2 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/TemporaryObjectsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/TemporaryObjectsCheck.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include "TemporaryObjectsCheck.h"
-#include "../utils/CheckUtils.h"
#include "../utils/OptionsUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
@@ -20,9 +19,6 @@ namespace clang::tidy::fuchsia {
namespace {
-constexpr llvm::StringLiteral DeprecatedCheckName = "zircon-temporary-objects";
-constexpr llvm::StringLiteral CanonicalCheckName = "fuchsia-temporary-objects";
-
AST_MATCHER_P(CXXRecordDecl, matchesAnyName, ArrayRef<StringRef>, Names) {
const std::string QualifiedName = Node.getQualifiedNameAsString();
return llvm::is_contained(Names, QualifiedName);
@@ -33,11 +29,7 @@ AST_MATCHER_P(CXXRecordDecl, matchesAnyName, ArrayRef<StringRef>, Names) {
TemporaryObjectsCheck::TemporaryObjectsCheck(StringRef Name,
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
- Names(utils::options::parseStringList(Options.get("Names", ""))) {
- if (Name == DeprecatedCheckName)
- utils::diagDeprecatedCheckAlias(*this, *Context, DeprecatedCheckName,
- CanonicalCheckName);
-}
+ Names(utils::options::parseStringList(Options.get("Names", ""))) {}
void TemporaryObjectsCheck::registerMatchers(MatchFinder *Finder) {
// Matcher for default constructors.
diff --git a/clang-tools-extra/clang-tidy/zircon/CMakeLists.txt b/clang-tools-extra/clang-tidy/zircon/CMakeLists.txt
deleted file mode 100644
index bc4ab1f58c83d..0000000000000
--- a/clang-tools-extra/clang-tidy/zircon/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-set(LLVM_LINK_COMPONENTS
- FrontendOpenMP
- Support
- )
-
-add_clang_library(clangTidyZirconModule STATIC
- ZirconTidyModule.cpp
-
- LINK_LIBS
- clangTidy
- clangTidyFuchsiaModule
- clangTidyUtils
-
- DEPENDS
- omp_gen
- ClangDriverOptions
- )
-
-clang_target_link_libraries(clangTidyZirconModule
- PRIVATE
- clangAST
- clangASTMatchers
- clangBasic
- clangLex
- )
diff --git a/clang-tools-extra/clang-tidy/zircon/ZirconTidyModule.cpp b/clang-tools-extra/clang-tidy/zircon/ZirconTidyModule.cpp
deleted file mode 100644
index 9cec7e5bd5551..0000000000000
--- a/clang-tools-extra/clang-tidy/zircon/ZirconTidyModule.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "../ClangTidy.h"
-#include "../ClangTidyModule.h"
-#include "../fuchsia/TemporaryObjectsCheck.h"
-
-namespace clang::tidy {
-namespace zircon {
-namespace {
-
-/// This module is for Zircon-specific checks.
-class ZirconModule : public ClangTidyModule {
-public:
- void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
- CheckFactories.registerCheck<fuchsia::TemporaryObjectsCheck>(
- "zircon-temporary-objects");
- }
-};
-
-} // namespace
-
-// Register the ZirconTidyModule using this statically initialized variable.
-static ClangTidyModuleRegistry::Add<ZirconModule>
- X("zircon-module", "Adds Zircon kernel checks (deprecated in LLVM 24).");
-} // namespace zircon
-
-// This anchor is used to force the linker to link in the generated object file
-// and thus register the ZirconModule.
-volatile int ZirconModuleAnchorSource = 0; // NOLINT(misc-use-internal-linkage)
-
-} // namespace clang::tidy
diff --git a/clang-tools-extra/clangd/TidyFastChecks.inc b/clang-tools-extra/clangd/TidyFastChecks.inc
index 95a3390143b91..ed182de867652 100644
--- a/clang-tools-extra/clangd/TidyFastChecks.inc
+++ b/clang-tools-extra/clangd/TidyFastChecks.inc
@@ -466,7 +466,5 @@ FAST(readability-uppercase-literal-suffix, 1.0)
FAST(readability-use-anyofallof, 1.0)
FAST(readability-use-concise-preprocessor-directives, 1.0)
FAST(readability-use-std-min-max, 1.0)
-FAST(zircon-temporary-objects, 1.0)
-
#undef FAST
#undef SLOW
diff --git a/clang-tools-extra/docs/ReleaseNotes.md b/clang-tools-extra/docs/ReleaseNotes.md
index 5ded07934d906..484d3aaccb200 100644
--- a/clang-tools-extra/docs/ReleaseNotes.md
+++ b/clang-tools-extra/docs/ReleaseNotes.md
@@ -56,6 +56,10 @@ infrastructure are described first, followed by tool-specific sections.
### Potentially Breaking Changes
+- The deprecated `zircon` clang-tidy module has been removed. Users of
+ `zircon-temporary-objects` should migrate to {doc}`fuchsia-temporary-objects
+ <clang-tidy/checks/fuchsia/temporary-objects>`.
+
### Improvements to clangd
#### Inlay hints
@@ -134,6 +138,9 @@ infrastructure are described first, followed by tool-specific sections.
#### Removed checks
+- Removed the deprecated `zircon-temporary-objects` check. Users should migrate to
+ {doc}`fuchsia-temporary-objects <clang-tidy/checks/fuchsia/temporary-objects>`.
+
#### Miscellaneous
### Improvements to include-fixer
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.md b/clang-tools-extra/docs/clang-tidy/checks/list.md
index 12d8a48ee8d86..77c9eafa7835c 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.md
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.md
@@ -30,7 +30,6 @@ openmp/*
performance/*
portability/*
readability/*
-zircon/*
```
| Name | Offers fixes |
@@ -441,7 +440,6 @@ zircon/*
| {doc}`readability-use-anyofallof <readability/use-anyofallof>` | |
| {doc}`readability-use-concise-preprocessor-directives <readability/use-concise-preprocessor-directives>` | Yes |
| {doc}`readability-use-std-min-max <readability/use-std-min-max>` | Yes |
-| {doc}`zircon-temporary-objects <zircon/temporary-objects>` | |
## Check aliases
diff --git a/clang-tools-extra/docs/clang-tidy/checks/zircon/temporary-objects.md b/clang-tools-extra/docs/clang-tidy/checks/zircon/temporary-objects.md
deleted file mode 100644
index edb96ed979206..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/zircon/temporary-objects.md
+++ /dev/null
@@ -1,11 +0,0 @@
-```{title} clang-tidy - zircon-temporary-objects
-```
-
-# zircon-temporary-objects
-
-:::{note}
-The `zircon-temporary-objects` check has been deprecated and will be removed
-in 24th release of LLVM. Please use
-{doc}`fuchsia-temporary-objects <../fuchsia/temporary-objects>` instead.
-:::
-
diff --git a/clang-tools-extra/docs/clang-tidy/index.rst b/clang-tools-extra/docs/clang-tidy/index.rst
index 908dee6c18a7f..cfa77eb670ecf 100644
--- a/clang-tools-extra/docs/clang-tidy/index.rst
+++ b/clang-tools-extra/docs/clang-tidy/index.rst
@@ -94,7 +94,6 @@ Name prefix Description
don't relate to any particular coding style.
``readability-`` Checks that target readability-related issues that
don't relate to any particular coding style.
-``zircon-`` Checks related to Zircon kernel coding conventions.
====================== ========================================================
Clang diagnostics are treated in a similar way as check diagnostics. Clang
diff --git a/clang-tools-extra/test/clang-tidy/checkers/fuchsia/temporary-objects-deprecated-alias.cpp b/clang-tools-extra/test/clang-tidy/checkers/fuchsia/temporary-objects-deprecated-alias.cpp
deleted file mode 100644
index 301cae523bf4e..0000000000000
--- a/clang-tools-extra/test/clang-tidy/checkers/fuchsia/temporary-objects-deprecated-alias.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %check_clang_tidy %s zircon-temporary-objects %t -- \
-// RUN: -config="{CheckOptions: {zircon-temporary-objects.Names: 'Foo'}}"
-// RUN: %check_clang_tidy -check-suffix=BOTH %s \
-// RUN: zircon-temporary-objects,fuchsia-temporary-objects %t -- \
-// RUN: -config="{CheckOptions: {zircon-temporary-objects.Names: 'Foo', \
-// RUN: fuchsia-temporary-objects.Names: 'Foo'}}"
-
-class Foo {
-public:
- Foo() = default;
-};
-
-void f() {
- Foo();
- // CHECK-MESSAGES: warning: 'zircon-temporary-objects' check is deprecated and will be removed in a future release; consider using 'fuchsia-temporary-objects' instead [clang-tidy-config]
- // CHECK-MESSAGES: :[[@LINE-2]]:3: warning: creating a temporary object of type 'Foo' is prohibited [zircon-temporary-objects]
- // CHECK-MESSAGES-BOTH: :[[@LINE-3]]:3: warning: creating a temporary object of type 'Foo' is prohibited
-}
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn
index 09073f19426d0..2cbbba9d83db7 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn
@@ -90,7 +90,6 @@ group("all-checks") {
"//clang-tools-extra/clang-tidy/performance",
"//clang-tools-extra/clang-tidy/portability",
"//clang-tools-extra/clang-tidy/readability",
- "//clang-tools-extra/clang-tidy/zircon",
]
if (clang_tidy_enable_static_analyzer) {
deps += [ "//clang-tools-extra/clang-tidy/mpi" ]
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/zircon/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/zircon/BUILD.gn
deleted file mode 100644
index 81954527cabc9..0000000000000
--- a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/zircon/BUILD.gn
+++ /dev/null
@@ -1,14 +0,0 @@
-static_library("zircon") {
- output_name = "clangTidyZirconModule"
- configs += [ "//llvm/utils/gn/build:clang_code" ]
- deps = [
- "//clang-tools-extra/clang-tidy",
- "//clang-tools-extra/clang-tidy/utils",
- "//clang/lib/AST",
- "//clang/lib/ASTMatchers",
- "//clang/lib/Basic",
- "//clang/lib/Lex",
- "//llvm/lib/Support",
- ]
- sources = [ "ZirconTidyModule.cpp" ]
-}
diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel
index a4e30d615a39a..f591a57d54231 100644
--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel
@@ -289,15 +289,6 @@ clang_tidy_library(
],
)
-clang_tidy_library(
- name = "zircon",
- deps = [
- ":fuchsia",
- ":lib",
- ":utils",
- ],
-)
-
clang_tidy_library(
name = "cppcoreguidelines",
deps = [
@@ -376,7 +367,6 @@ CHECKS = [
":performance",
":portability",
":readability",
- ":zircon",
] + select({
":static_analyzer_enabled": [":mpi"],
"//conditions:default": [],
More information about the llvm-commits
mailing list