https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/111222
Ignore std::forward when it appears while looking for the pointer origin.
>From a67655fa83adab03351aa02d0982dd6a20726939 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 4 Oct 2024 17:44:11 -0700
Subject: [
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/98
None
>From 6214c124ce0de7ca754ccd43cfda5a572dc76b12 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 4 Oct 2024 11:57:12 -0700
Subject: [PATCH] [alpha.webkit.UncountedCallArgsChecker] Add the support for
t
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/110973
This PR fixes the bug that alpha.webkit.UncountedLocalVarsChecker erroneously
treats a trivial recursive function as non-trivial. This was caused by
TrivialFunctionAnalysis::isTrivialImpl which takes a statement
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/110222
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 02:05:25 -0700
Subject: [PATCH 1/3] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef
This
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/110222
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 02:05:25 -0700
Subject: [PATCH 1/2] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef
This
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/110222
This PR makes WebKit checkers allow a guardian variable which is CheckedPtr or
CheckedRef as in addition to RefPtr or Ref.
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niw
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/109389
>From b8f95b5b809cbeb8199de6cd24e18a605189f722 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 19 Sep 2024 23:41:10 -0700
Subject: [PATCH 1/5] WebKit Checkers should set DeclWithIssue.
Set DeclWithIssue in
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/108352
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/110213
>From 4c82195acf092fd9a92c999040f8f66947585fde Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 00:07:12 -0700
Subject: [PATCH 1/2] isUncountedPtr should take QualType as an argument.
Make isUnc
@@ -102,12 +102,13 @@ class UncountedCallArgsChecker
// if ((*P)->hasAttr())
// continue;
-const auto *ArgType = (*P)->getType().getTypePtrOrNull();
-if (!ArgType)
+QualType ArgType = (*P)->getType().getCanonicalType();
+const a
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/110213
Make isUncountedPtr take QualType as an argument instead of Type*. This
simplifies some code.
>From 4c82195acf092fd9a92c999040f8f66947585fde Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 00:
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/109389
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/7] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/6] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa edited https://github.com/llvm/llvm-project/pull/108352
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,53 @@
+// RUN: %clang_analyze_cc1
-analyzer-checker=alpha.webkit.NoUncheckedPtrMemberChecker -verify %s
+
+#include "mock-types.h"
+#include "mock-system-header.h"
rniwa wrote:
Yeah, I guess we don't need to include "mock-system-header.h" here.
https
@@ -134,10 +137,10 @@ class NoUncountedMemberChecker
Os << " in ";
printQuotedQualifiedName(Os, ClassCXXRD);
Os << " is a "
- << (isa(MemberType) ? "raw pointer" : "reference")
- << " to ref-countable type ";
+ << (isa(MemberType) ? "raw pointer" :
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/5] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
@@ -1771,6 +1771,10 @@ def UncountedLambdaCapturesChecker :
Checker<"UncountedLambdaCapturesChecker">,
let ParentPackage = WebKitAlpha in {
+def NoUncheckedPtrMemberChecker : Checker<"NoUncheckedPtrMemberChecker">,
+ HelpText<"Check for no unchecked member variables.">,
+
@@ -146,13 +149,67 @@ class NoUncountedMemberChecker
BR->emitReport(std::move(Report));
rniwa wrote:
I'm not calling `setDeclWithIssue` in this checker since the checker works on
classes, and not functions. I guess there could be classes declared within a
@@ -53,48 +53,49 @@ hasPublicMethodInBase(const CXXBaseSpecifier *Base, const
char *NameToMatch) {
return hasPublicMethodInBaseClass(R, NameToMatch) ? R : nullptr;
}
-std::optional isRefCountable(const CXXRecordDecl* R)
-{
+std::optional isSmartPtrCompatible(const CXXRecord
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/109389
>From b8f95b5b809cbeb8199de6cd24e18a605189f722 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 19 Sep 2024 23:41:10 -0700
Subject: [PATCH 1/4] WebKit Checkers should set DeclWithIssue.
Set DeclWithIssue in
@@ -56,12 +62,16 @@ class UncountedCallArgsChecker
bool TraverseClassTemplateDecl(ClassTemplateDecl *Decl) {
if (isRefType(safeGetName(Decl)))
return true;
-return RecursiveASTVisitor::TraverseClassTemplateDecl(
-Decl);
+retur
@@ -102,12 +102,13 @@ class UncountedCallArgsChecker
// if ((*P)->hasAttr())
// continue;
-const auto *ArgType = (*P)->getType().getTypePtrOrNull();
-if (!ArgType)
+QualType ArgType = (*P)->getType().getCanonicalType();
+const a
@@ -134,18 +135,25 @@ class UncountedLocalVarsChecker
bool shouldVisitTemplateInstantiations() const { return true; }
bool shouldVisitImplicitCode() const { return false; }
+ bool TraverseDecl(Decl *D) {
+llvm::SaveAndRestore SavedDecl(DeclWithIssue);
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/109393
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/109393
This PR fixes a bug in UncountedCallArgsChecker that calling a function with a
member variable which is Ref/RefPtr is erroneously treated as safe by
canoniclizing the type before checking whether it's ref counted
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/109389
>From b8f95b5b809cbeb8199de6cd24e18a605189f722 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 19 Sep 2024 23:41:10 -0700
Subject: [PATCH 1/3] WebKit Checkers should set DeclWithIssue.
Set DeclWithIssue in
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/109389
Set DeclWithIssue in alpha.webkit.UncountedCallArgsChecker and
alpha.webkit.UncountedLocalVarsChecker.
>From b8f95b5b809cbeb8199de6cd24e18a605189f722 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 19 Sep
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/109389
>From b8f95b5b809cbeb8199de6cd24e18a605189f722 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 19 Sep 2024 23:41:10 -0700
Subject: [PATCH 1/2] WebKit Checkers should set DeclWithIssue.
Set DeclWithIssue in
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/108656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108656
>From e86f101c5cd87db597c5fc8ab017b20adba98284 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Sep 2024 15:19:45 -0700
Subject: [PATCH 1/2] [webkit.RefCntblBaseVirtualDtor] ThreadSafeRefCounted
still ge
@@ -119,6 +119,11 @@ template
ensureOnMainThread([this] {
delete static_cast(this);
});
+} else if constexpr (destructionThread ==
DestructionThread::MainRunLoop) {
+auto deleteThis = [this] {
rniwa w
@@ -84,13 +84,22 @@ class DerefFuncDeleteExprVisitor
E = E->IgnoreParenCasts();
if (auto *TempE = dyn_cast(E))
E = TempE->getSubExpr();
+E = E->IgnoreParenCasts();
+if (auto *Ref = dyn_cast(E)) {
+ if (auto *Decl = Ref->getDecl()) {
+if (auto
@@ -84,13 +84,22 @@ class DerefFuncDeleteExprVisitor
E = E->IgnoreParenCasts();
if (auto *TempE = dyn_cast(E))
E = TempE->getSubExpr();
+E = E->IgnoreParenCasts();
+if (auto *Ref = dyn_cast(E)) {
+ if (auto *Decl = Ref->getDecl()) {
+if (auto
rniwa wrote:
> I'm also somewhat terrified of returning C++ objects from ObjC methods by
> value, ever since I learned that when you call an ObjC method on a nil it
> returns a _zero-initialized_ object without calling a constructor on it.
Yikes. I didn't know that!
https://github.com/llvm/ll
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/108669
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108669
>From 241fde13679b85e63126318520cd3f19029f49ad Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Sep 2024 19:01:57 -0700
Subject: [PATCH 1/2] [alpha.webkit.UncountedCallArgsChecker] Add support for
Object
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/108669
Treat a function call or property access via a Objective-C++ selector which
returns a Ref/RefPtr as safe.
>From 241fde13679b85e63126318520cd3f19029f49ad Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/108656
Improve the fix in 203a2ca8cd6af505e11a38aebceeaf864271042c by allowing
variable references and more ignoring of parentheses.
>From e86f101c5cd87db597c5fc8ab017b20adba98284 Mon Sep 17 00:00:00 2001
From: Ryosuke
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/4] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/3] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/2] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/108352
This PR introduces new WebKit checker to warn a member variable that is a raw
reference or a raw pointer to an object, which is capable of creating a
CheckedRef/CheckedPtr.
>From ac0447762c98da3cfb41a6b462034e3a
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/108184
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rniwa wrote:
Thanks for the review!
https://github.com/llvm/llvm-project/pull/108184
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -143,6 +143,16 @@ bool isReturnValueRefCounted(const clang::FunctionDecl *F)
{
return false;
}
+std::optional isUncounted(const QualType T) {
+ if (auto *Subst = dyn_cast(T)) {
+if (auto *Decl = Subst->getAssociatedDecl()) {
+ if (isRefType(safeGetName(Decl)))
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/108257
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -143,6 +143,16 @@ bool isReturnValueRefCounted(const clang::FunctionDecl *F)
{
return false;
}
+std::optional isUncounted(const clang::QualType T) {
rniwa wrote:
Fixed!
https://github.com/llvm/llvm-project/pull/108184
__
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108184
>From c8cd18baa5b285262905ad0d8c49ba102993ef1e Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Wed, 11 Sep 2024 03:14:31 -0700
Subject: [PATCH 1/3] [alpha.webkit.UncountedCallArgsChecker] Allow protector
functi
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/108167
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108184
>From c8cd18baa5b285262905ad0d8c49ba102993ef1e Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Wed, 11 Sep 2024 03:14:31 -0700
Subject: [PATCH 1/2] [alpha.webkit.UncountedCallArgsChecker] Allow protector
functi
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/108184
This PR fixes the bug that WebKit checkers didn't recognize the return value of
an Objective-C++ selector which returns Ref or RefPtr to be safe.
>From c8cd18baa5b285262905ad0d8c49ba102993ef1e Mon Sep 17 00:00:00
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/108167
Treat WTFReportBacktrace, which prints out the backtrace, as trivial.
>From ad40cdfa22ccbbea7f8b67bf0f3ac1cc0ce1a46c Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Wed, 11 Sep 2024 01:24:27 -0700
Subject: [PAT
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/107676
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/107676
>From 516ba7d30880f9aa2a0bf6ed884f5d5541b430ce Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Tue, 10 Sep 2024 19:03:12 -0700
Subject: [PATCH] This PR makes WebKit's RefCntblBaseVirtualDtor checker not
generat
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/107676
>From 3a5031d022f01baaf6fd96b2c2c0891e9b627d2c Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Tue, 10 Sep 2024 19:03:12 -0700
Subject: [PATCH] This PR makes WebKit's RefCntblBaseVirtualDtor checker not
generat
@@ -67,6 +68,48 @@ class DerefFuncDeleteExprVisitor
const Decl *D = CE->getCalleeDecl();
if (D && D->hasBody())
return VisitBody(D->getBody());
+else {
+ auto name = safeGetName(D);
+ if (name == "ensureOnMainThread" || name == "ensureOnMainRunLoop")
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/107676
>From cb214cc1f922e16ea4bd81f3c9cac54bc97c2968 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Tue, 10 Sep 2024 19:03:12 -0700
Subject: [PATCH] This PR makes WebKit's RefCntblBaseVirtualDtor checker not
generat
@@ -67,6 +68,48 @@ class DerefFuncDeleteExprVisitor
const Decl *D = CE->getCalleeDecl();
if (D && D->hasBody())
return VisitBody(D->getBody());
+else {
+ auto name = safeGetName(D);
+ if (name == "ensureOnMainThread" || name == "ensureOnMainRunLoop")
rniwa wrote:
> > Looks like you're putting no restrictions on what the opaque function is.
> > This may cause some false negatives but it's probably ultimately ok, but it
> > might be a good idea to confirm.
>
> Yes, we're not putting any requirement for the functions for now.
Actually, why n
@@ -67,6 +68,15 @@ class DerefFuncDeleteExprVisitor
const Decl *D = CE->getCalleeDecl();
if (D && D->hasBody())
return VisitBody(D->getBody());
+else if (!VisitLambdaBody) {
+ for (unsigned i = 0; i < CE->getNumArgs(); ++i) {
+auto *Arg = CE->getA
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/107676
>From be0c2e0af8e06f4b5f33855a7020b5148cb1846c Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Tue, 10 Sep 2024 19:03:12 -0700
Subject: [PATCH] This PR makes WebKit's RefCntblBaseVirtualDtor checker not
generat
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/107676
>From 9a8c60355f88d7d4cee6d9f75312bb87d13b74a9 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 7 Sep 2024 01:45:05 -0700
Subject: [PATCH] [webkit.RefCntblBaseVirtualDtor] Make ThreadSafeRefCounted
not gene
rniwa wrote:
> Looks like you're putting no restrictions on what the opaque function is.
> This may cause some false negatives but it's probably ultimately ok, but it
> might be a good idea to confirm.
Yes, we're not putting any requirement for the functions for now.
https://github.com/llvm/l
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/107676
This PR makes WebKit's RefCntblBaseVirtualDtor checker not generate a warning
for ThreadSafeRefCounted when the destruction thread is a specific thread.
Prior to this PR, we only allowed CRTP classes without a vi
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/93403
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -11,16 +11,116 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/93403
None
>From 4f5b6ac39e709bddf7f1ced314ebb1984a1942de Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 26 May 2024 00:34:15 -0700
Subject: [PATCH] Fix the warning in RefCntblBaseVirtualDtorChecker.cpp:61
---
@@ -11,16 +11,116 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/92837
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92837
>From 9c2ae2b2b14d27270589f3775df95a7547e74c83 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 20 May 2024 16:12:44 -0700
Subject: [PATCH 1/4] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes
without a vi
@@ -11,16 +11,134 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/91876
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rniwa wrote:
Thanks for the review!
https://github.com/llvm/llvm-project/pull/91876
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/92639
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92837
>From 9c2ae2b2b14d27270589f3775df95a7547e74c83 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 20 May 2024 16:12:44 -0700
Subject: [PATCH 1/3] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes
without a vi
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92837
>From 9c2ae2b2b14d27270589f3775df95a7547e74c83 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 20 May 2024 16:12:44 -0700
Subject: [PATCH 1/2] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes
without a vi
@@ -11,16 +11,134 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
@@ -11,16 +11,134 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91876
>From e40017a2750ee39bfd1a87b5ddea620076bc4419 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 20:18:52 -0700
Subject: [PATCH 1/6] [analyzer] Allow recursive functions to be trivial.
---
.../Che
@@ -231,6 +231,15 @@ class RefCounted {
void method();
void someFunction();
int otherFunction();
+ unsigned recursiveTrivialFunction(int n) { return !n ? 1 :
recursiveTrivialFunction(n - 1); }
+ unsigned recursiveComplexFunction(int n) { return !n ? otherFunction() :
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92639
>From 5ae3b193a6ec3617c99297da5b8d276b0e5bbc01 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 18 May 2024 02:17:30 -0700
Subject: [PATCH 1/2] [alpha.webkit.UncountedLocalVarsChecker] Detect
assignments to u
rniwa wrote:
> (It might be a good idea to add comments to those parts of the code to make
> sure the reader knows that it was intentional.)
Ok, I was gonna say I'd add tests and then realized that the error message says
"local variable" to both static local as well as global variables. That's
@@ -11,16 +11,134 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
@@ -11,16 +11,134 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
@@ -11,16 +11,134 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
@@ -11,16 +11,134 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
@@ -11,16 +11,134 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
@@ -51,92 +169,137 @@ class RefCntblBaseVirtualDtorChecker
bool shouldVisitImplicitCode() const { return false; }
bool VisitCXXRecordDecl(const CXXRecordDecl *RD) {
-Checker->visitCXXRecordDecl(RD);
+if (!RD->hasDefinition())
+ return true;
@@ -11,16 +11,134 @@
#include "PtrTypesSemantics.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/B
@@ -135,7 +135,19 @@ class UncountedLocalVarsChecker
bool shouldVisitImplicitCode() const { return false; }
bool VisitVarDecl(VarDecl *V) {
-Checker->visitVarDecl(V);
+auto *Init = V->getInit();
+if (Init && V->isLocalVarDecl())
+ C
@@ -135,7 +135,19 @@ class UncountedLocalVarsChecker
bool shouldVisitImplicitCode() const { return false; }
bool VisitVarDecl(VarDecl *V) {
-Checker->visitVarDecl(V);
+auto *Init = V->getInit();
+if (Init && V->isLocalVarDecl())
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92837
>From 9c2ae2b2b14d27270589f3775df95a7547e74c83 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 20 May 2024 16:12:44 -0700
Subject: [PATCH] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a
virtua
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92837
>From 9cbdf8228c8b10f4c8cd4e8770b58921e559a687 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 20 May 2024 16:12:44 -0700
Subject: [PATCH] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a
virtua
rniwa wrote:
Closing this PR in favor of https://github.com/llvm/llvm-project/pull/92837,
which has a single consolidated commit.
https://github.com/llvm/llvm-project/pull/92501
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llv
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/92501
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/92837
Exempt CRTP (Curiously Recurring Template Pattern) classes with a delete
operation acting on "this" pointer with an appropriate cast from the
requirement that a ref-countable superclass must have a virtual destruct
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92501
>From 87cfc8234e1294dedc103b9bcd2b7d9d31874c4a Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 16 May 2024 23:24:13 -0700
Subject: [PATCH 01/10] [webkit.RefCntblBaseVirtualDtor] Ignore a base class
which has
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92501
>From 87cfc8234e1294dedc103b9bcd2b7d9d31874c4a Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 16 May 2024 23:24:13 -0700
Subject: [PATCH 1/9] [webkit.RefCntblBaseVirtualDtor] Ignore a base class
which has a
1 - 100 of 345 matches
Mail list logo