[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 12 09:06:29 PDT 2025
=?utf-8?q?DonĂ¡t?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/130985 at github.com>
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 72ee9b82151f17d6bd37abc501124d46c1cb63c3 26ecff25d303f5581dc963e53a387274746a0a09 --extensions cpp,h -- clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h clang/include/clang/StaticAnalyzer/Core/Checker.h clang/include/clang/StaticAnalyzer/Core/CheckerManager.h clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp clang/lib/StaticAnalyzer/Core/Checker.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
index 4378d3b5aa..19de36800a 100644
--- a/clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
@@ -36,9 +36,9 @@ public:
/// This checker class implements several user facing checkers
enum CheckKind { CK_DivideZero, CK_TaintedDivChecker, CK_NumCheckKinds };
BugType BugTypes[CK_NumCheckKinds] = {
- {this, CK_DivideZero, "Division by zero"},
- {this, CK_TaintedDivChecker, "Division by zero", categories::TaintedData}
- };
+ {this, CK_DivideZero, "Division by zero"},
+ {this, CK_TaintedDivChecker, "Division by zero",
+ categories::TaintedData}};
void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
};
@@ -127,9 +127,7 @@ void ento::registerDivZeroChecker(CheckerManager &Mgr) {
Mgr.registerChecker<DivZeroChecker, DivZeroChecker::CK_DivideZero>();
}
-bool ento::shouldRegisterDivZeroChecker(const CheckerManager &) {
- return true;
-}
+bool ento::shouldRegisterDivZeroChecker(const CheckerManager &) { return true; }
void ento::registerTaintedDivChecker(CheckerManager &Mgr) {
Mgr.registerChecker<DivZeroChecker, DivZeroChecker::CK_TaintedDivChecker>();
``````````
</details>
https://github.com/llvm/llvm-project/pull/130985
More information about the cfe-commits
mailing list