[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-tools-extra] [clang-tidy] `matchesAnyListedTypeName` support non canonical types (PR #134869)

2025-04-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. https://github.com/llvm/llvm-project/pull/134869 ___ 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-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] [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] 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] [NFC][analyzer] Multipart checker refactor 2: NullabilityChecker (PR #132250)

2025-04-04 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] [analyzer] Unknown array lvalue element in Store (PR #133381)

2025-03-31 Thread Donát Nagy via cfe-commits
@@ -511,13 +511,9 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, // Only allow non-integer offsets if the base region has no offset itself. // FIXME: This is a somewhat arbitrary restriction. We should be using // SValBuilder here to add the

[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] [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] 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] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,146 @@ +//===- LValueElementTest.cpp ---===// NagyDonat wrote: I feel that creating a full unittest is overkill for this job, and it would be much more concise to specify these testcases as a lit test that uses `debug.

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

2025-03-28 Thread Donát Nagy via cfe-commits
@@ -39,14 +39,9 @@ int assumingBothPointerToMiddle(int arg) { // will speak about the "byte offset" measured from the beginning of the TenElements. int *p = TenElements + 2; int a = p[arg]; - // FIXME: The following note does not appear: - // {{Assuming byte offset is

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

2025-03-28 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I'm really happy to see a fix for this weakness of the static analyzer, and overall I'm satisfied with the commit, but I didn't have time to think about the implications of this change (and picking the right representation: nested `ElementRegion`s vs a s

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

2025-03-28 Thread Donát Nagy via cfe-commits
@@ -511,13 +511,9 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, // Only allow non-integer offsets if the base region has no offset itself. // FIXME: This is a somewhat arbitrary restriction. We should be using // SValBuilder here to add the

[clang] [analyzer] Add metrics tracking time spent in Z3 solver (PR #133236)

2025-03-28 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM. I'm a bit surprised to see that you're excluding the retries from this measurement (I feel that measuring the total time would be a more "natural" statistic), but if you're interested in this information, then there is no reason t

[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] 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
@@ -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] [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-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
@@ -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-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] [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] [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] [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] [clang][scan-build] Treat --use-cc and --use-c++ as shell commands (PR #131932)

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

[clang] [clang][scan-build] Treat --use-cc and --use-c++ as shell commands (PR #131932)

2025-03-24 Thread Donát Nagy via cfe-commits
@@ -51,63 +51,40 @@ sub silent_system { # Compiler command setup. ##===--===## -# Search in the PATH if the compiler exists -sub SearchInPath { -my $file = shift; -foreach my $dir (split (':', $ENV{PA

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

2025-03-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. I think the results are good enough to merge this -- a handful of false positives is negligible compared to other checkers. (This checker detects a severe bug, so it's natural that we don't see true positives on stable versions of open s

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

2025-03-24 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][scan-build] Treat --use-cc and --use-c++ as shell commands (PR #131932)

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

[clang] [clang][scan-build] Treat --use-cc and --use-c++ as shell commands (PR #131932)

2025-03-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Overall I'm satisfied with the direction of the commit and I agree that explicitly specifying an invalid compiler should be a hard error. (I could also accept a warning as long as it's loud and visible, but the current "silently use the

[clang] [clang][scan-build] Treat --use-cc and --use-c++ as shell commands (PR #131932)

2025-03-24 Thread Donát Nagy via cfe-commits
@@ -51,63 +51,40 @@ sub silent_system { # Compiler command setup. ##===--===## -# Search in the PATH if the compiler exists -sub SearchInPath { -my $file = shift; -foreach my $dir (split (':', $ENV{PA

[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-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-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
@@ -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] [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
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] [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-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-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-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
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
@@ -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 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] 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 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 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] [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] Correct example code in VirtualCall docs (PR #131992)

2025-03-19 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/131992 ___ 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
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] 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] [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] [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] [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] [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 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] [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] [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
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] 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
@@ -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
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/131612 The virtual method `ProgramPointTag::getTagDescription` had two very distinct use cases: - It is printed in the DOT graph visualization of the exploded graph (that is, a debug printout). - The checker option

[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] 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-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
@@ -190,23 +203,38 @@ class CheckerManager { // Checker registration. //======// - /// Used to register checkers. - /// All arguments are automatically passed through to the checker - /// constructor.

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

2025-03-15 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,162 @@ +// EntryPointStats.h - Tracking statistics per entry point -*- C++ -*-// NagyDonat wrote: ```suggestion // EntryPointStats.h - Tracking statistics per entry point --*- C++ -*-// ``` Just a doubled space. https://github.com/llvm/llvm-project/p

[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
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
@@ -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] [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] [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
@@ -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] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-15 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] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-15 Thread Donát Nagy via cfe-commits
@@ -12,3 +12,4 @@ Contents: developer-docs/nullability developer-docs/RegionStore developer-docs/PerformanceInvestigation + developer-docs/Statistics NagyDonat wrote: I am really happy that you're also adding a documentation page for this :smile: h

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

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -485,16 +485,60 @@ class Call { } // end eval namespace class CheckerBase : public ProgramPointTag { - CheckerNameRef Name; + /// A single checker class (i.e. a subclass of `CheckerBase`) can implement + /// multiple user-facing checkers that have separate names and can

[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] Introduce per-entry-point statistics (PR #131175)

2025-03-14 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-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 01/10] [NFC][analyzer] Framework for multipart ch

[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 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/9] [NFC][analyzer] Framework for multipart chec

[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] [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] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 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-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

[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
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
@@ -190,23 +203,38 @@ class CheckerManager { // Checker registration. //======// - /// Used to register checkers. - /// All arguments are automatically passed through to the checker - /// constructor.

  1   2   3   4   5   6   7   8   9   10   >