[clang] [alpha.webkit.UncountedCallArgsChecker] Allow ASSERT and atomic<T> operations in a trivial function (PR #82063)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 16 15:00:56 PST 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 118a2a52fd465b7576c54bd102ee2e417a3b9a71 69a593fc7a7e0c18bd2545353772d5da5588c1bb -- clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp clang/test/Analysis/Checkers/WebKit/call-args-protected-return-value.cpp clang/test/Analysis/Checkers/WebKit/mock-types.h 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 c713293924..a7891d2da0 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
@@ -315,9 +315,7 @@ public:
return false;
}
- bool VisitAtomicExpr(const AtomicExpr* E) {
- return VisitChildren(E);
- }
+ bool VisitAtomicExpr(const AtomicExpr *E) { return VisitChildren(E); }
bool VisitStaticAssertDecl(const StaticAssertDecl *SAD) {
// Any static_assert is considered trivial.
@@ -366,7 +364,7 @@ public:
return TrivialFunctionAnalysis::isTrivialImpl(Callee, Cache);
}
- bool VisitCXXDefaultArgExpr(const CXXDefaultArgExpr* E) {
+ bool VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E) {
if (auto *Expr = E->getExpr()) {
if (!Visit(Expr))
return false;
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
index 1bed21d18e..1fb81e27a3 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
@@ -54,7 +54,7 @@ public:
bool shouldVisitImplicitCode() const { return false; }
bool VisitCXXMethodDecl(const CXXMethodDecl *D) {
- if (auto* Class = D->getParent()) {
+ if (auto *Class = D->getParent()) {
auto name = safeGetName(Class);
if (isRefCounted(Class))
return false; // Don't visit contents of Ref/RefPtr methods.
``````````
</details>
https://github.com/llvm/llvm-project/pull/82063
More information about the cfe-commits
mailing list