https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/91143
This PR adds the support for determining the origin of a pointer in a
conditional operator.
Because such an expression can have two distinct origins each of which needs to
be visited, this PR refactors tryToFindPt
https://github.com/rniwa edited https://github.com/llvm/llvm-project/pull/91143
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa edited https://github.com/llvm/llvm-project/pull/91143
___
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/91143
>From b7360fced7163fddc7f02305bb9cc234c1ae1fef Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 5 May 2024 13:40:10 -0700
Subject: [PATCH] [analyzer] Support determining origns in a conditional
operator in We
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91143
>From 477ef4bc201240044051410ac2d2f33b10049d49 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 5 May 2024 13:40:10 -0700
Subject: [PATCH] [analyzer] Support determining origins in a conditional
operator in W
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91143
>From bbef8dedba3daf7ee35acf66b67418af80bc12c8 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 5 May 2024 13:40:10 -0700
Subject: [PATCH] [analyzer] Support determining origins in a conditional
operator in W
rniwa wrote:
> Aha, this looks like a more traditional solution! Looks great. You can make
> tests for this by feeding the compiler fake system headers with the help of
>
> ```
> #pragma clang system_header
> ```
>
> !
oh, that's neat!
https://github.com/llvm/llvm-project/pull/91103
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/91052
___
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/91009
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rniwa wrote:
Thanks for the reviews!
https://github.com/llvm/llvm-project/pull/91009
___
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/91402
None
>From 141d4b791469f23e9226ff7325131af1a5c2d8bb Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Tue, 7 May 2024 14:10:57 -0700
Subject: [PATCH] Fix a typo in webkit.NoUncountedMemberChecker.
---
.../Checker
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91402
>From c3a6cff7d1cb25da8dad0dfc7cb9b0eb694967c5 Mon Sep 17 00:00:00 2001
From: Brianna Fan
Date: Tue, 7 May 2024 14:10:57 -0700
Subject: [PATCH] Fix a typo in webkit.NoUncountedMemberChecker.
---
.../Checkers/WebKi
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/91402
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rniwa wrote:
I'm not certain that we want to ignore all instances of VM& like this. It's
certainly possible for some use of VM& to be unsafe. It might be better to
suppress the warning explicitly instead.
https://github.com/llvm/llvm-project/pull/91068
_
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91103
>From e2dbb580ff7fe1f2db1ad7c81902cb8a8b5a58ed Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 4 May 2024 20:41:29 -0700
Subject: [PATCH 1/2] [analyzer] Ignore system headers in WebKit checkers.
---
.../Che
@@ -316,10 +316,15 @@ class TrivialFunctionAnalysisVisitor
if (UO->isIncrementOp() || UO->isDecrementOp()) {
// Allow increment or decrement of a POD type.
- if (auto *RefExpr = dyn_cast(UO->getSubExpr())) {
+ auto *SubExpr = UO->getSubExpr();
+ if (au
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91102
>From b3ae3d7a2a8885777b691e7fde237f5745e764a1 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 4 May 2024 20:29:03 -0700
Subject: [PATCH 1/3] [alpha.webkit.UncountedCallArgsChecker] Allow trivial
operator++
@@ -27,12 +28,18 @@ tryToFindPtrOrigin(const Expr *E, bool
StopAtFirstRefCountedObj) {
E = tempExpr->getSubExpr();
continue;
}
+if (auto *Expr = dyn_cast(E)) {
+ return tryToFindPtrOrigin(Expr->getTrueExpr(), StopAtFirstRefCountedObj,
+
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/91103
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -309,21 +309,8 @@ class TrivialFunctionAnalysisVisitor
bool VisitDefaultStmt(const DefaultStmt *DS) { return VisitChildren(DS); }
bool VisitUnaryOperator(const UnaryOperator *UO) {
-// Operator '*' and '!' are allowed as long as the operand is trivial.
-auto op
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91102
>From b3ae3d7a2a8885777b691e7fde237f5745e764a1 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 4 May 2024 20:29:03 -0700
Subject: [PATCH 1/4] [alpha.webkit.UncountedCallArgsChecker] Allow trivial
operator++
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91143
>From a1b53d5eba21e527c292c7a899487c911d75029d Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 5 May 2024 13:40:10 -0700
Subject: [PATCH] [analyzer] Support determining origins in a conditional
operator in W
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91143
>From d3a5518192fdc2ee121ef960a91a10ec1e3fffc2 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 5 May 2024 13:40:10 -0700
Subject: [PATCH] [analyzer] Support determining origins in a conditional
operator in W
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/91102
___
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/91143
___
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/91830
None
>From 7773b0635aabeba769c0050e243f26008795d84b Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 10 May 2024 18:42:07 -0700
Subject: [PATCH] [analyzer] Treat bitwise_cast, std::addressof, and new as
triv
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91830
>From 7773b0635aabeba769c0050e243f26008795d84b Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 10 May 2024 18:42:07 -0700
Subject: [PATCH 1/2] [analyzer] Treat bitwise_cast, std::addressof, and new as
trivia
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91830
>From 7773b0635aabeba769c0050e243f26008795d84b Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 10 May 2024 18:42:07 -0700
Subject: [PATCH 1/3] [analyzer] Treat bitwise_cast, std::addressof, and new as
trivia
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91830
>From 7773b0635aabeba769c0050e243f26008795d84b Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 10 May 2024 18:42:07 -0700
Subject: [PATCH 1/4] [analyzer] Treat bitwise_cast, std::addressof, and new as
trivia
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91830
>From 7773b0635aabeba769c0050e243f26008795d84b Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 10 May 2024 18:42:07 -0700
Subject: [PATCH 1/5] [analyzer] Treat bitwise_cast, std::addressof, and new as
trivia
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/91830
___
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/91873
Also allow CXXBindTemporaryExpr, which creates a temporary object with a
non-trivial desturctor, and add a few more std and WTF functions to the
explicitly allowed list.
>From 5a5b65ba53fe79d2be05c79bcd63654b3c7b8
https://github.com/rniwa edited https://github.com/llvm/llvm-project/pull/91873
___
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/91873
>From 433852bd5e360bcf0dfe41e401c3aa73f29a2092 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 16:45:56 -0700
Subject: [PATCH] [analyzer] Treat break, continue, goto, and label statements
as triv
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91873
>From 433852bd5e360bcf0dfe41e401c3aa73f29a2092 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 16:45:56 -0700
Subject: [PATCH 1/2] [analyzer] Treat break, continue, goto, and label
statements as
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/91875
None
>From d5a676c1cbe6d9804e6b2d3582df3c4977684188 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 16:59:27 -0700
Subject: [PATCH] [alpha.webkit.UncountedCallArgsChecker] Allow explicit
instant
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91875
>From d5a676c1cbe6d9804e6b2d3582df3c4977684188 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 16:59:27 -0700
Subject: [PATCH 1/2] [alpha.webkit.UncountedCallArgsChecker] Allow explicit
instantia
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/91876
None
>From aac9ea105506ff933d773337f3260f7770a2c5e6 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 20:18:52 -0700
Subject: [PATCH] [analyzer] Allow recurisve functions to be trivial.
---
.../C
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91876
>From a4b877b240ede15260f08fcb4a4622dd45a13d0a Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 20:18:52 -0700
Subject: [PATCH] [analyzer] Allow recursive functions to be trivial.
---
.../Checker
https://github.com/rniwa edited 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 updated https://github.com/llvm/llvm-project/pull/91876
>From a4b877b240ede15260f08fcb4a4622dd45a13d0a Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 20:18:52 -0700
Subject: [PATCH 1/2] [analyzer] Allow recursive functions to be trivial.
---
.../Che
rniwa wrote:
> You should add a test for mutually recursive functions. I suspect something
> like this doesn't work:
>
> ```c++
> int non_trivial();
> int f(bool b) { return g(!b) + non_trivial(); }
> int g(bool b) { return b ? f(b) : 1; }
>
> getFieldTrivial().f(true); // exp
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91876
>From a4b877b240ede15260f08fcb4a4622dd45a13d0a Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 20:18:52 -0700
Subject: [PATCH 1/3] [analyzer] Allow recursive functions to be trivial.
---
.../Che
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91876
>From a4b877b240ede15260f08fcb4a4622dd45a13d0a Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 20:18:52 -0700
Subject: [PATCH 1/4] [analyzer] Allow recursive functions to be trivial.
---
.../Che
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91876
>From a4b877b240ede15260f08fcb4a4622dd45a13d0a Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 11 May 2024 20:18:52 -0700
Subject: [PATCH 1/5] [analyzer] Allow recursive functions to be trivial.
---
.../Che
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91876
>From a4b877b240ede15260f08fcb4a4622dd45a13d0a 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
@@ -445,6 +456,10 @@ class TrivialFunctionAnalysisVisitor
return Visit(VMT->getSubExpr());
}
+ bool VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr* BTE) {
+return Visit(BTE->getSubExpr());
rniwa wrote:
Oh! I guess we need to do that in `Trivi
rniwa wrote:
Thanks for the review!
https://github.com/llvm/llvm-project/pull/91873
___
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/91873
___
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/92220
None
>From 9af90808426aba8086e00ed75e7753036c002c78 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Tue, 14 May 2024 22:55:36 -0700
Subject: [PATCH] [analyzer] Check C++ base or member initializer in WebKit
chec
@@ -525,11 +525,19 @@ bool TrivialFunctionAnalysis::isTrivialImpl(
if (!IsNew)
return It->second;
+ TrivialFunctionAnalysisVisitor V(Cache);
+
+ if (auto *CtorDecl = dyn_cast(D)) {
+for (auto *CtorInit : CtorDecl->inits()) {
+ if (!V.Visit(CtorInit->getInit())
rniwa wrote:
Thanks for the review!
https://github.com/llvm/llvm-project/pull/92220
___
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/92220
___
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/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/5] [analyzer] Allow recursive functions to be trivial.
---
.../Che
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/92501
When a base class B has a deref function which calls delete operator on a
derived class D, don't emit a warning for B even if it did not have a virtual
destructor.
>From 87cfc8234e1294dedc103b9bcd2b7d9d31874c4a Mo
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/2] [webkit.RefCntblBaseVirtualDtor] Ignore a base class
which has a
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/3] [webkit.RefCntblBaseVirtualDtor] Ignore a base class
which has a
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/4] [webkit.RefCntblBaseVirtualDtor] Ignore a base class
which has a
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/5] [webkit.RefCntblBaseVirtualDtor] Ignore a base class
which has a
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/6] [webkit.RefCntblBaseVirtualDtor] Ignore a base class
which has a
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/7] [webkit.RefCntblBaseVirtualDtor] Ignore a base class
which has a
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/92639
This PR updates alpha.webkit.UncountedLocalVarsChecker to emit warnings for
assignments to uncounted local variable and parameters instead of just the
initialization during the declaration.
>From 5ae3b193a6ec3617c
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/8] [webkit.RefCntblBaseVirtualDtor] Ignore a base class
which has a
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
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 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 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
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 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
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
@@ -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())
@@ -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
@@ -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
@@ -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
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
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
@@ -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/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
@@ -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/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
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 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
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/91876
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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/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
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
@@ -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/93403
___
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/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 QualType T) {
+ if (auto *Subst = dyn_cast(T)) {
+if (auto *Decl = Subst->getAssociatedDecl()) {
+ if (isRefType(safeGetName(Decl)))
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
201 - 300 of 680 matches
Mail list logo