https://github.com/Szelethus closed
https://github.com/llvm/llvm-project/pull/94957
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Szelethus wrote:
> > > I did not find a similar test for `MallocChecker` but there could be one
> > > with similar test functions.
> >
> >
> > I'm not sure what tests you are referring to. I did fix your other
> > observations.
>
> I meant another test file where the `NoStateChangeFuncVisito
https://github.com/balazske approved this pull request.
At least the `StreamChecker` part looks correct, Probably we can test on the
opensource projects if there appear too many bad results (but probably not many
resource leak cases are found).
https://github.com/llvm/llvm-project/pull/94957
_
balazske wrote:
> > I did not find a similar test for `MallocChecker` but there could be one
> > with similar test functions.
>
> I'm not sure what tests you are referring to. I did fix your other
> observations.
I meant another test file where the `NoStateChangeFuncVisitor` is tested (if
the
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
+// Definition of NoStreamStateChangeVisitor.
+//===--
Szelethus wrote:
> I did not find a similar test for `MallocChecker` but there could be one with
> similar test functions.
I'm not sure what tests you are referring to. I did fix your other observations.
https://github.com/llvm/llvm-project/pull/94957
__
https://github.com/Szelethus updated
https://github.com/llvm/llvm-project/pull/94957
From faf00d0e1286e053ba9fb457513bd8309eb541ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Krist=C3=B3f=20Umann?=
Date: Fri, 7 Jun 2024 12:07:35 +0200
Subject: [PATCH 1/5] [analyzer] Add an ownership change visitor
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
+// Definition of NoStreamStateChangeVisitor.
+//===--
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
+// Definition of NoStreamStateChangeVisitor.
+//===--
https://github.com/Szelethus edited
https://github.com/llvm/llvm-project/pull/94957
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
@@ -98,6 +107,19 @@ struct StreamState {
OpenFailed /// The last open operation has failed.
} State;
+ StringRef getKindStr() const {
+switch (State) {
+
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
@@ -300,6 +333,8 @@ class StreamChecker : public Checkerhttps://github.com/llvm/llvm-project/pull/94957
___
cfe-commits mailing
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
=?utf-8?q?Krist=C3=B3f?= Umann ,
=?utf-8?q?Krist=C3=B3f?= Umann ,
=?utf-8?q?Krist=C3=B3f?= Umann
Message-ID:
In-Reply-To:
https://github.com/steakhal commented:
LGTM. I only had some nits and some terminology flexing.
https://github.com/llvm/llvm-project/pull/94957
___
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann ,
=?utf-8?q?Kristóf?= Umann
Message-ID:
In-Reply-To:
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/94957
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http
@@ -696,6 +732,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
+// Definition of NoStreamStateChangeVisitor.
+//===--
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
+// Definition of NoStreamStateChangeVisitor.
+//===--
https://github.com/balazske edited
https://github.com/llvm/llvm-project/pull/94957
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/balazske commented:
I did not find big issues. But a description could be added to the
`NoOwnershipChangeVisitor` to explain what it does, and to `StreamChecker` for
what is it used. I did not find a similar test for `MallocChecker` but there
could be one with similar test f
@@ -0,0 +1,179 @@
+// RUN: %clang_analyze_cc1 -verify %s -analyzer-output=text \
+// RUN: -analyzer-checker=core \
+// RUN: -analyzer-checker=unix.Stream
balazske wrote:
This file can have a better name (like "stream-notes-missing-close.cpp").
https://github
https://github.com/Szelethus updated
https://github.com/llvm/llvm-project/pull/94957
From faf00d0e1286e053ba9fb457513bd8309eb541ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Krist=C3=B3f=20Umann?=
Date: Fri, 7 Jun 2024 12:07:35 +0200
Subject: [PATCH 1/4] [analyzer] Add an ownership change visitor
https://github.com/Szelethus updated
https://github.com/llvm/llvm-project/pull/94957
From faf00d0e1286e053ba9fb457513bd8309eb541ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Krist=C3=B3f=20Umann?=
Date: Fri, 7 Jun 2024 12:07:35 +0200
Subject: [PATCH 1/3] [analyzer] Add an ownership change visitor
https://github.com/Szelethus updated
https://github.com/llvm/llvm-project/pull/94957
From faf00d0e1286e053ba9fb457513bd8309eb541ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Krist=C3=B3f=20Umann?=
Date: Fri, 7 Jun 2024 12:07:35 +0200
Subject: [PATCH 1/2] [analyzer] Add an ownership change visitor
@@ -168,8 +193,9 @@ REGISTER_MAP_WITH_PROGRAMSTATE(StreamMap, SymbolRef,
StreamState)
namespace {
class StreamChecker;
-using FnCheck = std::function;
+using FnCheckTy = void(const StreamChecker *, const FnDescription *,
+ const CallEvent &,
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/94957
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat approved this pull request.
Nice improvement, LGTM overall. I only have one phrasing nitpick and one very
minor question about a tangential change.
https://github.com/llvm/llvm-project/pull/94957
___
cfe-commits mailing l
@@ -696,6 +732,69 @@ struct StreamOperationEvaluator {
} // end anonymous namespace
+//===--===//
+// Definition of NoStreamStateChangeVisitor.
+//===--
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff e622996eddfb2826d258b3a3760eed195f97aabe
faf00d0e1286e053ba9fb457513bd8309eb541ed --
llvmbot wrote:
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-clang-static-analyzer-1
Author: Kristóf Umann (Szelethus)
Changes
This is very similar to https://reviews.llvm.org/D105553, in fact, I barely
made any changes from MallocChecker's ownership visitor to this one.
The new visito
https://github.com/Szelethus created
https://github.com/llvm/llvm-project/pull/94957
This is very similar to https://reviews.llvm.org/D105553, in fact, I barely
made any changes from MallocChecker's ownership visitor to this one.
The new visitor emits a diagnostic note for function where a cha
36 matches
Mail list logo