[clang-tools-extra] [clang-tidy] Rename hicpp-no-assembler to portability-no-assembler, keep hicpp as alias (PR #184030)
Arjun Parmar via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 2 11:02:46 PST 2026
https://github.com/akparmar004 updated https://github.com/llvm/llvm-project/pull/184030
>From 99b1188eae4df3070aca64e3c36c68b4a06acb5f Mon Sep 17 00:00:00 2001
From: akparmar004 <akparmar0404 at gmail.com>
Date: Mon, 2 Mar 2026 00:47:25 +0530
Subject: [PATCH 1/4] [clang-tidy] Rename hicpp-no-assembler to
portability-no-assembler, keep hicpp as alias
---
.../clang-tidy/hicpp/HICPPTidyModule.cpp | 5 ++-
.../clang-tidy/portability/CMakeLists.txt | 1 +
.../portability/NoAssemblerCheck.cpp | 37 +++++++++++++++++++
.../clang-tidy/portability/NoAssemblerCheck.h | 30 +++++++++++++++
.../portability/PortabilityTidyModule.cpp | 3 ++
.../clang-tidy/checks/hicpp/no-assembler.rst | 4 +-
.../docs/clang-tidy/checks/list.rst | 3 +-
.../checks/portability/no-assembler.rst | 0
.../checkers/portability/no-assembler.cpp | 12 ++++++
9 files changed, 91 insertions(+), 4 deletions(-)
create mode 100644 clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp
create mode 100644 clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst
create mode 100644 clang-tools-extra/test/clang-tidy/checkers/portability/no-assembler.cpp
diff --git a/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp b/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
index 2e0e64fbcd2a1..a4601d9cdde9f 100644
--- a/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
@@ -30,6 +30,7 @@
#include "../modernize/UseOverrideCheck.h"
#include "../performance/MoveConstArgCheck.h"
#include "../performance/NoexceptMoveConstructorCheck.h"
+#include "../portability/NoAssemblerCheck.h"
#include "../readability/BracesAroundStatementsCheck.h"
#include "../readability/FunctionSizeCheck.h"
#include "../readability/NamedParameterCheck.h"
@@ -37,7 +38,6 @@
#include "ExceptionBaseclassCheck.h"
#include "IgnoredRemoveResultCheck.h"
#include "MultiwayPathsCoveredCheck.h"
-#include "NoAssemblerCheck.h"
#include "SignedBitwiseCheck.h"
namespace clang::tidy {
@@ -81,7 +81,8 @@ class HICPPModule : public ClangTidyModule {
CheckFactories
.registerCheck<cppcoreguidelines::ProBoundsArrayToPointerDecayCheck>(
"hicpp-no-array-decay");
- CheckFactories.registerCheck<NoAssemblerCheck>("hicpp-no-assembler");
+ CheckFactories.registerCheck<portability::NoAssemblerCheck>(
+ "hicpp-no-assembler");
CheckFactories.registerCheck<cppcoreguidelines::NoMallocCheck>(
"hicpp-no-malloc");
CheckFactories
diff --git a/clang-tools-extra/clang-tidy/portability/CMakeLists.txt b/clang-tools-extra/clang-tidy/portability/CMakeLists.txt
index 73d74a550afc0..170fedf52130e 100644
--- a/clang-tools-extra/clang-tidy/portability/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/portability/CMakeLists.txt
@@ -6,6 +6,7 @@ set(LLVM_LINK_COMPONENTS
add_clang_library(clangTidyPortabilityModule STATIC
AvoidPragmaOnceCheck.cpp
+ NoAssemblerCheck.cpp
PortabilityTidyModule.cpp
RestrictSystemIncludesCheck.cpp
SIMDIntrinsicsCheck.cpp
diff --git a/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp b/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp
new file mode 100644
index 0000000000000..d9a20b97b2332
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 "NoAssemblerCheck.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+
+using namespace clang::ast_matchers;
+
+namespace clang::tidy::portability {
+
+void NoAssemblerCheck::registerMatchers(MatchFinder *Finder) {
+ Finder->addMatcher(asmStmt().bind("asm-stmt"), this);
+ Finder->addMatcher(fileScopeAsmDecl().bind("asm-file-scope"), this);
+ Finder->addMatcher(varDecl(hasAttr(attr::AsmLabel)).bind("asm-var"), this);
+}
+
+void NoAssemblerCheck::check(const MatchFinder::MatchResult &Result) {
+ SourceLocation ASMLocation;
+ if (const auto *ASM = Result.Nodes.getNodeAs<AsmStmt>("asm-stmt"))
+ ASMLocation = ASM->getAsmLoc();
+ else if (const auto *ASM =
+ Result.Nodes.getNodeAs<FileScopeAsmDecl>("asm-file-scope"))
+ ASMLocation = ASM->getAsmLoc();
+ else if (const auto *ASM = Result.Nodes.getNodeAs<VarDecl>("asm-var"))
+ ASMLocation = ASM->getLocation();
+ else
+ llvm_unreachable("Unhandled case in matcher.");
+
+ diag(ASMLocation, "do not use inline assembler in safety-critical code");
+}
+
+} // namespace clang::tidy::portability
diff --git a/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h b/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h
new file mode 100644
index 0000000000000..15d646fd97af3
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang::tidy::hicpp {
+
+/// Find assembler statements. No fix is offered.
+///
+/// For the user-facing documentation see:
+/// https://clang.llvm.org/extra/clang-tidy/checks/hicpp/no-assembler.html
+class NoAssemblerCheck : public ClangTidyCheck {
+public:
+ NoAssemblerCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace clang::tidy::hicpp
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
diff --git a/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp b/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp
index fda997a2a3df6..43898bff35618 100644
--- a/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp
@@ -9,6 +9,7 @@
#include "../ClangTidy.h"
#include "../ClangTidyModule.h"
#include "AvoidPragmaOnceCheck.h"
+#include "NoAssemblerCheck.h"
#include "RestrictSystemIncludesCheck.h"
#include "SIMDIntrinsicsCheck.h"
#include "StdAllocatorConstCheck.h"
@@ -23,6 +24,8 @@ class PortabilityModule : public ClangTidyModule {
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
CheckFactories.registerCheck<AvoidPragmaOnceCheck>(
"portability-avoid-pragma-once");
+ CheckFactories.registerCheck<NoAssemblerCheck>(
+ "portability-no-assembler");
CheckFactories.registerCheck<RestrictSystemIncludesCheck>(
"portability-restrict-system-includes");
CheckFactories.registerCheck<SIMDIntrinsicsCheck>(
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-assembler.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-assembler.rst
index 55231fbd0a8da..14f5f07d9843a 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-assembler.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-assembler.rst
@@ -1,5 +1,7 @@
.. title:: clang-tidy - hicpp-no-assembler
-
+.. meta::
+ :http-equiv=refresh: 0;URL=../portability/no-assembler.html
+
hicpp-no-assembler
==================
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index c475870ed7b31..24eda5ba3e59c 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -243,7 +243,6 @@ Clang-Tidy Checks
:doc:`hicpp-exception-baseclass <hicpp/exception-baseclass>`,
:doc:`hicpp-ignored-remove-result <hicpp/ignored-remove-result>`,
:doc:`hicpp-multiway-paths-covered <hicpp/multiway-paths-covered>`,
- :doc:`hicpp-no-assembler <hicpp/no-assembler>`,
:doc:`hicpp-signed-bitwise <hicpp/signed-bitwise>`,
:doc:`linuxkernel-must-check-errs <linuxkernel/must-check-errs>`,
:doc:`llvm-header-guard <llvm/header-guard>`,
@@ -370,6 +369,7 @@ Clang-Tidy Checks
:doc:`performance-unnecessary-copy-initialization <performance/unnecessary-copy-initialization>`, "Yes"
:doc:`performance-unnecessary-value-param <performance/unnecessary-value-param>`, "Yes"
:doc:`portability-avoid-pragma-once <portability/avoid-pragma-once>`,
+ :doc:`portability-no-assembler <portability/no-assembler>`,
:doc:`portability-restrict-system-includes <portability/restrict-system-includes>`, "Yes"
:doc:`portability-simd-intrinsics <portability/simd-intrinsics>`,
:doc:`portability-std-allocator-const <portability/std-allocator-const>`,
@@ -607,6 +607,7 @@ Check aliases
:doc:`hicpp-named-parameter <hicpp/named-parameter>`, :doc:`readability-named-parameter <readability/named-parameter>`, "Yes"
:doc:`hicpp-new-delete-operators <hicpp/new-delete-operators>`, :doc:`misc-new-delete-overloads <misc/new-delete-overloads>`,
:doc:`hicpp-no-array-decay <hicpp/no-array-decay>`, :doc:`cppcoreguidelines-pro-bounds-array-to-pointer-decay <cppcoreguidelines/pro-bounds-array-to-pointer-decay>`,
+ :doc:`hicpp-no-assembler <hicpp/no-assembler>`, :doc:`portability-no-assembler <portability/no-assembler>`,
:doc:`hicpp-no-malloc <hicpp/no-malloc>`, :doc:`cppcoreguidelines-no-malloc <cppcoreguidelines/no-malloc>`,
:doc:`hicpp-noexcept-move <hicpp/noexcept-move>`, :doc:`performance-noexcept-move-constructor <performance/noexcept-move-constructor>`, "Yes"
:doc:`hicpp-special-member-functions <hicpp/special-member-functions>`, :doc:`cppcoreguidelines-special-member-functions <cppcoreguidelines/special-member-functions>`,
diff --git a/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst b/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang-tools-extra/test/clang-tidy/checkers/portability/no-assembler.cpp b/clang-tools-extra/test/clang-tidy/checkers/portability/no-assembler.cpp
new file mode 100644
index 0000000000000..0e589b65df1ee
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/checkers/portability/no-assembler.cpp
@@ -0,0 +1,12 @@
+// RUN: %check_clang_tidy %s portability-no-assembler %t
+
+__asm__(".symver foo, bar at v");
+// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: do not use inline assembler in safety-critical code [portability-no-assembler]
+
+static int s asm("spam");
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: do not use inline assembler in safety-critical code [portability-no-assembler]
+
+void f() {
+ __asm("mov al, 2");
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not use inline assembler in safety-critical code [portability-no-assembler]
+}
>From 06f9e1b564de6c70e2e72ed0f37958ec35722295 Mon Sep 17 00:00:00 2001
From: akparmar004 <akparmar0404 at gmail.com>
Date: Mon, 2 Mar 2026 23:47:06 +0530
Subject: [PATCH 2/4] suggested changes
---
.../clang-tidy/hicpp/NoAssemblerCheck.cpp | 37 -------------------
.../clang-tidy/hicpp/NoAssemblerCheck.h | 30 ---------------
.../clang-tidy/portability/NoAssemblerCheck.h | 12 +++---
.../portability/PortabilityTidyModule.cpp | 3 +-
clang-tools-extra/docs/ReleaseNotes.rst | 4 ++
.../clang-tidy/checks/hicpp/no-assembler.rst | 10 ++---
.../checks/portability/no-assembler.rst | 14 +++++++
7 files changed, 29 insertions(+), 81 deletions(-)
delete mode 100644 clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp
delete mode 100644 clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.h
diff --git a/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp
deleted file mode 100644
index e7d97b2a26b2f..0000000000000
--- a/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.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 "NoAssemblerCheck.h"
-#include "clang/ASTMatchers/ASTMatchFinder.h"
-
-using namespace clang::ast_matchers;
-
-namespace clang::tidy::hicpp {
-
-void NoAssemblerCheck::registerMatchers(MatchFinder *Finder) {
- Finder->addMatcher(asmStmt().bind("asm-stmt"), this);
- Finder->addMatcher(fileScopeAsmDecl().bind("asm-file-scope"), this);
- Finder->addMatcher(varDecl(hasAttr(attr::AsmLabel)).bind("asm-var"), this);
-}
-
-void NoAssemblerCheck::check(const MatchFinder::MatchResult &Result) {
- SourceLocation ASMLocation;
- if (const auto *ASM = Result.Nodes.getNodeAs<AsmStmt>("asm-stmt"))
- ASMLocation = ASM->getAsmLoc();
- else if (const auto *ASM =
- Result.Nodes.getNodeAs<FileScopeAsmDecl>("asm-file-scope"))
- ASMLocation = ASM->getAsmLoc();
- else if (const auto *ASM = Result.Nodes.getNodeAs<VarDecl>("asm-var"))
- ASMLocation = ASM->getLocation();
- else
- llvm_unreachable("Unhandled case in matcher.");
-
- diag(ASMLocation, "do not use inline assembler in safety-critical code");
-}
-
-} // namespace clang::tidy::hicpp
diff --git a/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.h b/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.h
deleted file mode 100644
index 15d646fd97af3..0000000000000
--- a/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.h
+++ /dev/null
@@ -1,30 +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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
-
-#include "../ClangTidyCheck.h"
-
-namespace clang::tidy::hicpp {
-
-/// Find assembler statements. No fix is offered.
-///
-/// For the user-facing documentation see:
-/// https://clang.llvm.org/extra/clang-tidy/checks/hicpp/no-assembler.html
-class NoAssemblerCheck : public ClangTidyCheck {
-public:
- NoAssemblerCheck(StringRef Name, ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {}
- void registerMatchers(ast_matchers::MatchFinder *Finder) override;
- void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
-};
-
-} // namespace clang::tidy::hicpp
-
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
diff --git a/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h b/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h
index 15d646fd97af3..2bc403e57a143 100644
--- a/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h
+++ b/clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h
@@ -6,17 +6,17 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_NOASSEMBLERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_NOASSEMBLERCHECK_H
#include "../ClangTidyCheck.h"
-namespace clang::tidy::hicpp {
+namespace clang::tidy::portability {
/// Find assembler statements. No fix is offered.
///
/// For the user-facing documentation see:
-/// https://clang.llvm.org/extra/clang-tidy/checks/hicpp/no-assembler.html
+/// https://clang.llvm.org/extra/clang-tidy/checks/portability/no-assembler.html
class NoAssemblerCheck : public ClangTidyCheck {
public:
NoAssemblerCheck(StringRef Name, ClangTidyContext *Context)
@@ -25,6 +25,6 @@ class NoAssemblerCheck : public ClangTidyCheck {
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};
-} // namespace clang::tidy::hicpp
+} // namespace clang::tidy::portability
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_NOASSEMBLERCHECK_H
diff --git a/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp b/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp
index 43898bff35618..1f2340502f685 100644
--- a/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp
@@ -24,8 +24,7 @@ class PortabilityModule : public ClangTidyModule {
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
CheckFactories.registerCheck<AvoidPragmaOnceCheck>(
"portability-avoid-pragma-once");
- CheckFactories.registerCheck<NoAssemblerCheck>(
- "portability-no-assembler");
+ CheckFactories.registerCheck<NoAssemblerCheck>("portability-no-assembler");
CheckFactories.registerCheck<RestrictSystemIncludesCheck>(
"portability-restrict-system-includes");
CheckFactories.registerCheck<SIMDIntrinsicsCheck>(
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index 6bdc0ae7bdcc8..53debd80fc273 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -287,6 +287,10 @@ Changes in existing checks
<clang-tidy/checks/readability/suspicious-call-argument>` check by avoiding a
crash from invalid ``Abbreviations`` option.
+- Renamed `hicpp-no-assembler` to :doc:`portability-no-assembler
+ <clang-tidy/checks/portability/no-assembler>`. The ``hicpp-no-assembler``
+ name is kept as an alias.
+
Removed checks
^^^^^^^^^^^^^^
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-assembler.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-assembler.rst
index 14f5f07d9843a..7987e40ba9e8c 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-assembler.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-assembler.rst
@@ -1,12 +1,10 @@
.. title:: clang-tidy - hicpp-no-assembler
.. meta::
:http-equiv=refresh: 0;URL=../portability/no-assembler.html
-
+
hicpp-no-assembler
==================
-Checks for assembler statements. Use of inline assembly should be avoided since
-it restricts the portability of the code.
-
-This enforces `rule 7.5.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-rules>`_
-of the High Integrity C++ Coding Standard.
+The `hicpp-no-assembler` check is an alias, please see
+`portability-no-assembler <../portability/no-assembler.html>`_ for more
+information.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst b/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst
index e69de29bb2d1d..5b77777cf9794 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst
@@ -0,0 +1,14 @@
+.. title:: clang-tidy - portability-no-assembler
+
+portability-no-assembler
+========================
+
+Checks for assembler statements. Use of inline assembly should be avoided
+since it restricts the portability of the code.
+
+.. code-block:: c++
+
+ asm("mov al, 2"); // warning: do not use assembler statements
+
+`hicpp-no-assembler` is an alias for this check that enforces rule 7.5.1 of
+the High Integrity C++ Coding Standard.
\ No newline at end of file
>From 589596b7497de5d2ca0a58e4cf12e09373cf088a Mon Sep 17 00:00:00 2001
From: akparmar004 <akparmar0404 at gmail.com>
Date: Tue, 3 Mar 2026 00:00:46 +0530
Subject: [PATCH 3/4] remove no-assembler from hicpp/cmake
---
clang-tools-extra/clang-tidy/hicpp/CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/clang-tools-extra/clang-tidy/hicpp/CMakeLists.txt b/clang-tools-extra/clang-tidy/hicpp/CMakeLists.txt
index 2f31d168e65c0..c3e1f00ce57b8 100644
--- a/clang-tools-extra/clang-tidy/hicpp/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/hicpp/CMakeLists.txt
@@ -8,7 +8,6 @@ add_clang_library(clangTidyHICPPModule STATIC
HICPPTidyModule.cpp
IgnoredRemoveResultCheck.cpp
MultiwayPathsCoveredCheck.cpp
- NoAssemblerCheck.cpp
SignedBitwiseCheck.cpp
LINK_LIBS
>From a9052fa0c579bb827b15786f6400a76bb9593598 Mon Sep 17 00:00:00 2001
From: akparmar004 <akparmar0404 at gmail.com>
Date: Tue, 3 Mar 2026 00:18:31 +0530
Subject: [PATCH 4/4] Fix missing newline at end of
portability/no-assembler.rst
---
.../docs/clang-tidy/checks/portability/no-assembler.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst b/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst
index 5b77777cf9794..a7993bc8adf6b 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/portability/no-assembler.rst
@@ -11,4 +11,4 @@ since it restricts the portability of the code.
asm("mov al, 2"); // warning: do not use assembler statements
`hicpp-no-assembler` is an alias for this check that enforces rule 7.5.1 of
-the High Integrity C++ Coding Standard.
\ No newline at end of file
+the High Integrity C++ Coding Standard.
More information about the cfe-commits
mailing list