[clang] [clang][analyzer] Fix crash caused by overload operator member function with explicit this (PR #132581)

2025-03-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/132581 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix crash caused by overload operator member function with explicit this (PR #132581)

2025-03-24 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_analyze_cc1 -std=c++23 %s -verify -analyzer-checker=alpha.cplusplus.InvalidatedIterator -analyzer-config aggressive-binary-operation-simplification=true + +// expected-no-diagnostics + +class ExplicitThis { + int f = 0; +public: + ExplicitThis(

[clang] [clang][analyzer] Fix crash caused by overload operator member function with explicit this (PR #132581)

2025-03-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. I have not much to say. It's an alpha checker, that is known for crashing. One less crash wouldn't change the situation by much but would certainly push the needle to the right direction. https://github.com/llvm/llvm-project/pull/132581 __

[clang] [NFC] Fix a typo in StdLibraryFunctionsChecker.cpp comments (PR #133375)

2025-03-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/133375 ___ 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 Balazs Benics via cfe-commits
https://github.com/steakhal 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] Unknown array lvalue element in Store (PR #133381)

2025-03-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal 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 Balazs Benics via cfe-commits
@@ -0,0 +1,146 @@ +//===- LValueElementTest.cpp ---===// steakhal wrote: I agree, we should see if we can properly test this in the list tests, as you proposed already. https://github.com/llvm/llvm-project/pull/133381 ___

[clang] [NFC][analyzer] Fix typo in VirtualCall checker docs (PR #133593)

2025-03-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/133593 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] Fix typo in VirtualCall checker docs (PR #133593)

2025-03-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/133593 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] Fix end location of DeclarationNameInfo on instantiated methods (PR #92654)

2025-04-04 Thread Balazs Benics via cfe-commits
steakhal wrote: > @alejandro-alvarez-sonarsource @steakhal > > This breaks the type info loaded correctly in previous decl instantiation: > [...] Thank you for reporting @Abramo-Bagnara. Could you create a dedicated GH issue for this please? FYI: I don't have plans to work on it though, but s

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

2025-04-04 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. LGTM thanks, https://github.com/llvm/llvm-project/pull/131823 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [StaticAnalyzer] Make it a noop when initializing a field of empty record (PR #138594)

2025-05-07 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,50 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus -verify %s -DEMPTY_CLASS +// UNSUPPORTED: system-windows +// expected-no-diagnostics + +// This test reproduces the issue that previously the

[clang] [StaticAnalyzer] Make it a noop when initializing a field of empty record (PR #138594)

2025-05-07 Thread Balazs Benics via cfe-commits
@@ -715,7 +716,11 @@ void ExprEngine::handleConstructor(const Expr *E, // actually make things worse. Placement new makes this tricky as well, // since it's then possible to be initializing one part of a multi- // dimensional array. -State = Stat

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

2025-05-10 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM. 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-10 Thread Balazs Benics via cfe-commits
@@ -282,15 +282,48 @@ ProgramStateRef ExprEngine::handleLValueBitCast( void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst) { - ExplodedNodeSet dstPreStmt; - getCheckerManager().runCheckersForP

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

2025-05-10 Thread Balazs Benics via cfe-commits
https://github.com/steakhal 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-10 Thread Balazs Benics via cfe-commits
@@ -1,5 +1,5 @@ // RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -verify %s \ -// RUN: -analyzer-checker=core,debug.ExprInspection +// RUN: -analyzer-checker=debug.ExprInspection -analyzer-disable-checker=core steakhal wrote: Why do you disable core

[clang] [clang][analysis] Fix flaky clang/test/Analysis/live-stmts.cpp test (2nd attempt) (PR #127406)

2025-05-12 Thread Balazs Benics via cfe-commits
steakhal wrote: > Is there interest in backporting this to the release branch? If so, can > someone manually create a PR? Thanks for the heads up. Here is the manual backport: #139591 @tstellar https://github.com/llvm/llvm-project/pull/127406 ___ cf

[clang] [analyzer] Make it a noop when initializing a field of empty record (PR #138594)

2025-05-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Indeed, it looks great now. Thank you! Let's merge this. https://github.com/llvm/llvm-project/pull/138594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] Revert "[analyzer] Make it a noop when initializing a field of empty record" (PR #138951)

2025-05-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/138951 Reverts llvm/llvm-project#138594 Crashes, see: https://lab.llvm.org/buildbot/#/builders/144/builds/24534 Rate limit · GitHub body { background-color: #f6f8fa;

[clang] Revert "[analyzer] Make it a noop when initializing a field of empty record" (PR #138951)

2025-05-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/138951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Make it a noop when initializing a field of empty record (PR #138594)

2025-05-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/138594 ___ 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 Balazs Benics via cfe-commits
https://github.com/steakhal commented: LGTM overall. Thank you! I'm also in favor of following the LLVM coding style. https://github.com/llvm/llvm-project/pull/139188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

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

2025-05-09 Thread Balazs Benics via cfe-commits
https://github.com/steakhal 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] [analyzer] Workaround for slowdown spikes (unintended scope increase) (PR #136720)

2025-05-12 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: steakhal wrote: Backport requested in #139597 https://github.com/llvm/llvm-project/pull/13

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

2025-05-13 Thread Balazs Benics 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] [analyzer][NFC] Introduce framework for checker families (PR #139256)

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

[clang] [llvm] Revert "[lit][clang] Avoid realpath on Windows due to MAX_PATH limitations" (PR #139739)

2025-05-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal ready_for_review https://github.com/llvm/llvm-project/pull/139739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElement in SymbolConjured (reland) (PR #137355)

2025-05-12 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM. Thanks for the ping. https://github.com/llvm/llvm-project/pull/137355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElement in SymbolConjured (reland) (PR #137355)

2025-05-12 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/137355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix crashing __builtin_bit_cast (PR #139188)

2025-05-12 Thread Balazs Benics via cfe-commits
https://github.com/steakhal 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] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Balazs Benics 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 Balazs Benics via cfe-commits
@@ -484,83 +484,87 @@ class Call { } // end eval namespace -class CheckerBase : public ProgramPointTag { - /// A single checker class (i.e. a subclass of `CheckerBase`) can implement - /// multiple user-facing checkers that have separate names and can be enabled - /// sepa

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

2025-05-13 Thread Balazs Benics 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 Balazs Benics via cfe-commits
@@ -484,83 +484,87 @@ class Call { } // end eval namespace -class CheckerBase : public ProgramPointTag { - /// A single checker class (i.e. a subclass of `CheckerBase`) can implement - /// multiple user-facing checkers that have separate names and can be enabled - /// sepa

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

2025-05-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal 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 Balazs Benics 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] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Balazs Benics 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 Balazs Benics 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 Balazs Benics via cfe-commits
https://github.com/steakhal commented: I think this one is a really good direction. I like it. I left a couple minor remarks inline. https://github.com/llvm/llvm-project/pull/139256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

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

2025-05-13 Thread Balazs Benics 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, steak

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

2025-05-13 Thread Balazs Benics via cfe-commits
@@ -40,22 +40,23 @@ template <> struct FoldingSetTrait { namespace { class VirtualCallChecker -: public Checker { +: public CheckerFamily { public: - enum : CheckerPartIdx { PureChecker, ImpureChecker, NumCheckerParts }; - - BugType BugTypes[NumCheckerParts] = { -

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

2025-05-13 Thread Balazs Benics via cfe-commits
steakhal wrote: Sorry for my delay. I missed the review request. 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 Balazs Benics via cfe-commits
___ 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 Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -0,0 +1,286 @@ +#!/usr/bin/env python3 +# A tool to automatically generate documentation for the config options of the +# clang static analyzer by readi

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

2025-05-13 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -0,0 +1,286 @@ +#!/usr/bin/env python3 +# A tool to automatically generate documentation for the config options of the +# clang static analyzer by readi

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

2025-05-13 Thread Balazs Benics via cfe-commits
___ 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 Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal requested changes to this pull request. https://github.com/llvm/llvm-project/pull/135169 _

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

2025-05-13 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -0,0 +1,11 @@ +The documentation of analyzer options is generated by a script that parses +AnalyzerOptions.def. The following line validates that this s

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

2025-05-13 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -227,8 +263,11 @@ def get_option_list(input_file): p = argparse.ArgumentParser() p.add_argument("--options-def", help="path to AnalyzerOptions.def")

[clang] [analyzer] Fix crashing __builtin_bit_cast (PR #139188)

2025-05-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Still LGTM. 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] [analyzer][NFC] Introduce framework for checker families (PR #139256)

2025-05-13 Thread Balazs Benics via cfe-commits
steakhal 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, an identifier that can be used in > debug dumps) to each checker family. The old code automatically used the name > of t

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

2025-05-13 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -25,25 +25,23 @@ using namespace ento; using namespace taint; namespace { -class DivZeroChecker :

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

2025-05-16 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: steakhal wrote: > I agree, but unfortunately there is no way to get the class name > automatically in a platform-indepen

[clang] [clang][analyzer] Fix a nullptr dereference when -ftime-trace is used (Reland) (PR #139980)

2025-05-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/139980 ___ 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-15 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: steakhal wrote: I think I can't push to your branch. So here is what I'd do as git format-patch: [0001-NFC-Rename-getTag

[clang] [clang][analyzer] Fix a nullptr dereference when `-ftime-trace` is used (PR #139820)

2025-05-14 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: %clang --analyze %s -ftime-trace -Xclang -verify +// expected-no-diagnostics steakhal wrote: Have you tried `clang_analyze_cc1`? We usually prefer that in our tests. It gives us an extra level of indirection over using `%clang` directly.

[clang] [clang][analyzer] Fix a nullptr dereference when `-ftime-trace` is used (PR #139820)

2025-05-14 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/139820 ___ 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 Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -0

[clang] [clang][analyzer] Fix a nullptr dereference when `-ftime-trace` is used (PR #139820)

2025-05-14 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I can only agree with Aaron. It looks nice. Thank you! https://github.com/llvm/llvm-project/pull/139820 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

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

2025-05-14 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. :rocket: 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] [clang][analyzer] Fix a nullptr dereference when `-ftime-trace` is used (PR #139820)

2025-05-14 Thread Balazs Benics via cfe-commits
@@ -103,6 +103,8 @@ class SymbolConjured : public SymbolData { const Stmt *getStmt() const { switch (Elem->getKind()) { case CFGElement::Initializer: + if (Elem->castAs().getInitializer() == nullptr) steakhal wrote: +1 https://github.com/llvm/l

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

2025-05-14 Thread Balazs Benics via cfe-commits
https://github.com/steakhal 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 Balazs Benics 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 roots (PR #139903)

2025-05-14 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Ah, looks sweeet! Thank you for paying the technical dept of ours. https://github.com/llvm/llvm-project/pull/139903 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [clang][analyzer] Fix a nullptr dereference when `-ftime-trace` is used (PR #139820)

2025-05-14 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Thank you! https://github.com/llvm/llvm-project/pull/139820 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix a nullptr dereference when `-ftime-trace` is used (PR #139820)

2025-05-14 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/139820 ___ 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-16 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: steakhal wrote: > Thanks for the patches! I originally thought that renaming > `getTagDescription` -> `getDebugName` wou

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

2025-05-16 Thread Balazs Benics via cfe-commits
steakhal 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. RT is not a concern to me in this case. https://github

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

2025-05-17 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To:

[clang] Fixed issue #128882: don't warn if 1st argument to 'getcwd' is NULL (PR #135720)

2025-05-20 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/135720 >From cfd32680ac4a534b4060d8cc3549edfe45e721bf Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Mon, 14 Apr 2025 20:58:24 -0400 Subject: [PATCH 1/2] Fixed issue #128882: don't warn if 1st argument to 'getcwd'

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

2025-05-20 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy ,Balazs Benics ,Balazs Benics , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Repl

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

2025-05-20 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy ,Balazs Benics ,Balazs Benics , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -115,9 +115,22 @@ cla

[clang] [clang][analysis] Thread Safety Analysis: Handle parenthesis (PR #140656)

2025-05-20 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/140656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analysis] Thread Safety Analysis: Handle parenthesis (PR #140656)

2025-05-20 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM thanks. https://github.com/llvm/llvm-project/pull/140656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fixed issue #128882: don't warn if 1st argument to 'getcwd' is NULL (PR #135720)

2025-05-20 Thread Balazs Benics via cfe-commits
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) { clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}} clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}} if (errno) {} // no warning - } else if (Path == NULL) {

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

2025-05-18 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: steakhal wrote: > For a moment I was very happy to see this solution, but unfortunately XXX is > **not** the name of the

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

2025-05-19 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy ,Balazs Benics ,Balazs Benics , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal edited https

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

2025-05-19 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy ,Balazs Benics ,Balazs Benics , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal commented: T

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

2025-05-19 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy ,Balazs Benics ,Balazs Benics , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -115,9 +115,22 @@ cla

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

2025-05-19 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy ,

[clang] [StaticAnalyzer] Drop const from a return type (NFC) (PR #141414)

2025-05-25 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/141414 ___ 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-26 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy ,Balazs Benics ,Balazs Benics , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?=

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

2025-05-26 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy ,Balazs Benics ,Balazs Benics , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy

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

2025-05-26 Thread Balazs Benics 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; steakhal wrote: Dont worry. https://githu

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

2025-05-26 Thread Balazs Benics via cfe-commits
steakhal wrote: In hind sight, maybe "debugTag" is the best of both worlds. WDYT? 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 Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/141511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [StaticAnalyzer] Remove unused includes (NFC) (PR #141525)

2025-05-26 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. I only spotchecked, but it should be good if it still builds. Btw, WDYT of IWYU? Maybe we could improve include hygiene for the static analyzer. https://github.com/llvm/llvm-project/pull/141525

[clang] [StaticAnalyzer] Remove unused includes (NFC) (PR #141525)

2025-05-26 Thread Balazs Benics via cfe-commits
steakhal wrote: Thanks for sharing your opinion. I think for long term IWYU should be beneficial for our subsubproject, and may enable us to see how the include hierarchy looks like and to restructure and split some headers. https://github.com/llvm/llvm-project/pull/141525

[clang] [analyzer] Ignore [[clang::flag_enum]] enums in the EnumCastOutOfRange checker (PR #141232)

2025-05-25 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/141232 ___ 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 Balazs Benics via cfe-commits
@@ -2633,7 +2633,8 @@ BugPathGetter::BugPathGetter(const ExplodedGraph *OriginalGraph, assert(I->isValid() && "We only allow BugReporterVisitors and BugReporter itself to " "invalidate reports!"); -Nodes.emplace_back(I->getErrorNode()); +if (c

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

2025-05-15 Thread Balazs Benics 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] [clang][analyzer] Fix a nullptr dereference when -ftime-trace is used (Reland) (PR #139980)

2025-05-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: > > I think this would still trip on the same memory issue. The problem to me > > is that we read uninitialized memory. So even if you limit the bounds of > > the result of the read of such uninitialized memory, it would only mask and > > limit the effect

[clang] [clang][analyzer] Fix a nullptr dereference when -ftime-trace is used (Reland) (PR #139980)

2025-05-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/139980 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix a nullptr dereference when -ftime-trace is used (Reland) (PR #139980)

2025-05-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/139980 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix a nullptr dereference when -ftime-trace is used (Reland) (PR #139980)

2025-05-15 Thread Balazs Benics via cfe-commits
@@ -101,9 +101,17 @@ class SymbolConjured : public SymbolData { // It might return null. const Stmt *getStmt() const { +if (const auto *Parent = Elem.getParent()) { + // Sometimes the CFG element is invalid, avoid dereferencing it. + if (Elem.getIndexInBlock(

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

2025-05-15 Thread Balazs Benics via cfe-commits
steakhal wrote: > This is the cleanup of `ExplodedGraph::trim()` that I promised at > [31e981c](https://github.com/llvm/llvm-project/commit/31e981ca1dc323c8a32012cb60a0a8fe3985db1a). > This significantly simplifies the algorithm and should be equivalent in a > theoretical sense, but unfortunat

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

2025-05-15 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -479,25 +479,20 @@ ExplodedGraph::trim(ArrayRef Sinks, // in the trimmed graph, then add the corresponding edges with // `addPredecessor()`, otherwise add them to the worklist. for (const ExplodedNode *Pred : N->

[clang] [clang][analyzer] Fix a nullptr dereference when -ftime-trace is used (Reland) (PR #139980)

2025-05-15 Thread Balazs Benics via cfe-commits
@@ -101,9 +101,17 @@ class SymbolConjured : public SymbolData { // It might return null. const Stmt *getStmt() const { +if (const auto *Parent = Elem.getParent()) { + // Sometimes the CFG element is invalid, avoid dereferencing it. + if (Elem.getIndexInBlock(

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

2025-05-15 Thread Balazs Benics via cfe-commits
@@ -4096,7 +4096,8 @@ std::string ExprEngine::DumpGraph(bool trim, StringRef Filename) { std::string ExprEngine::DumpGraph(ArrayRef Nodes, StringRef Filename) { - std::unique_ptr TrimmedG(G.trim(Nodes)); + TrimGraphWorklist Worklist{Nodes};

<    20   21   22   23   24   25   26   >