[clang] [NFC][analyzer] OOB test consolidation IV: split off unrelated tests (PR #130763)

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

[clang] [NFC][analyzer] OOB test consolidation IV: rename files (PR #129697)

2025-03-11 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/129697 From 3a3236237e193fb1d1de1aed72e128195d4d0730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Tue, 4 Mar 2025 11:44:18 +0100 Subject: [PATCH] [NFC][analyzer] OOB test consolidation IV: renam

[clang] [NFC][analyzer] OOB test consolidation IV: rename files (PR #129697)

2025-03-11 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/129697 From bdee737e98cb66cb8a9528df7da9be0f367c6287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Tue, 4 Mar 2025 11:44:18 +0100 Subject: [PATCH 1/3] [NFC][analyzer] OOB test consolidation IV: r

[clang] [NFC][analyzer] OOB test consolidation IV: split off unrelated tests (PR #130763)

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

[clang] [NFC][analyzer] Remove CheckerNameRef::getName() (PR #130780)

2025-03-11 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I agree that removing `CheckerNameRef` might be a good step in the future. Right now I'm keeping it because the removal commit would touch 23 files, but maybe I will do it in the future. https://github.com/llvm/llvm-project/pull/130780 _

[clang] [NFC][analyzer] Remove CheckerNameRef::getName() (PR #130780)

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

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-28 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I think the "why were these testcases redundant?" information is too verbose for a commit message; moreover it only conveys information about code that was _removed_ from the repository, so it won't be relevant for readers in the future who are presumably only interested in co

[clang] [NFC][analyzer] Fix header comment in CreateCheckerManager.cpp (PR #129055)

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

[clang] [NFC][analyzer] Fix header comment in CreateCheckerManager.cpp (PR #129055)

2025-02-27 Thread Donát Nagy via cfe-commits
NagyDonat wrote: The failure is caused by `tools/lldb-dap/restart/TestDAP_restart.py` which is completely unrelated to my commit. https://github.com/llvm/llvm-project/pull/129055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] fix(clang/**.py): fix invalid escape sequences (PR #94029)

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

[clang] fix(clang/**.py): fix invalid escape sequences (PR #94029)

2025-03-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: The change in `clang/test/Analysis/check-analyzer-fixit.py` is a good step forward, it indeed fixes an invalid escape sequence[1]. However, I don't see any reason for the changes in `clang/docs/tools/dump_ast_matchers.py`: those were raw strings, so ther

[clang] fix(clang/**.py): fix invalid escape sequences (PR #94029)

2025-03-12 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > to me it seemed like the `r"..."` strings are supposed to be used for regular > expressions, and in this change you appear to transform those strings into > plain old strings. Could you help me understand this? In Python the `r` string prefix stands for a _raw_ string litera

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

2025-03-13 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-12 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-12 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] Rename `CheckerBase::getCheckerName` to `getName` (PR #130953)

2025-03-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130953 ___ 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-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/130985 In the static analyzer codebase we have a traditional pattern where a single checker class (and its singleton instance) acts as the implementation of several (user-facing or modeling) checkers that have share

[clang] [NFC][analyzer] Rename `CheckerBase::getCheckerName` to `getName` (PR #130953)

2025-03-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/130953 The method name `getCheckerName` would imply "get the name of the checker associated with `this`", so it's suitable for e.g. `BugType::getCheckerName` -- but the proper name for a method that "gets the name o

[clang] [NFC][analyzer] Rename `CheckerBase::getCheckerName` to `getName` (PR #130953)

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

[clang] [NFC][analyzer] Rename `CheckerBase::getCheckerName` to `getName` (PR #130953)

2025-03-12 Thread Donát Nagy via cfe-commits
@@ -41,19 +41,19 @@ class BugType { Checker(nullptr), SuppressOnSink(SuppressOnSink) {} BugType(const CheckerBase *Checker, StringRef Desc, StringRef Cat = categories::LogicError, bool SuppressOnSink = false) - : CheckerName(Checker->getCheckerName()),

[clang] [NFC][analyzer] Rename `CheckerBase::getCheckerName` to `getName` (PR #130953)

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

[clang] [NFC][analyzer] Rename `CheckerBase::getCheckerName` to `getName` (PR #130953)

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

[clang] [NFC][analyzer] Rename `CheckerBase::getCheckerName` to `getName` (PR #130953)

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

[clang] fix(clang/**.py): fix invalid escape sequences (PR #94029)

2025-03-12 Thread Donát Nagy via cfe-commits
@@ -55,7 +55,7 @@ def run_test_once(args, extra_args): # themselves. We need to keep the comments to preserve line numbers while # avoiding empty lines which could potentially trigger formatting-related # checks. -cleaned_test = re.sub("// *CHECK-[A-Z0-9\-]*:[^

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

2025-03-12 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/3] [NFC][analyzer] Framework for multipart chec

[clang] [NFC][analyzer] Rename `CheckerBase::getCheckerName` to `getName` (PR #130953)

2025-03-12 Thread Donát Nagy via cfe-commits
@@ -41,19 +41,19 @@ class BugType { Checker(nullptr), SuppressOnSink(SuppressOnSink) {} BugType(const CheckerBase *Checker, StringRef Desc, StringRef Cat = categories::LogicError, bool SuppressOnSink = false) - : CheckerName(Checker->getCheckerName()),

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

2025-03-12 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/4] [NFC][analyzer] Framework for multipart chec

[clang] [clang][analyzer] Add support for C++23 container methods releated to iterator in ContainerModeling (PR #129719)

2025-03-11 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Well, I have to admit that I'm not familiar with this checker -- my recent change is just part of a semi-automated commit series that mechanically changed the same trivial thing in many checkers. However, your change appears to be straig

[clang] [clang][analyzer] Add support for C++23 container methods releated to iterator in ContainerModeling (PR #129719)

2025-03-11 Thread Donát Nagy via cfe-commits
@@ -635,6 +668,66 @@ void deque_emplace_back(std::deque &D, int n) { clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}} } +/// append_range() +/// +/// - Design decision: extends containers to the ->RIGHT-> (i.e. the Nagy

[clang] [clang][analyzer] Add support for C++23 container methods releated to iterator in ContainerModeling (PR #129719)

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

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

2025-02-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/127117 Currently there are many casts that are not modeled (i.e. ignored) by the analyzer, which can cause paradox states (e.g. negative value stored in `unsigned` variable) and false positive reports from various c

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

2025-02-13 Thread Donát Nagy via cfe-commits
@@ -188,29 +189,50 @@ int test_cast_to_unsigned(signed char x) { if (x >= 0) return x; // FIXME: Here the analyzer ignores the signed -> unsigned cast, and manages to - // load a negative value from an unsigned variable. This causes an underflow - // report, which is

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

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

[clang] [analyzer][NFC] Trivial cleanup in ArrayBoundChecker (PR #126941)

2025-02-12 Thread Donát Nagy via cfe-commits
@@ -394,14 +394,13 @@ static bool tryDividePair(std::optional &Val1, return false; const bool Val1HasRemainder = Val1 && *Val1 % Divisor; const bool Val2HasRemainder = Val2 && *Val2 % Divisor; - if (!Val1HasRemainder && !Val2HasRemainder) { -if (Val1) - *Val1

[clang] [analyzer][NFC] Trivial cleanup in ArrayBoundChecker (PR #126941)

2025-02-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/126941 Two small stylistic improvements in code that I wrote ~a year ago: 1. fix a typo in a comment; and 2. simplify the code of `tryDividePair` by swapping the true and the false branches. From a0b6f3aff5e639d4388

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-17 Thread Donát Nagy via cfe-commits
@@ -211,17 +211,15 @@ def DereferenceModeling : Checker<"DereferenceModeling">, Documentation, Hidden; -def NullDereferenceChecker : Checker<"NullDereference">, - HelpText<"Check for dereferences of null pointers">, - CheckerOptions<[ -CmdLineOption - ]>, - Documen

[clang] [analyzer][NFC] Trivial cleanup in ArrayBoundChecker (PR #126941)

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

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

2025-02-17 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Let's hope that this fixes the issue. https://github.com/llvm/llvm-project/pull/127406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [analyzer] Delay the checker constructions after parsing (PR #127409)

2025-02-17 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. I'm happy to see this opportunity to improve the code quality :slightly_smiling_face: I'm not familiar with the initialization procedure of the analyzer, but this change should affect every analysis run equally, so if you managed to run

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-21 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat requested changes to this pull request. Overall I like the change, but I feel that the analyzer option name `suppress-all-address-spaces` is too misleading (see inline comment for more detailed suggestion). https://github.com/llvm/llvm-project/pull/127191 _

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-21 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,77 @@ +// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,alpha.core -std=gnu99 -analyzer-config suppress-all-address-spaces=false -verify=x86-nosuppress %s +// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,alph

[clang] [analyzer] Limit Store by region-store-binding-limit (PR #127602)

2025-02-21 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I tried to write down my rough ideas as a concrete commit, but I don't have enough mental acuity for it today. I'll try to make another attempt on Monday -- but if you wish to close this commit, then it's also OK if I do this refactoring in a separate follow-up commit. https:

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-21 Thread Donát Nagy via cfe-commits
@@ -170,6 +157,16 @@ disable this behavior with the option obj->x = 1; // warn } +Null pointer dereferences of pointers with address spaces are not always defined +as error. Specifically on x86/x86-64 target if the pointer address space is +256 (x86 GS Segment), 257 (x86

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-21 Thread Donát Nagy via cfe-commits
@@ -395,6 +395,19 @@ ANALYZER_OPTION( "flex\" won't be analyzed.", true) +ANALYZER_OPTION( +bool, ShouldSuppressAddressSpaces, "suppress-all-address-spaces", NagyDonat wrote: The name of this analyzer option is misleading: the natural guess is tha

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-21 Thread Donát Nagy via cfe-commits
@@ -2919,6 +2916,39 @@ Check for assignment of a fixed address to a pointer. p = (int *) 0x1; // warn } +.. _alpha-core-FixedAddressDereference: + +alpha.core.FixedAddressDereference (C, C++, ObjC) +" +Check for dereferen

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

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

[clang] [CodeGen][NFC] Move test builtin_signbit.cpp to CodeGen (PR #127814)

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

[clang] [analyzer] Limit Store by region-store-binding-limit (PR #127602)

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Anyway, let's just merge this as it is now. The code is basically OK, I still don't have the brainpower to hold all the details in my mind and if I'll catch some divine inspiration in the future, I can still refactor this as a follow-up

[clang] [analyzer] Limit Store by region-store-binding-limit (PR #127602)

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

[clang] [Sema][NFC] Move two misplaced uninit tests to clang/test/SemaCXX (PR #128013)

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

[clang] [Sema][NFC] Move two misplaced uninit tests to clang/test/SemaCXX (PR #128013)

2025-02-24 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I'm merging this now because I feel that the current reviews are sufficient for this simple NFC change. If there are any further observations/suggestions, feel free to mention them -- I can address them in a follow-up commit. https://github.com/llvm/llvm-project/pull/128013 _

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/128508 Before commit 6e17ed9 the test files `outofbound.c` and `outofbound-notwork.c` tested the behavior of the old alpha checker `alpha.security.ArrayBound` (V1); then that commit converted them into tests for the

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I annotated `outofbound.c` with inline comments to describe why I removed most of the testcases within it. https://github.com/llvm/llvm-project/pull/128508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

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

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

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

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

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM, I agree that "uninitialized" is a better phrasing -- it's shorter and explicitly names the "normal" reason for getting `UndefinedVal`s. > I think the right path is to issue a more precise error message for > out-of-bounds reads. As

[clang] [Sema][NFC] Move two misplaced uninit tests to clang/test/SemaCXX (PR #128013)

2025-02-20 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > I wonder if we should rename the directory to something like > `clang/test/StaticAnalyzer` to avoid confusion in the future. I also considered renaming the directory to `clang/test/StaticAnalyzer` and I would definitely support this idea if it doesn't cause too many difficul

[clang] [Sema][NFC] Move two misplaced uninit tests to clang/test/SemaCXX (PR #128013)

2025-02-20 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/128013 Because they are the last two remaining test files that appeared under `clang/test/Analysis` but were unrelated to the clang static analyzer. For background see the following discourse thread: https://discou

[clang] [CodeGen][NFC] Move test builtin_signbit.cpp to CodeGen (PR #127814)

2025-02-20 Thread Donát Nagy via cfe-commits
NagyDonat wrote: The CI failure is in a completely unrelated test file; I'm pretty confident that it's unrelated to my commit. https://github.com/llvm/llvm-project/pull/127814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [NFC][analyzer] Simplify ownership of checker objects (PR #128887)

2025-02-26 Thread Donát Nagy via cfe-commits
@@ -185,13 +185,11 @@ class CheckerManager { StringRef OptionName, StringRef ExpectedValueDesc) const; - using CheckerRef = CheckerBase *; using CheckerTag = const void *; - using CheckerDtor =

[clang] [NFC][analyzer] Simplify ownership of checker objects (PR #128887)

2025-02-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/128887 Previously checker objects were created by raw `new` calls, which necessitated managing and calling their destructors explicitly. This commit refactors this convoluted logic by introducing `unique_ptr`s that

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

2025-02-26 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > Do you want me to condense the change to a single commit as recommended > [here](https://llvm.org/docs/GitHub.html#landing-your-change)? Alternately, I > could post a draft commit message in a comment for use with GitHub's UI for a > squash-merge. Please put a draft commit

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

2025-02-26 Thread Donát Nagy via cfe-commits
NagyDonat wrote: Thanks for the update, I'm merging the commit. By the way, Github also has built-in support for viewing the before-the-edit version of the PR description: ![image](https://github.com/user-attachments/assets/58213a41-ce76-4e1a-a850-7d4225cdd3e3) https://github.com/llvm/llvm-pr

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

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

[clang] [NFC][analyzer] Simplify ownership of checker objects (PR #128887)

2025-02-27 Thread Donát Nagy via cfe-commits
@@ -185,13 +185,11 @@ class CheckerManager { StringRef OptionName, StringRef ExpectedValueDesc) const; - using CheckerRef = CheckerBase *; using CheckerTag = const void *; - using CheckerDtor =

[clang] [NFC][analyzer] Simplify ownership of checker objects (PR #128887)

2025-02-27 Thread Donát Nagy via cfe-commits
@@ -201,24 +199,24 @@ class CheckerManager { template CHECKER *registerChecker(AT &&... Args) { CheckerTag tag = getTag(); -CheckerRef &ref = CheckerTags[tag]; -assert(!ref && "Checker already registered, use getChecker!"); - -CHECKER *checker = new CHECKER

[clang] [NFC][analyzer] Simplify ownership of checker objects (PR #128887)

2025-02-27 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/128887 From 76f8417b8b46e7d036d98fa92890469654158e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Wed, 26 Feb 2025 15:41:46 +0100 Subject: [PATCH 1/5] [NFC][analyzer] Simplify ownership of check

[clang] [NFC][analyzer] Simplify ownership of checker objects (PR #128887)

2025-02-27 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/128887 From 76f8417b8b46e7d036d98fa92890469654158e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Wed, 26 Feb 2025 15:41:46 +0100 Subject: [PATCH 1/4] [NFC][analyzer] Simplify ownership of check

[clang] [NFC][analyzer] Simplify ownership of checker objects (PR #128887)

2025-02-27 Thread Donát Nagy via cfe-commits
@@ -41,8 +42,8 @@ CheckerManager::CheckerManager(AnalyzerOptions &AOptions, } CheckerManager::~CheckerManager() { NagyDonat wrote: Good suggestion, I didn't know that `= default` works with out-of-line declarations. https://github.com/llvm/llvm-project/pull

[clang] [NFC][analyzer] Simplify ownership of checker objects (PR #128887)

2025-02-27 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/128887 From 76f8417b8b46e7d036d98fa92890469654158e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Wed, 26 Feb 2025 15:41:46 +0100 Subject: [PATCH 1/6] [NFC][analyzer] Simplify ownership of check

[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] [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][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
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][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][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][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][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] [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] 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] 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] 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
@@ -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
@@ -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] [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-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] [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] Workaround for slowdown spikes (unintended scope increase) (PR #136720)

2025-05-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed 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

<    7   8   9   10   11   12   13   14   >