[clang] [StaticAnalyzer] Handle `__builtin_bit_cast` (PR #139188)

2025-05-12 Thread Donát Nagy via cfe-commits
@@ -285,15 +285,43 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, ExplodedNodeSet dstPreStmt; getCheckerManager().runCheckersForPreStmt(dstPreStmt, Pred, CastE, *this); - if (CastE->getCastKind() == CK_LValueToRValue || - CastE->getCastKind() =

[clang] [StaticAnalyzer] Handle `__builtin_bit_cast` (PR #139188)

2025-05-09 Thread Donát Nagy via cfe-commits
@@ -285,15 +285,43 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, ExplodedNodeSet dstPreStmt; getCheckerManager().runCheckersForPreStmt(dstPreStmt, Pred, CastE, *this); - if (CastE->getCastKind() == CK_LValueToRValue || - CastE->getCastKind() =

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

2025-05-12 Thread Donát Nagy via cfe-commits
@@ -143,6 +143,32 @@ if (LLVM_ENABLE_SPHINX) gen_rst_file_from_td(DiagnosticsReference.rst -gen-diag-docs ../include/clang/Basic/Diagnostic.td "${docs_targets}") gen_rst_file_from_td(ClangCommandLineReference.rst -gen-opt-docs ../include/clang/Driver/ClangOptionDocs.td

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

2025-05-12 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,102 @@ + +Configuring the Analyzer + + +The clang static analyzer supports two kinds of options: + +1. Global **analyzer options** influence the behavior of the analyzer engine. + They are documented on this page, in the

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

2025-05-12 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,102 @@ + +Configuring the Analyzer + + +The clang static analyzer supports two kinds of options: + +1. Global **analyzer options** influence the behavior of the analyzer engine. + They are documented on this page, in the

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

2025-05-12 Thread Donát Nagy via cfe-commits
@@ -143,6 +143,32 @@ if (LLVM_ENABLE_SPHINX) gen_rst_file_from_td(DiagnosticsReference.rst -gen-diag-docs ../include/clang/Basic/Diagnostic.td "${docs_targets}") gen_rst_file_from_td(ClangCommandLineReference.rst -gen-opt-docs ../include/clang/Driver/ClangOptionDocs.td

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

2025-05-12 Thread Donát Nagy via cfe-commits
NagyDonat wrote: @steakhal Gentle ping. https://github.com/llvm/llvm-project/pull/135169 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-12 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,242 @@ +#!/usr/bin/env python3 +# A tool to automatically generate documentation for the config options of the +# clang static analyzer by reading `AnalyzerOptions.def`. + +import argparse +from collections import namedtuple +from enum import Enum, auto +import re +impo

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

2025-05-12 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,242 @@ +#!/usr/bin/env python3 +# A tool to automatically generate documentation for the config options of the +# clang static analyzer by reading `AnalyzerOptions.def`. + +import argparse +from collections import namedtuple +from enum import Enum, auto +import re +impo

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

2025-05-12 Thread Donát Nagy via cfe-commits
@@ -7,6 +7,9 @@ //===--===// // // This file defines the analyzer options avaible with -analyzer-config. +// Note that clang/docs/tools/generate_analyzer_options_docs.py relies on the +// structure of this

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/139256 The checker classes (i.e. classes derived from `CheckerBase` via the utility template `Checker<...>`) act as intermediates between the user and the analyzer engine, so they have two interfaces: - On the front

[clang] [StaticAnalyzer] Handle `__builtin_bit_cast` (PR #139188)

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

[clang] [StaticAnalyzer] Handle `__builtin_bit_cast` (PR #139188)

2025-05-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Overall LGTM, thanks for fixing this crash! I dropped one (somewhat paranoid) inline question. Moreover, I would suggest following the [coding standard](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly)

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-09 Thread Donát Nagy via cfe-commits
@@ -581,6 +585,20 @@ class EventDispatcher { } }; +/// Tag that can use a checker name as a message provider +/// (see SimpleProgramPointTag). +/// FIXME: This is a cargo cult class which is copied into several checkers but +/// does not provide anything useful. +/// The onl

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -3411,12 +3411,12 @@ PathSensitiveBugReporter::generateDiagnosticForConsumerMap( } void BugReporter::EmitBasicReport(const Decl *DeclWithIssue, - const CheckerBase *Checker, StringRef Name, + const CheckerFr

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/139256 From 3bead14691a29482705c76951eaed176bfbfc996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 8 May 2025 18:46:41 +0200 Subject: [PATCH 1/2] [analyzer][NFC] Introduce framework for chec

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -3411,12 +3411,12 @@ PathSensitiveBugReporter::generateDiagnosticForConsumerMap( } void BugReporter::EmitBasicReport(const Decl *DeclWithIssue, - const CheckerBase *Checker, StringRef Name, + const CheckerFr

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -50,11 +50,11 @@ bool CheckerManager::hasPathSensitiveCheckers() const { } void CheckerManager::reportInvalidCheckerOptionValue( -const CheckerBase *C, CheckerPartIdx Idx, StringRef OptionName, +const CheckerFrontend *CP, StringRef OptionName, NagyD

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -56,11 +54,11 @@ static const Expr *getDenomExpr(const ExplodedNode *N) { void DivZeroChecker::reportBug(StringRef Msg, ProgramStateRef StateZero, CheckerContext &C) const { - if (!isPartEnabled(DivideZeroChecker)) + if (!DivideZeroChecker.i

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

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,286 @@ +#!/usr/bin/env python3 +# A tool to automatically generate documentation for the config options of the +# clang static analyzer by reading `AnalyzerOptions.def`. + +import argparse +from collections import namedtuple +from enum import Enum, auto +import re +impo

[clang] [analyzer] Workaround for slowdown spikes (unintended scope increase) (PR #136720)

2025-05-12 Thread Donát Nagy via cfe-commits
NagyDonat wrote: This is not an automatic "every project is affected" slowdown, but on smaller outlier projects like tmux the runtime may double, so I'd guess that it's reasonable to backport this commit (although I'm not familiar with the exact conditions when a commit should be backported).

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

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

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I handled all the inline comments. I have one minor architectural question: we should standardize a way to assign a single tag description (that is, identifiers that can be used in debug dumps) to each checker family. The old code automatically used the name of the first chec

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

2025-05-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/135169 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

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

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

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

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,286 @@ +#!/usr/bin/env python3 +# A tool to automatically generate documentation for the config options of the +# clang static analyzer by reading `AnalyzerOptions.def`. + +import argparse +from collections import namedtuple +from enum import Enum, auto +import re +impo

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

2025-05-13 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > Sorry for my delay. I missed the review request. No problem, happens with anyone :smile: https://github.com/llvm/llvm-project/pull/135169 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -64,9 +65,9 @@ class CheckerFn { Func Fn; public: - CheckerBase *Checker; + CheckerBackend *Checker; - CheckerFn(CheckerBase *checker, Func fn) : Fn(fn), Checker(checker) {} + CheckerFn(CheckerBackend *checker, Func fn) : Fn(fn), Checker(checker) {}

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/139256 From 3bead14691a29482705c76951eaed176bfbfc996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 8 May 2025 18:46:41 +0200 Subject: [PATCH 1/3] [analyzer][NFC] Introduce framework for chec

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

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

[clang] [analyzer] Workaround for slowdown spikes (unintended scope increase) (PR #136720)

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

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -25,25 +25,23 @@ using namespace ento; using namespace taint; namespace { -class DivZeroChecker : public Checker> { +class DivZeroChecker : public CheckerFamily> { void reportBug(StringRef Msg, ProgramStateRef StateZero, CheckerContext &C) const; voi

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -56,11 +54,11 @@ static const Expr *getDenomExpr(const ExplodedNode *N) { void DivZeroChecker::reportBug(StringRef Msg, ProgramStateRef StateZero, CheckerContext &C) const { - if (!isPartEnabled(DivideZeroChecker)) + if (!DivideZeroChecker.i

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

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -227,8 +263,11 @@ def get_option_list(input_file): p = argparse.ArgumentParser() p.add_argument("--options-def", help="path to AnalyzerOptions.def") -p.add_argument("--template", help="path of template file") -p.add_argument("--out", help="path of output file") +p.add_argum

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

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,115 @@ + +Configuring the Analyzer + + +The clang static analyzer supports two kinds of options: + +1. Global **analyzer options** influence the behavior of the analyzer engine. + They are documented on this page, in the

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Donát Nagy via cfe-commits
@@ -25,25 +25,23 @@ using namespace ento; using namespace taint; namespace { -class DivZeroChecker : public Checker> { +class DivZeroChecker : public CheckerFamily> { void reportBug(StringRef Msg, ProgramStateRef StateZero, CheckerContext &C) const; voi

[clang] [WIP][analyzer] Refactor `ExplodedGraph::trim()` (PR #139939)

2025-05-16 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I started a measurement on open source projects to see the effect of this change on the (total) analysis runtime. I don't expect much but if this turns out to be non-negligible, then I will prioritize this direction. https://github.com/llvm/llvm-project/pull/139939 ___

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-16 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > I think the order is deterministic, and due to how checker dependencies are > resolved, the backend checker would be always the one that is registered > first. I have not checked this. You're correct wrt the current state of the code but I'm planning to get rid of many "bac

[clang] [WIP][analyzer] Refactor `ExplodedGraph::trim()` (PR #139939)

2025-05-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/139939 ...because its implementation was using a complicated two-pass graph traversal while in fact one pass is sufficient for performing that trimming operation. Note that this commit changes the interface of `trim

[clang] [WIP][analyzer] Refactor `ExplodedGraph::trim()` (PR #139939)

2025-05-14 Thread Donát Nagy via cfe-commits
NagyDonat wrote: This is the cleanup of `ExplodedGraph::trim()` that I promised at https://github.com/llvm/llvm-project/commit/31e981ca1dc323c8a32012cb60a0a8fe3985db1a. This significantly simplifies the algorithm and should be equivalent in a theoretical sense, but unfortunately it changes the

[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one roots (PR #139903)

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

[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one roots (PR #139903)

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

[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one root (PR #139903)

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

[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one roots (PR #139903)

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

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

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

[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one root (PR #139903)

2025-05-14 Thread Donát Nagy via cfe-commits
@@ -46,8 +46,9 @@ void AnalyzerStatsChecker::checkEndAnalysis(ExplodedGraph &G, llvm::SmallPtrSet reachable; // Root node should have the location context of the top most function. - const ExplodedNode *GraphRoot = *G.roots_begin(); - const LocationContext *LC = GraphRoo

[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one root (PR #139903)

2025-05-14 Thread Donát Nagy via cfe-commits
NagyDonat wrote: (By the way, the commit message `Use` intended to be ```Use `getRootLocationContext()` ``` but the shell evaluated the backticks.) https://github.com/llvm/llvm-project/pull/139903 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one root (PR #139903)

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

[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one root (PR #139903)

2025-05-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/139903 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

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

2025-05-14 Thread Donát Nagy via cfe-commits
NagyDonat wrote: This change only affects the documentation, the C++ assertion failure detected by the buildbot is completely unrelated. https://github.com/llvm/llvm-project/pull/135169 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

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

2025-05-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/135169 From 705372a8a2f6e87f5fdf6b0e99bfa6a13408c5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 3 Apr 2025 20:13:04 +0200 Subject: [PATCH 01/10] [NFC][analyzer] Document configuration opt

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

2025-05-14 Thread Donát Nagy via cfe-commits
NagyDonat wrote: If I'm not mistaken I handled every review comment. Thanks for all the useful suggestions! https://github.com/llvm/llvm-project/pull/135169 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

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

2025-05-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/135169 From 705372a8a2f6e87f5fdf6b0e99bfa6a13408c5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 3 Apr 2025 20:13:04 +0200 Subject: [PATCH 01/11] [NFC][analyzer] Document configuration opt

[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one roots (PR #139903)

2025-05-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/139903 Previously the class `ExplodedGraph` had a data member called `Roots` which could (in theory) store multiple root nodes -- but in practice exploded graphs always had at most one root node (zero was possible f

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

2025-05-14 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,286 @@ +#!/usr/bin/env python3 +# A tool to automatically generate documentation for the config options of the +# clang static analyzer by reading `AnalyzerOptions.def`. + +import argparse +from collections import namedtuple +from enum import Enum, auto +import re +impo

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

2025-05-14 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,286 @@ +#!/usr/bin/env python3 +# A tool to automatically generate documentation for the config options of the +# clang static analyzer by reading `AnalyzerOptions.def`. + +import argparse +from collections import namedtuple +from enum import Enum, auto +import re +impo

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

2025-05-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/135169 From 705372a8a2f6e87f5fdf6b0e99bfa6a13408c5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 3 Apr 2025 20:13:04 +0200 Subject: [PATCH 1/9] [NFC][analyzer] Document configuration optio

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-17 Thread Donát Nagy via cfe-commits
NagyDonat wrote: ## Accommodating the modeling checkers in the checker family framework _I thought a bit about the place of the modeling checkers in the checker family framework (which is introduced in this PR). This question is a bit architectural, so in theory this post would "belong to" dis

[clang] [WIP][analyzer] Refactor `ExplodedGraph::trim()` (PR #139939)

2025-05-17 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > RT is not a concern to me in this case. The reason why I decided to check the runtime is because you said that "It not only simplifies it but also makes if faster. " in an earlier commit. My first runtime measurement finished and unfortunately it seems that this PR somehow

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-17 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM if you implement the changes suggested by EugeneZelenko. https://github.com/llvm/llvm-project/pull/140086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-17 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > I'd recommend you to look at the `Checkers.inc` file in the build folder > somewhere - the file that gets generated from the `Checkers.td`. Notice that > every checker has a `registerXXX` and `shouldRegisterXXX` function where XXX > is the verbatim spelling of the checker cl

[clang] [analyzer][NFC] Move PrettyStackTraceLocationContext into dispatchWorkItem (PR #140035)

2025-05-20 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM. I'm happy to see that this change simplifies the logic and moves several scattered stacktrace helpers to a common location. https://github.com/llvm/llvm-project/pull/140035 ___ cfe-commits

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-20 Thread Donát Nagy via cfe-commits
@@ -115,9 +115,22 @@ class CheckerRegistry { public: /// Adds a checker to the registry. Use this non-templated overload when your /// checker requires custom initialization. - void addChecker(RegisterCheckerFn Fn, ShouldRegisterFunction sfn, + void addChecker(RegisterChe

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-20 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/139256 From 3bead14691a29482705c76951eaed176bfbfc996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 8 May 2025 18:46:41 +0200 Subject: [PATCH 01/12] [analyzer][NFC] Introduce framework for ch

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-20 Thread Donát Nagy via cfe-commits
@@ -115,9 +115,22 @@ class CheckerRegistry { public: /// Adds a checker to the registry. Use this non-templated overload when your /// checker requires custom initialization. - void addChecker(RegisterCheckerFn Fn, ShouldRegisterFunction sfn, + void addChecker(RegisterChe

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

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

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-20 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I have yet another implementation idea where: - boilerplate is either minimal or nonexistent; - there is no need to pass an additional string value (the debug name) through the checker registry code; - the debug name is guaranteed to be the same as the class name. The minimal-b

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

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

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-20 Thread Donát Nagy via cfe-commits
@@ -115,9 +115,22 @@ class CheckerRegistry { public: /// Adds a checker to the registry. Use this non-templated overload when your /// checker requires custom initialization. - void addChecker(RegisterCheckerFn Fn, ShouldRegisterFunction sfn, + void addChecker(RegisterChe

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-20 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > I'm happy as this PR looks right now, except for having that backward > compatibility overload for plugins. > We can just move on with life and let them migrate once the next clang is > out. To me, the upgrade path looks straightforward and this isn't the only > API they wil

[clang] [analyzer] Add previous CFG block to BlockEntrance ProgramPoints (PR #140861)

2025-05-21 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. https://github.com/llvm/llvm-project/pull/140861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add previous CFG block to BlockEntrance ProgramPoints (PR #140861)

2025-05-21 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: LGTM, straightforward simple extension. https://github.com/llvm/llvm-project/pull/140861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][analyzer] Refactor `ExplodedGraph::trim()` (PR #139939)

2025-05-19 Thread Donát Nagy via cfe-commits
NagyDonat wrote: You're right, repeating the same measurement produced significantly different results: | Project | before this PR | this PR | Ratio | | --- | --- | --- | --- | | memcached | 25.70 | 28.12 | 109.4% | | tmux | 74.18 | 74.30 | 100.2% | | curl | 219.55 | 217.06 | 98.9% | | twin | 5

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-19 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > First, let's align on why we currently have the concept of "modeling" and > "reporting" checkers. I think you are probably already aware of this, but > let's clarify this. > > It's a great property if the exploded graph remains sort of the same no > matter what checkers are

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-19 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/139256 From 3bead14691a29482705c76951eaed176bfbfc996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 8 May 2025 18:46:41 +0200 Subject: [PATCH 01/11] [analyzer][NFC] Introduce framework for ch

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-19 Thread Donát Nagy via cfe-commits
NagyDonat wrote: In commit https://github.com/llvm/llvm-project/pull/139256/commits/13f4a3011e76c5665ca295ef597eb130f356df68 I implemented your suggestion that the debug name of the checker name should be derived from the name fragment of the registration functions (which is called `CLASS` bu

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

2025-05-27 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: @steakhal Thanks for the updates, I'm completely satisfied with them. I don't see any connection between this commit and the buildbot failures :thinking: ... they are probably unrelated. https://github.com/llvm/llvm-project/pull/140924 __

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-26 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I reverted this PR to an earlier stage and added a more verbose explanation for the (current) requirement that classes derived from `CheckerFamily` need to override `getTagDescription`. @steakhal In addition to the other changes, I also reverted commit https://github.com/llv

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

2025-05-26 Thread Donát Nagy via cfe-commits
@@ -166,6 +179,23 @@ class CheckerDocumentation /// check::Bind void checkBind(SVal Loc, SVal Val, const Stmt *S, CheckerContext &) const {} + /// Called after a CFG edge is taken within a function. + /// + /// This callback can be used to obtain information about poten

[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)

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

[clang] [NFC][analyzer] Rename getTagDescription to getDebugName (PR #141511)

2025-05-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/141511 None From e19773f3a1c52213ec1afe5329c2715b6119ed33 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Thu, 15 May 2025 19:44:55 +0200 Subject: [PATCH] [NFC][analyzer] Rename getTagDescription to getDebugName

[clang] [NFC][analyzer] Rename getTagDescription to getDebugName (PR #141511)

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

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

2025-05-26 Thread Donát Nagy via cfe-commits
@@ -548,6 +564,8 @@ class CheckerProgramPointTag : public SimpleProgramPointTag { template class Checker : public CHECK1, public CHECKs..., public CheckerBase { public: + using BlockEntrance = clang::BlockEntrance; NagyDonat wrote: > As I was thinking about

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

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

[clang] [NFC][analyzer] Rename getTagDescription to getDebugName (PR #141511)

2025-05-26 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > In hind sight, maybe "debugTag" is the best of both worlds. WDYT? Why not :smile: ? https://github.com/llvm/llvm-project/pull/141511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [NFC][analyzer] Rename getTagDescription to getDebugName (PR #141511)

2025-05-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/141511 From e19773f3a1c52213ec1afe5329c2715b6119ed33 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Thu, 15 May 2025 19:44:55 +0200 Subject: [PATCH 1/2] [NFC][analyzer] Rename getTagDescription to getDebugName -

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

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

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

2025-05-26 Thread Donát Nagy via cfe-commits
@@ -166,6 +179,23 @@ class CheckerDocumentation /// check::Bind void checkBind(SVal Loc, SVal Val, const Stmt *S, CheckerContext &) const {} + /// Called after a CFG edge is taken within a function. + /// + /// This callback can be used to obtain information about poten

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

2025-05-26 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,357 @@ +//===- unittests/StaticAnalyzer/BlockEntranceCallbackTest.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: Ap

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

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

[clang] [NFC][analyzer] Rename getTagDescription to getDebugName (PR #141511)

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

[clang] [NFC][analyzer] Rename getTagDescription to getDebugName (PR #141511)

2025-05-26 Thread Donát Nagy via cfe-commits
NagyDonat wrote: Oops, forgot to update the title before merging, so it still refers to `getDebugName` :sweat: https://github.com/llvm/llvm-project/pull/141511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

2025-05-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. I also read the tests and the change LGTM if you move the explanations from the very helpful review comments https://github.com/llvm/llvm-project/pull/140924/files#r2107471659 and https://github.com/llvm/llvm-project/pull/140924/files#r2

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

2025-05-26 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,357 @@ +//===- unittests/StaticAnalyzer/BlockEntranceCallbackTest.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: Ap

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

2025-05-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I finished reviewing the non-test code and overall it LGTM, but I added two minor questions as inline comments. I'll review the tests tomorrow. https://github.com/llvm/llvm-project/pull/140924 ___ cfe-commits ma

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

2025-05-26 Thread Donát Nagy via cfe-commits
@@ -548,6 +564,8 @@ class CheckerProgramPointTag : public SimpleProgramPointTag { template class Checker : public CHECK1, public CHECKs..., public CheckerBase { public: + using BlockEntrance = clang::BlockEntrance; NagyDonat wrote: Why is this `using` requi

[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

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

[clang] [WIP][analyzer] Refactor `ExplodedGraph::trim()` (PR #139939)

2025-05-15 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/139939 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

[clang] [WIP][analyzer] Refactor `ExplodedGraph::trim()` (PR #139939)

2025-05-15 Thread Donát Nagy via cfe-commits
@@ -442,109 +442,65 @@ std::unique_ptr ExplodedGraph::trim(ArrayRef Sinks, InterExplodedGraphMap *ForwardMap, InterExplodedGraphMap *InverseMap) const { - // FIXME: The two-pass algorithm of this function (which was introduced in - // 2

[clang] [WIP][analyzer] Refactor `ExplodedGraph::trim()` (PR #139939)

2025-05-15 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/139939 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

<    8   9   10   11   12   13   14   15   16   >