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 origin/main HEAD --extensions h,cpp -- 
clang/lib/StaticAnalyzer/Checkers/WebKit/NoDeleteChecker.cpp 
clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp 
clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h 
clang/test/Analysis/Checkers/WebKit/mock-types.h 
clang/test/Analysis/Checkers/WebKit/nodelete-annotation.cpp 
clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp 
--diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/NoDeleteChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/WebKit/NoDeleteChecker.cpp
index ee163bdd5..c906fbdba 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/NoDeleteChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/NoDeleteChecker.cpp
@@ -96,7 +96,7 @@ public:
       return;
 
     bool ParamHaveTrivialDtors = true;
-    for (auto* Param : FD->parameters()) {
+    for (auto *Param : FD->parameters()) {
       if (!TFA.hasTrivialDtor(Param)) {
         ParamHaveTrivialDtors = false;
         break;
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp 
b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
index bdea5e208..14df3d763 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
@@ -527,7 +527,7 @@ public:
         return true;
       if (FnDecl->isVirtualAsWritten())
         return false;
-      for (auto* Param : FnDecl->parameters()) {
+      for (auto *Param : FnDecl->parameters()) {
         if (!HasTrivialDestructor(Param))
           return false;
       }
@@ -545,7 +545,7 @@ public:
       return Visit(Body);
     });
   }
-  
+
   bool HasTrivialDestructor(const VarDecl *VD) {
     auto QT = VD->getType();
     if (QT.isPODType(VD->getASTContext()))
@@ -570,7 +570,8 @@ public:
         Type = QT.getTypePtrOrNull();
         if (!Type)
           return false;
-        if (isa<PointerType>(Type)) // An array of pointer does not have a 
destructor.
+        if (isa<PointerType>(
+                Type)) // An array of pointer does not have a destructor.
           return true;
         R = Type->getAsCXXRecordDecl();
       }
@@ -621,7 +622,7 @@ public:
   }
 
   bool VisitDeclStmt(const DeclStmt *DS) {
-    for (auto& Decl : DS->decls()) {
+    for (auto &Decl : DS->decls()) {
       if (auto *VD = dyn_cast<VarDecl>(Decl)) {
         if (!HasTrivialDestructor(VD))
           return false;
@@ -780,7 +781,7 @@ public:
     return true;
   }
 
-  bool VisitCXXDefaultInitExpr(const CXXDefaultInitExpr* E) {
+  bool VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *E) {
     return Visit(E->getExpr());
   }
 
@@ -910,8 +911,8 @@ bool TrivialFunctionAnalysis::isTrivialImpl(
   return V.IsStatementTrivial(S);
 }
 
-bool TrivialFunctionAnalysis::hasTrivialDtorImpl(
-    const VarDecl *VD, CacheTy &Cache) {
+bool TrivialFunctionAnalysis::hasTrivialDtorImpl(const VarDecl *VD,
+                                                 CacheTy &Cache) {
   TrivialFunctionAnalysisVisitor V(Cache);
   return V.HasTrivialDestructor(VD);
 }
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h 
b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h
index c76f3d47b..8a696a789 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h
@@ -170,7 +170,7 @@ public:
   /// \returns true if \p D is a "trivial" function.
   bool isTrivial(const Decl *D) const { return isTrivialImpl(D, TheCache); }
   bool isTrivial(const Stmt *S) const { return isTrivialImpl(S, TheCache); }
-  bool hasTrivialDtor(const VarDecl* VD) const {
+  bool hasTrivialDtor(const VarDecl *VD) const {
     return hasTrivialDtorImpl(VD, TheCache);
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/181576
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to