[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2024-02-13 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: Closing because of the other PR. https://github.com/llvm/llvm-project/pull/68170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2024-02-13 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/68170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-23 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: I couldn't take over this PR so I made a new PR at https://github.com/llvm/llvm-project/pull/69985. https://github.com/llvm/llvm-project/pull/68170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-20 Thread Ryosuke Niwa via cfe-commits
@@ -44,9 +46,25 @@ bool hasPublicRefAndDeref(const CXXRecordDecl *R) { namespace clang { -std::optional -isRefCountable(const CXXBaseSpecifier* Base) -{ +std::optional +hasPublicRefInBase(const CXXBaseSpecifier *Base) { + assert(Base); + + const Type *T = Base->getType().ge

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-20 Thread Ryosuke Niwa via cfe-commits
@@ -18,24 +18,26 @@ using namespace clang; namespace { -bool hasPublicRefAndDeref(const CXXRecordDecl *R) { +bool hasPublicRefMethod(const CXXRecordDecl *R) { assert(R); assert(R->hasDefinition()); - bool hasRef = false; - bool hasDeref = false; for (const CXXMet

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-20 Thread Ryosuke Niwa via cfe-commits
@@ -70,29 +88,45 @@ std::optional isRefCountable(const CXXRecordDecl* R) if (!R) return std::nullopt; - if (hasPublicRefAndDeref(R)) + bool hasRef = hasPublicRefMethod(R); + bool hasDeref = hasPublicDerefMethod(R); + if (hasRef && hasDeref) return true; CXX

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-19 Thread Artem Dergachev via cfe-commits
@@ -44,9 +46,25 @@ bool hasPublicRefAndDeref(const CXXRecordDecl *R) { namespace clang { -std::optional -isRefCountable(const CXXBaseSpecifier* Base) -{ +std::optional +hasPublicRefInBase(const CXXBaseSpecifier *Base) { + assert(Base); + + const Type *T = Base->getType().ge

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-19 Thread Artem Dergachev via cfe-commits
@@ -70,29 +88,45 @@ std::optional isRefCountable(const CXXRecordDecl* R) if (!R) return std::nullopt; - if (hasPublicRefAndDeref(R)) + bool hasRef = hasPublicRefMethod(R); + bool hasDeref = hasPublicDerefMethod(R); + if (hasRef && hasDeref) return true; CXX

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-19 Thread Artem Dergachev via cfe-commits
@@ -18,24 +18,26 @@ using namespace clang; namespace { -bool hasPublicRefAndDeref(const CXXRecordDecl *R) { +bool hasPublicRefMethod(const CXXRecordDecl *R) { assert(R); assert(R->hasDefinition()); - bool hasRef = false; - bool hasDeref = false; for (const CXXMet

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-19 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ commented: @rniwa I had a look and I think everything looks mostly good! I found one possible bug and made a couple comments about how I'm frustrated about code duplication. https://github.com/llvm/llvm-project/pull/68170 __

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-19 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/68170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Changes Patch by Ryosuke Niwa! --- Full diff: https://github.com/llvm/llvm-project/pull/68170.diff 5 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp (+62-28) - (modified) clang/lib/StaticAnalyzer/Che

[clang] [analyzer] WebKit checkers: support ref and deref defined on different classes. (PR #68170)

2023-10-03 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ created https://github.com/llvm/llvm-project/pull/68170 Patch by Ryosuke Niwa! >From fc5a447a0dd4203ee69a506cfc791255d555462a Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Tue, 3 Oct 2023 18:13:21 -0700 Subject: [PATCH] [analyzer] WebKit checkers: support ref and