[clang] [NFC][analyzer][docs] Restore/remove orphaned images (PR #122481)

2025-01-10 Thread Donát Nagy via cfe-commits
NagyDonat wrote: The first two commits in this PR are separately reviewed at https://github.com/llvm/llvm-project/pull/122246 and I intend to merge them (squashed into a single commit) through that PR. **In this PR please only review the third commit [[NFC][analyzer][docs] Restore/remove orph

[clang] [clang][analyzer][doc] Migrate ClangSA www FAQ section (PR #112831)

2025-01-10 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,208 @@ +FAQ and How to Deal with Common False Positives +=== + +.. contents:: + :local: + +Custom Assertions +- + +Q: How do I tell the analyzer that I do not want the bug being reported here since my custom

[clang] [nfc][analyzer] Add MemSpace trait to program state (PR #123003)

2025-01-17 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,72 @@ +//===-- MemSpaces.cpp -*- 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: Apa

[clang] [nfc][analyzer] Add MemSpace trait to program state (PR #123003)

2025-01-17 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > The only spot I thought was questionable to change is this lower bound check > in `ArrayBoundCheckerV2`; I think it is fine to leave unchanged for now, > thoughts? > > https://github.com/llvm/llvm-project/blob/7e0758d2ead53bd4288989b8b2eda218cd6dc34a/clang/lib/StaticAnalyzer

[clang] [nfc][analyzer] Add MemSpace trait to program state (PR #123003)

2025-01-17 Thread Donát Nagy via cfe-commits
NagyDonat wrote: @Xazax-hun When you write that this commit "makes memspaces a bit more error prone to use. Do you think we could find a way to prevent using isa on memspaces?" do I understand it correctly you mean that it's error-prone to use `isa<...>(MR->getMemorySpace())` directly? This e

[clang] [NFC] [analyzer] Factor out SymbolManager::get<*> (PR #121781)

2025-01-08 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/121781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer][docs] Migrate 'annotations.html' to RST (PR #122246)

2025-01-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/122246 This commit migrates the contents of 'annotations.html' in the old HTML-based documentation of the Clang static analyzer to the new RST-based documentation. During this conversion I reordered the sections of

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/119388 From cb9b5ef4d8b0ed8e67276947525d327c547424fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 28 Nov 2024 17:22:58 +0100 Subject: [PATCH 1/9] [analyzer] Don't assume third iteration in

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > My bad. I thought I already approved this one. No problem, I didn't intend to merge this during the Christmas period (when I was on vacation and didn't want to monitor the effects of the change). > Please mention this in the release notes. I added a paragraph to the release

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/119388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/119388 From cb9b5ef4d8b0ed8e67276947525d327c547424fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 28 Nov 2024 17:22:58 +0100 Subject: [PATCH 1/8] [analyzer] Don't assume third iteration in

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
NagyDonat wrote: If I understand correctly, I handled every review suggestion. @steakhal If there are no additional suggestions, I'd be grateful for an approval. (My follow-up commit is mostly ready, I'll release it soon after merging this.) https://github.com/llvm/llvm-project/pull/119388 __

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
NagyDonat wrote: The LLVM Buildbot failure is clearly unrelated to this commit -- it seems to be a straightforward flakiness on a completely unrelated part of the project. https://github.com/llvm/llvm-project/pull/119388 ___ cfe-commits mailing list c

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/127117 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/127117 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Update the undefined assignment checker diagnostics to not use the term 'garbage' (PR #126596)

2025-02-14 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > So I'm still mildly in favor of simply saying "uninitialized". It may or may > not be someone else's actively used memory but that's beyond the programmer's > control and they know it (hopefully). It would be somewhat dishonest to give > the user an impression that this chec

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/127117 From d806869ad5f7465cb771c3d918de4add46854571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 13 Feb 2025 20:31:55 +0100 Subject: [PATCH 1/2] [analyzer] Add hack in ArrayBound to cover

[clang] [analyzer][NFC] Add ArrayBound tests to document casting bug (PR #127062)

2025-02-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/127062 From c3dc63db8914d759b6c58611b7448d4e83c66752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 13 Feb 2025 11:35:45 +0100 Subject: [PATCH 1/2] [analyzer][NFC] Add ArrayBound tests to doc

[clang] [analyzer][NFC] Add ArrayBound tests to document casting bug (PR #127062)

2025-02-13 Thread Donát Nagy via cfe-commits
@@ -194,3 +194,34 @@ char test_comparison_with_extent_symbol(struct incomplete *p) { return ((char *)p)[-1]; // no-warning } +int table[256], small_table[128]; +int test_cast_to_unsigned(signed char x) { + unsigned char y = x; + if (x >= 0) +return x; + // FIXME: Her

[clang] [NFC] [analyzer]Add ArrayBound tests to document casting bug (PR #127062)

2025-02-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/127062 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [analyzer] Add ArrayBound tests to document casting bug (PR #127062)

2025-02-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/127062 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [analyzer] Add ArrayBound tests to document casting bug (PR #127062)

2025-02-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/127062 From c3dc63db8914d759b6c58611b7448d4e83c66752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 13 Feb 2025 11:35:45 +0100 Subject: [PATCH 1/2] [analyzer][NFC] Add ArrayBound tests to doc

[clang] [NFC] [analyzer] Add ArrayBound tests to document casting bug (PR #127062)

2025-02-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/127062 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-15 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-15 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-22 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/132404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Multipart checker refactor 1: VirtualCallChecker (PR #132072)

2025-03-22 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/132072 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-20 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/132250 From d4878a62a69304dc2ae32902803f8c8efb1c69ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 20 Mar 2025 17:09:46 +0100 Subject: [PATCH 1/4] [NFC][analyzer] Multipart checker refactor

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-20 Thread Donát Nagy via cfe-commits
@@ -1394,35 +1403,34 @@ void NullabilityChecker::printState(raw_ostream &Out, ProgramStateRef State, } } -void ento::registerNullabilityBase(CheckerManager &mgr) { - mgr.registerChecker(); -} - -bool ento::shouldRegisterNullabilityBase(const CheckerManager &mgr) { - retur

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-20 Thread Donát Nagy via cfe-commits
@@ -491,7 +503,7 @@ void NullabilityChecker::reportBugIfInvariantHolds( N = C.addTransition(OriginalState, N); } - reportBug(Msg, Error, CK, N, Region, C.getBugReporter(), ValueExpr); + reportBug(Msg, Error, Idx, N, Region, C.getBugReporter(), ValueExpr); -

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-21 Thread Donát Nagy via cfe-commits
@@ -1403,6 +1403,16 @@ void NullabilityChecker::printState(raw_ostream &Out, ProgramStateRef State, } } +// The checker group "nullability" consists of the checkers that are +// implemented as the parts of the checker class `NullabilityChecker`. These +// checkers share a c

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-21 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/132250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-21 Thread Donát Nagy via cfe-commits
@@ -112,25 +112,30 @@ class NullabilityChecker void printState(raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep) const override; - enum CheckKind { -CK_NullPassedToNonnull, -CK_NullReturnedFromNonnull, -CK_NullableDerefe

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-21 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/132250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-21 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/132404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-21 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Thanks, I'm happy to see that this checker is out of alpha :smile: Please evaluate the behavior of this checker on some open source projects. (Or if you have already done an analysis with this version of the checker, then please attach a link to it.) h

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-21 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/132404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-21 Thread Donát Nagy via cfe-commits
@@ -112,25 +112,30 @@ class NullabilityChecker void printState(raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep) const override; - enum CheckKind { -CK_NullPassedToNonnull, -CK_NullReturnedFromNonnull, -CK_NullableDerefe

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-21 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat converted_to_draft https://github.com/llvm/llvm-project/pull/132250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-21 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I converted this PR to draft because I'll examine the ideas described in the inline comment https://github.com/llvm/llvm-project/pull/132250#discussion_r2007710175 . I'll probably tweak the framework based on those ideas, then revisit refactoring this checker. https://github

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-20 Thread Donát Nagy via cfe-commits
@@ -491,7 +503,7 @@ void NullabilityChecker::reportBugIfInvariantHolds( N = C.addTransition(OriginalState, N); } - reportBug(Msg, Error, CK, N, Region, C.getBugReporter(), ValueExpr); + reportBug(Msg, Error, Idx, N, Region, C.getBugReporter(), ValueExpr); -

[clang] [NFC][analyzer] Add testcase to highlight GenericTaint bug (PR #132765)

2025-03-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/132765 Currently `optin.taint.GenericTaint` can produce false positives if a [format attribute](https://clang.llvm.org/docs/AttributeReference.html#format) is applied on a non-static method. This commit adds a test

[clang] [analyzer] Fix format attribute handling in GenericTaintChecker (PR #132765)

2025-03-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat ready_for_review https://github.com/llvm/llvm-project/pull/132765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix format attribute handling in GenericTaintChecker (PR #132765)

2025-03-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/132765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Add testcase to highlight GenericTaint bug (PR #132765)

2025-03-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/132765 From f0ac1f6c223b3bfce25ba0183ba1aa2825c455ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Mon, 24 Mar 2025 16:58:31 +0100 Subject: [PATCH 1/2] [NFC][analyzer] Add testcase to highlight G

[clang] [analyzer] Fix format attribute handling in GenericTaintChecker (PR #132765)

2025-03-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/132765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Use `CheckerBase::getName` in checker option handling (PR #131612)

2025-03-17 Thread Donát Nagy via cfe-commits
@@ -39,6 +39,9 @@ class ProgramPointTag { public: ProgramPointTag(void *tagKind = nullptr) : TagKind(tagKind) {} virtual ~ProgramPointTag(); + + /// The description of this program point which will be displayed when the + /// ExplodedGraph is dumped in DOT format for debu

[clang] [NFC][analyzer] Use `CheckerBase::getName` in checker option handling (PR #131612)

2025-03-17 Thread Donát Nagy via cfe-commits
@@ -74,21 +64,6 @@ TEST(StaticAnalyzerOptions, SearchInParentPackageTests) { TEST(StaticAnalyzerOptions, StringOptions) { AnalyzerOptions Opts; Opts.Config["Outer.Inner.CheckerOne:Option"] = "StringValue"; - - struct CheckerOneMock : CheckerBase { -StringRef getTagDesc

[clang] [NFC][analyzer] Use `CheckerBase::getName` in checker option handling (PR #131612)

2025-03-17 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/131612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-16 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > I'm somewhat unsatisfied, but it's not because of this PR. This is an > excellent way forward, I just wish we had a better abstraction. I agree that the architecture that's being formalized by this commit is not perfect. If I would be reimplementing a static analyzer from z

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/131175 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,201 @@ +//===- EntryPointStats.cpp --===// +// +// 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: Apach

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -35,9 +35,10 @@ class DivZeroChecker : public Checker> { public: /// This checker class implements several user facing checkers enum CheckKind { CK_DivideZero, CK_TaintedDivChecker, CK_NumCheckKinds }; - bool ChecksEnabled[CK_NumCheckKinds] = {false}; - CheckerNameRef

[clang] [analyzer] Remove deprecated option VirtualCall:PureOnly (PR #131823)

2025-03-18 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I added a note to the Release Notes. Is "Improvements" the right subsection for this? https://github.com/llvm/llvm-project/pull/131823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [analyzer] Remove deprecated option VirtualCall:PureOnly (PR #131823)

2025-03-18 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/131823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Document the VirtualCall checkers (PR #131861)

2025-03-18 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/131861 This commit documents `cplusplus.PureVirtualCall` (which was previously completely undocumented) and improves the documentation of `optin.cplusplus.VirtualCall` (which was very barebones). Note that in this

[clang] [analyzer] Remove deprecated option VirtualCall:PureOnly (PR #131823)

2025-03-18 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/131823 From da3f8f4aa90cb077eb9b65896f65ea9c9775d01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Tue, 18 Mar 2025 13:55:04 +0100 Subject: [PATCH 1/3] [analyzer] Remove deprecated option Virtual

[clang] [analyzer] Remove deprecated option VirtualCall:PureOnly (PR #131823)

2025-03-18 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/131823 From da3f8f4aa90cb077eb9b65896f65ea9c9775d01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Tue, 18 Mar 2025 13:55:04 +0100 Subject: [PATCH 1/2] [analyzer] Remove deprecated option Virtual

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-17 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Multipart checker refactor 1: VirtualCallChecker (PR #132072)

2025-03-19 Thread Donát Nagy via cfe-commits
@@ -694,15 +694,11 @@ def MoveChecker: Checker<"Move">, ]>, Documentation; -def VirtualCallModeling : Checker<"VirtualCallModeling">, - HelpText<"Auxiliary modeling for the virtual method call checkers">, - Documentation, - Hidden; - -def PureVirtualCallChecker : Checke

[clang] [NFC][analyzer] Correct example code in VirtualCall docs (PR #131992)

2025-03-19 Thread Donát Nagy via cfe-commits
NagyDonat wrote: (This is a really trivial fixup commit, so I decided to merge it without review. Feel free to suggest additional changes in the example code or elsewhere if you feel that something is still missing.) https://github.com/llvm/llvm-project/pull/131992

[clang] [NFC][analyzer] Document the VirtualCall checkers (PR #131861)

2025-03-19 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/131861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Correct example code in VirtualCall docs (PR #131992)

2025-03-19 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/131992 Oops, I noticed these just after merging my commit 9762b8e1757601a719d926f7df77c207617adfdd. From 390cadac0d98d90a802cf3520a4891e39953eead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: W

[clang] [analyzer] Remove deprecated option VirtualCall:PureOnly (PR #131823)

2025-03-19 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/131823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Multipart checker refactor 1: VirtualCallChecker (PR #132072)

2025-03-19 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/132072 From f4e583ff179faf03b571cbd0091af404e5c2d5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Tue, 18 Mar 2025 13:44:19 +0100 Subject: [PATCH 1/2] [NFC][analyzer] Multipart checker refactor

[clang] [NFC][analyzer] Multipart checker refactor 1: VirtualCallChecker (PR #132072)

2025-03-19 Thread Donát Nagy via cfe-commits
@@ -42,8 +42,14 @@ namespace { class VirtualCallChecker : public Checker { public: - // These are going to be null if the respective check is disabled. - mutable std::unique_ptr BT_Pure, BT_Impure; + enum : CheckerPartIdx { PureChecker, ImpureChecker, NumCheckerParts };

[clang] [NFC][analyzer] Multipart checker refactor 1: VirtualCallChecker (PR #132072)

2025-03-19 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/132072 Simplify `VirtualCallChecker.cpp` with the help of the new framework for multipart checkers that was introduced by commit 27099982da2f5a6c2d282d6b385e79d080669546. This is part of a commit series that will pe

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-04-05 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/132250 From d4878a62a69304dc2ae32902803f8c8efb1c69ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 20 Mar 2025 17:09:46 +0100 Subject: [PATCH 1/3] [NFC][analyzer] Multipart checker refactor

[clang] [analyzer] Remove deprecated option VirtualCall:PureOnly (PR #131823)

2025-04-05 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/131823 VirtualCallChecker.cpp implements two related checkers: - `optin.cplusplus.VirtualCall` which reports situations when constructors or destructors call virtual methods (which is bugprone because it does not tr

[clang] [NFC][analyzer] Use `CheckerBase::getName` in checker option handling (PR #131612)

2025-04-05 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/131612 ___ 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 check bugprone-misleading-setter-of-reference (PR #132242)

2025-03-25 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,58 @@ +//===--- MisleadingSetterOfReferenceCheck.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: Apa

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-03-25 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Overall looks good to me; see inline comments for minor inline suggestions. https://github.com/llvm/llvm-project/pull/132242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-03-25 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,42 @@ +.. title:: clang-tidy - bugprone-misleading-setter-of-reference + +bugprone-misleading-setter-of-reference +=== + +Finds setter-like functions that take a pointer parameter and set a (non-const) +reference with the pointed valu

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-03-25 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/132242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/132250 Simplify `NullabilityChecker.cpp` with new multipart checker framework introduced in 27099982da2f5a6c2d282d6b385e79d080669546. This is part of a commit series that will perform analogous changes in all checke

[clang] [analyzer] Fix format attribute handling in GenericTaintChecker (PR #132765)

2025-03-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/132765 From f0ac1f6c223b3bfce25ba0183ba1aa2825c455ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Mon, 24 Mar 2025 16:58:31 +0100 Subject: [PATCH 1/3] [NFC][analyzer] Add testcase to highlight G

[clang] [analyzer] Fix format attribute handling in GenericTaintChecker (PR #132765)

2025-03-26 Thread Donát Nagy via cfe-commits
@@ -161,3 +161,45 @@ void top() { clang_analyzer_isTainted(A.data); // expected-warning {{YES}} } } // namespace gh114270 + + +namespace format_attribute { +__attribute__((__format__ (__printf__, 1, 2))) +void log_nonmethod(const char *fmt, ...); + +void test_format_attribute

[clang] [analyzer] Fix format attribute handling in GenericTaintChecker (PR #132765)

2025-03-26 Thread Donát Nagy via cfe-commits
@@ -161,3 +161,45 @@ void top() { clang_analyzer_isTainted(A.data); // expected-warning {{YES}} } } // namespace gh114270 + + +namespace format_attribute { +__attribute__((__format__ (__printf__, 1, 2))) +void log_nonmethod(const char *fmt, ...); NagyDonat wr

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-27 Thread Donát Nagy via cfe-commits
@@ -97,6 +97,41 @@ core.DivideZero (C, C++, ObjC) .. literalinclude:: checkers/dividezero_example.c :language: c +.. _core-FixedAddressDereference: + +core.FixedAddressDereference (C, C++, ObjC) +""" +Check for dereferences of fixed

[clang] [NFC][analyzer] Document configuration options (PR #135169)

2025-04-10 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/135169 This commit documents the process of specifying values for the analyzer options and checker options implemented in the static analyzer, and adds a script which includes the documentation of the analyzer optio

[clang] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-03-28 Thread Donát Nagy via cfe-commits
@@ -112,25 +112,30 @@ class NullabilityChecker void printState(raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep) const override; - enum CheckKind { -CK_NullPassedToNonnull, -CK_NullReturnedFromNonnull, -CK_NullableDerefe

[clang] [analyzer] Fix format attribute handling in GenericTaintChecker (PR #132765)

2025-03-28 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/132765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/133381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,162 @@ +// EntryPointStats.h - Tracking statistics per entry point -*- 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: Apache-2.0

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Thanks for contributing infrastructural improvements like this; these will be helpful in the analyzer development. Overall I'm satisfied with the idea of this commit; but I marked a few typos and stylistic suggestions in inline comments. https://github.

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-15 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,27 @@ +=== +Analysis Statistics +=== + +CSA enjoys two facilities to collect statistics: per translation unit and per entry point. +We use llvm/ADT/Statistic.h for numbers describing the entire translation unit (TU). +We use clang/Stati

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-15 Thread Donát Nagy via cfe-commits
NagyDonat wrote: The reason why I the support for multiple `RegisteredNames` instead of a single `Name` is directly introduced within `CheckerBase` is that this significantly simplifies the implementation. [1] However if you wish so I could easily introduce a `static_assert` which ensures tha

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-15 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,201 @@ +//===- EntryPointStats.cpp --===// +// +// 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: Apach

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-15 Thread Donát Nagy via cfe-commits
@@ -35,9 +35,10 @@ class DivZeroChecker : public Checker> { public: /// This checker class implements several user facing checkers enum CheckKind { CK_DivideZero, CK_TaintedDivChecker, CK_NumCheckKinds }; - bool ChecksEnabled[CK_NumCheckKinds] = {false}; - CheckerNameRef

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-15 Thread Donát Nagy via cfe-commits
@@ -353,6 +353,12 @@ ANALYZER_OPTION(bool, DisplayCTUProgress, "display-ctu-progress", "the analyzer's progress related to ctu.", false) +ANALYZER_OPTION( +StringRef, DumpSEStatsToCSV, "dump-se-stats-to-csv", NagyDonat wrot

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -190,23 +203,38 @@ class CheckerManager { // Checker registration. //======// - /// Used to register checkers. - /// All arguments are automatically passed through to the checker - /// constructor.

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/130985 From 895b6947690ec51d8e8bccfa09420afae4449343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Mon, 3 Mar 2025 15:33:44 +0100 Subject: [PATCH 1/7] [NFC][analyzer] Framework for multipart chec

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -116,6 +116,19 @@ class CheckerNameRef { operator StringRef() const { return Name; } }; +/// A single checker class (and its singleton instance) can act as the +/// implementation of several (user-facing or modeling) checker parts that +/// have shared state and logic, bu

<    5   6   7   8   9   10   11   12   13   14   >