[clang] [NFC][analyzer][docs] Crosslink MallocChecker's ownership attributes (PR #121939)

2025-01-07 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/121939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer][docs] Crosslink MallocChecker's ownership attributes (PR #121939)

2025-01-07 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/121939 Forgot to mention these in the checker docs. From 80a8cb8425c4c588659e1153fe0834d6514070d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Tue, 7 Jan 2025 13:30:28 +0100 Subject: [PATCH]

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-07 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/121759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-07 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/121759 From 24b15119f476bf8c981618132b05357a87d98476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Mon, 6 Jan 2025 13:14:37 +0100 Subject: [PATCH 1/5] [analyzer][docs] Document MallocChecker's

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/121759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/121759 From 24b15119f476bf8c981618132b05357a87d98476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Mon, 6 Jan 2025 13:14:37 +0100 Subject: [PATCH 1/4] [analyzer][docs] Document MallocChecker's

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/121759 From 24b15119f476bf8c981618132b05357a87d98476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Mon, 6 Jan 2025 13:14:37 +0100 Subject: [PATCH 1/3] [analyzer][docs] Document MallocChecker's

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Kristóf Umann via cfe-commits
@@ -1389,6 +1389,68 @@ Query for this attribute with ``__has_attribute(overloadable)``. }]; } +def OwnershipDocs : Documentation { + let Heading = "ownership_holds, ownership_returns, ownership_takes (Clang " +"Static Analyzer)"; + let Category = DocCatFun

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/121759 From 24b15119f476bf8c981618132b05357a87d98476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Mon, 6 Jan 2025 13:14:37 +0100 Subject: [PATCH 1/2] [analyzer][docs] Document MallocChecker's

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Kristóf Umann via cfe-commits
@@ -1389,6 +1389,68 @@ Query for this attribute with ``__has_attribute(overloadable)``. }]; } +def OwnershipDocs : Documentation { + let Heading = "ownership_holds, ownership_returns, ownership_takes (Clang " +"Static Analyzer)"; + let Category = DocCatFun

[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

2025-01-06 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/121759 Exactly what it says on the tin! These were written ages ago (2010s), but are still functional, only the docs are missing. ![image](https://github.com/user-attachments/assets/e119d995-27c2-43b7-bbd5-39275129a

[clang] [analyzer][Z3] Restore the original timeout of 15s (PR #118291)

2024-12-13 Thread Kristóf Umann via cfe-commits
Szelethus wrote: Oh, I'm so sorry I left this as-is, thank you so much for picking up the slack! Yes, everything looks great! https://github.com/llvm/llvm-project/pull/118291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [analyzer][Z3] Restore the original timeout of 15s (PR #118291)

2024-12-13 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/118291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][Z3] Restore the original timeout of 15s (PR #118291)

2024-12-03 Thread Kristóf Umann via cfe-commits
Szelethus wrote: > I also have some just-in-case measurements cooking to confirm that we don't > observe any nondeterminism with these values. Previous measurements of mine > were made with _all_ configs set to 0. Our downstream release goes off with > the patch totally reverted. Sanity check

[clang] [analyzer][Z3] Restore the original timeout of 15s (PR #118291)

2024-12-02 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/118291 Discussion here: https://discourse.llvm.org/t/analyzer-rfc-taming-z3-query-times/79520/15?u=szelethus The original patch, #97298 introduced new timeouts backed by thorough testing and measurements to keep the

[clang] [analyzer][Z3] Restore the original timeout of 15s (PR #118291)

2024-12-02 Thread Kristóf Umann via cfe-commits
Szelethus wrote: I also have some just-in-case measurements cooking to confirm that we don't observe any nondeterminism with these values. Previous measurements of mine were made with _all_ configs set to 0. Our downstream release goes off with the patch totally reverted. https://github.com/l

[clang] [analyzer] Untangle subcheckers of CStringChecker (PR #113312)

2024-11-18 Thread Kristóf Umann via cfe-commits
Szelethus wrote: @steakhal, and especially @isuckatcs, I greatly appreciate the reviews! I happen to have gotten some very ugrent task on my plate that drew away my attention from this project. I will fix this PR up as soon as I'm done! https://github.com/llvm/llvm-project/pull/113312

[clang] [analyzer] Untangle subcheckers of CStringChecker (PR #113312)

2024-10-22 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/113312 It turns out, that some checks for cstring functions happened as a side effect of other checks. For example, whether the arguments to memcpy were uninitialized happened during buffer overflow checking. The w

[clang] [analyzer] Suppress out of bounds reports after weak loop assumptions (PR #109804)

2024-10-14 Thread Kristóf Umann via cfe-commits
Szelethus wrote: Damn, look at this project, thriving as strong as ever 18 years after its conception! Great discussions! Let me throw in my two cents. Overall, I think we should go with this patch. I agree with a great many things previously said, this one summarizes the argument for the vis

[clang] [analyzer] Explicitly register NoStoreFuncVisitor from alpha.unix.cst… (PR #108373)

2024-09-19 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/108373 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Explicitly register NoStoreFuncVisitor from alpha.unix.cst… (PR #108373)

2024-09-19 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/108373 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-09-17 Thread Kristóf Umann via cfe-commits
Szelethus wrote: My say doesn't quite have the same weight here are many others, but I see no problems with this patch after so many rounds of reviews -- would it be okay to merge? https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits maili

[clang] [analyzer] [MallocChecker] suspect all release functions as candidate for suppression (PR #104599)

2024-09-16 Thread Kristóf Umann via cfe-commits
Szelethus wrote: You already have a good number of quality patches under your belt. I suggest that you ask for a commit access, I have no doubt it'll be granted: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access https://github.com/llvm/llvm-project/pull/104599 _

[clang] [analyzer] [MallocChecker] suspect all release functions as candidate for suppression (PR #104599)

2024-09-16 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus approved this pull request. LGTM! Do you have commit access? https://github.com/llvm/llvm-project/pull/104599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [analyzer] Explicitly register NoStoreFuncVisitor from alpha.unix.cst… (PR #108373)

2024-09-16 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/108373 From cc823218d5cbb0b8f183bbadc9a32380c8e328a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Tue, 16 Jul 2024 15:06:06 +0200 Subject: [PATCH 1/2] [analyzer] Explicitly register NoStoreFu

[clang] [analyzer] Explicitly register NoStoreFuncVisitor from alpha.unix.cst… (PR #108373)

2024-09-16 Thread Kristóf Umann via cfe-commits
@@ -263,6 +263,23 @@ bool SVal::isZeroConstant() const { // Pretty-Printing. //===--===// +StringRef SVal::getKindStr() const { + switch (getKind()) { +#define BASIC_SVAL(Id, Parent)

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-12 Thread Kristóf Umann via cfe-commits
Szelethus wrote: Superceding this patch to 108373. https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-12 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Explicitly register NoStoreFuncVisitor from alpha.unix.cst… (PR #108373)

2024-09-12 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/108373 …ring.UninitRead This is a drastic simplification of #106982. If you read that patch, this is the same thing with all BugReporterVisitors.cpp and SValBuilder.cpp changes removed! (since all replies came rega

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/106350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Kristóf Umann via cfe-commits
@@ -86,6 +124,19 @@ Options this option enables. Default is `true`. +.. _option-ReportDefaultFunctions: + +.. option:: ReportDefaultFunctions + +When `true`, the check reports the default set of functions. +Default is `true`. Szelethus wrote: "Y

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-12 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus commented: Alright, I think this patch is good from a design standpoint! I'll get into the nitty-gritty in a bit. https://github.com/llvm/llvm-project/pull/106350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang-tools-extra] [clang-tidy] Add user-defined functions to `bugprone-unsafe-functions` check (PR #106350)

2024-09-05 Thread Kristóf Umann via cfe-commits
Szelethus wrote: > `CustomAnnexKFunctions` exists because the checker has two different internal > matching modes for whether AnnexK is enabled or not. This both depends on > `__STDC_LIB_EXT1__` (defined by system) `__STDC_WANT_LIB_EXT1__` (defined by > the user), so it's reasonable to expect

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/106982 SValBuilder used to early exit when we did binary operations when one of the operands was a LazyCompoundVal. Riding on the new docs patch (#97407), this patch extracts the actual value behind the LazyCompound

[clang] [analyzer] Assert Callee is FunctionDecl in doesFnIntendToHandleOwnership() (PR #101066)

2024-08-05 Thread Kristóf Umann via cfe-commits
Szelethus wrote: Just landed the patch, sorry for the slack! https://github.com/llvm/llvm-project/pull/101066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Eliminate a dyn_cast (PR #100719)

2024-08-05 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/100719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Eliminate a dyn_cast (PR #100719)

2024-08-05 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/100719 From d176b03b211144dadaa1efb4b7da959110d7725c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Fri, 26 Jul 2024 11:01:41 +0200 Subject: [PATCH 1/2] [analyzer][NFC] Eliminate a dyn_cast --

[clang] [analyzer][NFC] Factor out NoOwnershipChangeVisitor (PR #94357)

2024-07-26 Thread Kristóf Umann via cfe-commits
@@ -804,23 +751,21 @@ class NoOwnershipChangeVisitor final : public NoStateChangeFuncVisitor { return false; } + bool hasResourceStateChanged(ProgramStateRef CallEnterState, + ProgramStateRef CallExitEndState) final { +return CallEnter

[clang] [analyzer][NFC] Eliminate a dyn_cast (PR #100719)

2024-07-26 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/100719 Response to the catch in this comment: https://github.com/llvm/llvm-project/pull/94357/files/07f6daf2cf0f5d5bd4fc9950f2585a3f52b4ad2f#r1692084074 From d176b03b211144dadaa1efb4b7da959110d7725c Mon Sep 17 00:00

[clang] [analyzer][NFC] Minor cleanup in two test files. (PR #100570)

2024-07-25 Thread Kristóf Umann via cfe-commits
Szelethus wrote: > If these changes are unrelated to each other, wouldn't it be better to > separate them into 2 commits? I see the principle, but I think its reasonable to push this one go, considering that these changes are really minor and inconsquential, especially since they affect the v

[clang] [analyzer][NFC] Minor cleanup in two test files. (PR #100570)

2024-07-25 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus approved this pull request. https://github.com/llvm/llvm-project/pull/100570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-25 Thread Kristóf Umann via cfe-commits
Szelethus wrote: I decided to merge this. We are still miles ahead with these docs, and I don't wanna accidentally forget the PR. https://github.com/llvm/llvm-project/pull/97407 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-25 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/97407 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-23 Thread Kristóf Umann via cfe-commits
@@ -0,0 +1,182 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-07-23 Thread Kristóf Umann via cfe-commits
@@ -0,0 +1,125 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-22 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/97407 From 9fed2b7dc5395f487cb91c10eb076bb87e05e9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Tue, 2 Jul 2024 12:58:19 +0200 Subject: [PATCH 1/6] [analyzer][NFC] Add some docs for LazyComp

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-22 Thread Kristóf Umann via cfe-commits
@@ -363,6 +397,18 @@ class LazyCompoundVal : public NonLoc { /// It might return null. const void *getStore() const; + /// This function itself is immaterial. It is only an implementation detail. + /// LazyCompoundVal represents only the rvalue, the data (known or unknow

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-16 Thread Kristóf Umann via cfe-commits
Szelethus wrote: I'd also love to see some docs for `Loc` and `NonLoc`, because I recall some angry looks from years ago when I touched those on their own, but I can barely recall them :( As well as some docs for the various `ProgramState::getSVal` methods... https://github.com/llvm/llvm-proj

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-16 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/97407 From 9fed2b7dc5395f487cb91c10eb076bb87e05e9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Tue, 2 Jul 2024 12:58:19 +0200 Subject: [PATCH 1/5] [analyzer][NFC] Add some docs for LazyComp

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-16 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/97407 From 9fed2b7dc5395f487cb91c10eb076bb87e05e9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Tue, 2 Jul 2024 12:58:19 +0200 Subject: [PATCH 1/4] [analyzer][NFC] Add some docs for LazyComp

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-16 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/97407 From 9fed2b7dc5395f487cb91c10eb076bb87e05e9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Tue, 2 Jul 2024 12:58:19 +0200 Subject: [PATCH 1/3] [analyzer][NFC] Add some docs for LazyComp

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-16 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/97407 From 9fed2b7dc5395f487cb91c10eb076bb87e05e9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Tue, 2 Jul 2024 12:58:19 +0200 Subject: [PATCH 1/2] [analyzer][NFC] Add some docs for LazyComp

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-07-04 Thread Kristóf Umann via cfe-commits
Szelethus wrote: I merget the PR as is, but I'll keep the warning message in mind, I'm open to changing it as we are getting closer to moving out-of-alpha. https://github.com/llvm/llvm-project/pull/95408 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-07-04 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/95408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-02 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/97407 Yes, I basically copy-pasted some posts from discord and Artem's book, but these make for a rather decent docs. From 9fed2b7dc5395f487cb91c10eb076bb87e05e9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-07-01 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/95408 From 90cedd519da8b76c686db9c3f824b6d044e16eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Thu, 25 Apr 2024 17:31:24 +0200 Subject: [PATCH 1/7] [analyzer] Check the correct first and la

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-07-01 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/95408 From 90cedd519da8b76c686db9c3f824b6d044e16eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Thu, 25 Apr 2024 17:31:24 +0200 Subject: [PATCH 1/6] [analyzer] Check the correct first and la

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-24 Thread Kristóf Umann via cfe-commits
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

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-24 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/95408 From d717b412749f10b45a9387044e97da6981f3cad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Thu, 25 Apr 2024 17:31:24 +0200 Subject: [PATCH 1/5] [analyzer] Check the correct first and la

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-24 Thread Kristóf Umann via cfe-commits
@@ -393,6 +401,162 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return stateNonNull; } +static std::optional getIndex(ProgramStateRef State, + const ElementRegion *ER, CharKind CK) { + SValBuilder &SVB = State->get

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-24 Thread Kristóf Umann via 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

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-20 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/95408 From d717b412749f10b45a9387044e97da6981f3cad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Thu, 25 Apr 2024 17:31:24 +0200 Subject: [PATCH 1/4] [analyzer] Check the correct first and la

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-20 Thread Kristóf Umann via cfe-commits
Szelethus wrote: > The intention of the patch makes sense to me. However, I believe that the bug > is inside the Store. It should not say it's `Undefined` if actually an > existing binding overlaps (actually completely covers) the requested region. > So, that said, the checker does the right t

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-18 Thread Kristóf Umann via cfe-commits
@@ -393,6 +401,173 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return stateNonNull; } +static std::optional getIndex(ProgramStateRef State, + const ElementRegion *ER, CharKind CK) { + SValBuilder &SValBuilder = St

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-18 Thread Kristóf Umann via cfe-commits
@@ -393,6 +401,173 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return stateNonNull; } +static std::optional getIndex(ProgramStateRef State, + const ElementRegion *ER, CharKind CK) { + SValBuilder &SValBuilder = St

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-18 Thread Kristóf Umann via cfe-commits
@@ -393,6 +401,173 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return stateNonNull; } +static std::optional getIndex(ProgramStateRef State, + const ElementRegion *ER, CharKind CK) { + SValBuilder &SValBuilder = St

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-18 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/95408 From d717b412749f10b45a9387044e97da6981f3cad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Thu, 25 Apr 2024 17:31:24 +0200 Subject: [PATCH 1/3] [analyzer] Check the correct first and la

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-18 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/95408 From d717b412749f10b45a9387044e97da6981f3cad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Thu, 25 Apr 2024 17:31:24 +0200 Subject: [PATCH 1/2] [analyzer] Check the correct first and la

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-18 Thread Kristóf Umann via cfe-commits
@@ -26,16 +50,12 @@ void top(char *dst) { void *mempcpy(void *restrict s1, const void *restrict s2, size_t n); -void mempcpy14() { +void mempcpy13() { Szelethus wrote: I gave sensible names to all of these test functions. https://github.com/llvm/llvm-projec

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-18 Thread Kristóf Umann via cfe-commits
@@ -393,6 +401,173 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return stateNonNull; } +static std::optional getIndex(ProgramStateRef State, + const ElementRegion *ER, CharKind CK) { + SValBuilder &SValBuilder = St

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-18 Thread Kristóf Umann via cfe-commits
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===// +// Definition of NoStreamStateChangeVisitor. +//===--

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-18 Thread Kristóf Umann via 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. https://github.com/llvm/llvm-project/pull/94957 __

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-18 Thread Kristóf Umann via cfe-commits
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

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-18 Thread Kristóf Umann via cfe-commits
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===// +// Definition of NoStreamStateChangeVisitor. +//===--

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-18 Thread Kristóf Umann via cfe-commits
@@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===// +// Definition of NoStreamStateChangeVisitor. +//===--

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-18 Thread Kristóf Umann via cfe-commits
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

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-13 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/95408 I intend to fix this checker up so that we can move it out of alpha. I made a bunch of analyses, and found many similar false positives: ```c++ int t[] = {1,2,3}; memcpy(dst, t, sizeof(t) / sizeof(t[0])); // w

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Kristóf Umann via cfe-commits
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

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-10 Thread Kristóf Umann via cfe-commits
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

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-10 Thread Kristóf Umann via cfe-commits
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

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-10 Thread Kristóf Umann via cfe-commits
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

[clang] [analyzer][NFC] Factor out NoOwnershipChangeVisitor (PR #94357)

2024-06-07 Thread Kristóf Umann via cfe-commits
@@ -0,0 +1,116 @@ +//===--*- C++ -*--// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [analyzer][NFC] Factor out NoOwnershipChangeVisitor (PR #94357)

2024-06-07 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/94357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Factor out NoOwnershipChangeVisitor (PR #94357)

2024-06-06 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus updated https://github.com/llvm/llvm-project/pull/94357 From b6beb7098bb8e5148fe0467dc976506ff6691f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Tue, 4 Jun 2024 16:15:42 +0200 Subject: [PATCH 1/2] [analyzer] Factor out NoOwnershipChangeVis

[clang] [analyzer][NFC] Factor out NoOwnershipChangeVisitor (PR #94357)

2024-06-06 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/94357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Factor out NoOwnershipChangeVisitor (PR #94357)

2024-06-06 Thread Kristóf Umann via cfe-commits
Szelethus wrote: Yes, it is, sorry about that :) https://github.com/llvm/llvm-project/pull/94357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Factor out NoOwnershipChangeVisitor (PR #94357)

2024-06-04 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/94357 In preparation for adding essentially the same visitor to StreamChecker, this patch factors this visitor out to a common header. I'll be the first to admit that the interface of these classes are not terrific

[clang] [analyzer] Use CDM::CLibrary instead of isGlobalCFunction() (PR #88267)

2024-04-10 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus approved this pull request. Seems like a very straightforward followup to the existing patches. https://github.com/llvm/llvm-project/pull/88267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [llvm] Reapply "[analyzer] Accept C library functions from the `std` namespace" again (PR #85791)

2024-03-21 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus approved this pull request. Lets hope it works fine this time around :) https://github.com/llvm/llvm-project/pull/85791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [llvm] Reapply "[analyzer] Accept C library functions from the `std` namespace" (#84926) (PR #84963)

2024-03-13 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/84963 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Accept C library functions from the `std` namespace (PR #84469)

2024-03-08 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/84469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Accept C library functions from the `std` namespace (PR #84469)

2024-03-08 Thread Kristóf Umann via cfe-commits
@@ -41,12 +41,8 @@ class CallDescription { /// - We also accept calls where the number of arguments or parameters is ///greater than the specified value. /// For the exact heuristics, see CheckerContext::isCLibraryFunction(). -/// Note that functions whose

[clang] [analyzer] Accept C library functions from the `std` namespace (PR #84469)

2024-03-08 Thread Kristóf Umann via cfe-commits
@@ -87,9 +87,11 @@ bool CheckerContext::isCLibraryFunction(const FunctionDecl *FD, if (!II) return false; - // Look through 'extern "C"' and anything similar invented in the future. - // If this function is not in TU directly, it is not a C library function. - if (!F

[clang] [analyzer] Accept C library functions from the `std` namespace (PR #84469)

2024-03-08 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus commented: Makes perfect sense to me. Can you add a testcase for `std::malloc` or something similar? https://github.com/llvm/llvm-project/pull/84469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/66481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] a504ddc - [analyzer] Initialize regions returned by CXXNew to undefined

2022-10-26 Thread Kristóf Umann via cfe-commits
Author: Kristóf Umann Date: 2022-10-26T17:22:12+02:00 New Revision: a504ddc8bf9d5c406ea88b84b8495d7aae200d4c URL: https://github.com/llvm/llvm-project/commit/a504ddc8bf9d5c406ea88b84b8495d7aae200d4c DIFF: https://github.com/llvm/llvm-project/commit/a504ddc8bf9d5c406ea88b84b8495d7aae200d4c.diff

[clang] fd8e576 - [analyzer] Don't track function calls as control dependencies

2022-04-08 Thread Kristóf Umann via cfe-commits
Author: Kristóf Umann Date: 2022-04-08T10:16:58+02:00 New Revision: fd8e5762f86f0a602ec08eea5c4c86927faba6dc URL: https://github.com/llvm/llvm-project/commit/fd8e5762f86f0a602ec08eea5c4c86927faba6dc DIFF: https://github.com/llvm/llvm-project/commit/fd8e5762f86f0a602ec08eea5c4c86927faba6dc.diff

[clang] d832078 - [analyzer] Improve NoOwnershipChangeVisitor's understanding of deallocators

2022-03-03 Thread Kristóf Umann via cfe-commits
Author: Kristóf Umann Date: 2022-03-03T11:27:56+01:00 New Revision: d832078904c6e1d26648236b9f724f699dafb201 URL: https://github.com/llvm/llvm-project/commit/d832078904c6e1d26648236b9f724f699dafb201 DIFF: https://github.com/llvm/llvm-project/commit/d832078904c6e1d26648236b9f724f699dafb201.diff

[clang] 32ac21d - [NFC][analyzer] Allow CallDescriptions to be matched with CallExprs

2022-03-01 Thread Kristóf Umann via cfe-commits
Author: Kristóf Umann Date: 2022-03-01T17:13:04+01:00 New Revision: 32ac21d04909da0d50d3b24100d5d9ab30b29a95 URL: https://github.com/llvm/llvm-project/commit/32ac21d04909da0d50d3b24100d5d9ab30b29a95 DIFF: https://github.com/llvm/llvm-project/commit/32ac21d04909da0d50d3b24100d5d9ab30b29a95.diff

  1   2   >