[clang] [analyzer] Treat break, continue, goto, and label statements as trivial in WebKit checkers. (PR #91873)
via cfe-commits
cfe-commits at lists.llvm.org
Sat May 11 16:52:29 PDT 2024
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 31774b6a8a88b435ce79f9ba048ef8bb00e2817e 433852bd5e360bcf0dfe41e401c3aa73f29a2092 -- clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
index e6d014e3ba..f1b97ecc5b 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
@@ -309,10 +309,10 @@ public:
bool VisitDefaultStmt(const DefaultStmt *DS) { return VisitChildren(DS); }
// break, continue, goto, and label statements are always trivial.
- bool VisitBreakStmt(const BreakStmt*) { return true; }
- bool VisitContinueStmt(const ContinueStmt*) { return true; }
- bool VisitGotoStmt(const GotoStmt*) { return true; }
- bool VisitLabelStmt(const LabelStmt*) { return true; }
+ bool VisitBreakStmt(const BreakStmt *) { return true; }
+ bool VisitContinueStmt(const ContinueStmt *) { return true; }
+ bool VisitGotoStmt(const GotoStmt *) { return true; }
+ bool VisitLabelStmt(const LabelStmt *) { return true; }
bool VisitUnaryOperator(const UnaryOperator *UO) {
// Unary operators are trivial if its operand is trivial except co_await.
@@ -355,8 +355,8 @@ public:
return false;
const auto &Name = safeGetName(Callee);
- if (Callee->isInStdNamespace() && (Name == "addressof" ||
- Name == "forward" || Name == "move"))
+ if (Callee->isInStdNamespace() &&
+ (Name == "addressof" || Name == "forward" || Name == "move"))
return true;
if (Name == "WTFCrashWithInfo" || Name == "WTFBreakpointTrap" ||
@@ -456,7 +456,7 @@ public:
return Visit(VMT->getSubExpr());
}
- bool VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr* BTE) {
+ bool VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE) {
return Visit(BTE->getSubExpr());
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/91873
More information about the cfe-commits
mailing list