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/test/Analysis/Checkers/WebKit/nodelete-annotation.cpp 
clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp 
clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h 
clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefCallArgsChecker.cpp 
clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.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 8c6050a4b..c59a55e83 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/NoDeleteChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/NoDeleteChecker.cpp
@@ -34,7 +34,9 @@ class NoDeleteChecker : public 
Checker<check::ASTDecl<TranslationUnitDecl>> {
 
 public:
   NoDeleteChecker()
-      : Bug(this, "Incorrect [[clang::annotate_type(\"webkit.nodelete\")]] 
annotation",
+      : Bug(this,
+            "Incorrect [[clang::annotate_type(\"webkit.nodelete\")]] "
+            "annotation",
             "WebKit coding guidelines") {}
 
   void checkASTDecl(const TranslationUnitDecl *TUD, AnalysisManager &MGR,
@@ -48,8 +50,7 @@ public:
       const NoDeleteChecker *Checker;
       Decl *DeclWithIssue{nullptr};
 
-      explicit LocalVisitor(const NoDeleteChecker *Checker)
-          : Checker(Checker) {
+      explicit LocalVisitor(const NoDeleteChecker *Checker) : Checker(Checker) 
{
         assert(Checker);
       }
 
@@ -72,26 +73,28 @@ public:
 
     bool HasNoDeleteAnnotation = isNoDeleteFunction(FD);
     if (auto *MD = dyn_cast<CXXMethodDecl>(FD)) {
-      if (auto* Cls = MD->getParent(); Cls && MD->isVirtual()) {
+      if (auto *Cls = MD->getParent(); Cls && MD->isVirtual()) {
         CXXBasePaths Paths;
         Paths.setOrigin(Cls);
 
-        Cls->lookupInBases([&](const CXXBaseSpecifier *Base, CXXBasePath &) {
-          const Type *T = Base->getType().getTypePtrOrNull();
-          if (!T)
-            return false;
-
-          const CXXRecordDecl *R = T->getAsCXXRecordDecl();
-          for (const CXXMethodDecl *BaseMD : R->methods()) {
-            if (BaseMD->getCorrespondingMethodInClass(Cls) == MD) {
-              if (isNoDeleteFunction(FD)) {
-                HasNoDeleteAnnotation = true;
+        Cls->lookupInBases(
+            [&](const CXXBaseSpecifier *Base, CXXBasePath &) {
+              const Type *T = Base->getType().getTypePtrOrNull();
+              if (!T)
                 return false;
+
+              const CXXRecordDecl *R = T->getAsCXXRecordDecl();
+              for (const CXXMethodDecl *BaseMD : R->methods()) {
+                if (BaseMD->getCorrespondingMethodInClass(Cls) == MD) {
+                  if (isNoDeleteFunction(FD)) {
+                    HasNoDeleteAnnotation = true;
+                    return false;
+                  }
+                }
               }
-            }
-          }
-          return true;
-        }, Paths, /*LookupInDependent =*/true);
+              return true;
+            },
+            Paths, /*LookupInDependent =*/true);
       }
     }
 
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp 
b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
index 15abfab77..c47dabf2e 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
@@ -451,8 +451,7 @@ bool isPtrConversion(const FunctionDecl *F) {
   return false;
 }
 
-bool isNoDeleteFunction(const FunctionDecl *F)
-{
+bool isNoDeleteFunction(const FunctionDecl *F) {
   return typeAnnotationForReturnType(F) == WebKitAnnotation::NoDelete;
 }
 

``````````

</details>


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

Reply via email to