[clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-06 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/94642 In that scalar case, the Init should initialize the auto var before use. The Init might use uninitialized memory from other sources (e.g., heap) but auto-init did not help us in that case because the auto-init woul

[clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-06 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/94642 >From 23ee93af279360dc94cc34f47f9bbef2ba40f815 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 6 Jun 2024 16:32:20 + Subject: [PATCH 1/2] Skip auto-init on scalar vars that have a non-constant Init and no

[clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-06 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/94642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-06 Thread Jan Voung via cfe-commits
https://github.com/jvoung ready_for_review https://github.com/llvm/llvm-project/pull/94642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-06 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/94642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-11 Thread Jan Voung via cfe-commits
jvoung wrote: +cc @dwblaikie @aeubanks https://github.com/llvm/llvm-project/pull/94642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-12 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/94642 >From 23ee93af279360dc94cc34f47f9bbef2ba40f815 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 6 Jun 2024 16:32:20 + Subject: [PATCH 1/3] Skip auto-init on scalar vars that have a non-constant Init and no

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-12 Thread Jan Voung via cfe-commits
@@ -15,7 +15,7 @@ struct Foo { int foo(unsigned n) { bool var_size_1; - long var_size_8 = 123; jvoung wrote: Sure! Added those cases. https://github.com/llvm/llvm-project/pull/94642 ___ cfe-commits mailing list

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-12 Thread Jan Voung via cfe-commits
jvoung wrote: > Drive-by comment: can you please either merge the two commits together, or > change their descriptions so that they are not 100% identical? Oops, changed the later commit description! https://github.com/llvm/llvm-project/pull/94642 __

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-14 Thread Jan Voung via cfe-commits
@@ -0,0 +1,110 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s -check-prefix=UNINIT +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefix=PATTERN +// RUN: %clang

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-18 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/94642 >From 23ee93af279360dc94cc34f47f9bbef2ba40f815 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 6 Jun 2024 16:32:20 + Subject: [PATCH 1/4] Skip auto-init on scalar vars that have a non-constant Init and no

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-18 Thread Jan Voung via cfe-commits
@@ -1972,7 +1972,20 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) { } if (!constant) { -initializeWhatIsTechnicallyUninitialized(Loc); +if (trivialAutoVarInit != +LangOptions::TrivialAutoVarInitKind::Uninitialized) { + // A

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-18 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/94642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-21 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/94642 >From 23ee93af279360dc94cc34f47f9bbef2ba40f815 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 6 Jun 2024 16:32:20 + Subject: [PATCH 1/4] Skip auto-init on scalar vars that have a non-constant Init and no

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Jan Voung via cfe-commits
https://github.com/jvoung approved this pull request. Nice! LG https://github.com/llvm/llvm-project/pull/106772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/106772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LTO] Reduce memory usage for import lists (PR #106772)

2024-08-30 Thread Jan Voung via cfe-commits
@@ -174,51 +174,33 @@ std::string llvm::computeLTOCacheKey( for (auto GUID : ExportsGUID) Hasher.update(ArrayRef((uint8_t *)&GUID, sizeof(GUID))); - // Include the hash for every module we import functions from. The set of - // imported symbols for each module may affe

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-24 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/94642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-15 Thread Jan Voung via cfe-commits
jvoung wrote: Friendly ping =) https://github.com/llvm/llvm-project/pull/111006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-16 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/111006 >From f82e63e470f704f29f4c161579fd592c27301868 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 3 Oct 2024 15:21:32 + Subject: [PATCH 1/4] [clang][dataflow] Add a lattice to help represent cache const acc

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-16 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/111006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-21 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/112605 >From 57a913c8870b338fa127f323be65fda972d65a96 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Wed, 16 Oct 2024 19:38:45 + Subject: [PATCH 1/3] [clang][dataflow] Cache accessors for bugprone-unchecked-optiona

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-21 Thread Jan Voung via cfe-commits
@@ -523,6 +544,99 @@ void transferCallReturningOptional(const CallExpr *E, setHasValue(*Loc, State.Env.makeAtomicBoolValue(), State.Env); } +void handleConstMemberCall(const CallExpr *CE, + dataflow::RecordStorageLocation *RecordLoc, +

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-21 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/112605 >From 57a913c8870b338fa127f323be65fda972d65a96 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Wed, 16 Oct 2024 19:38:45 + Subject: [PATCH 1/4] [clang][dataflow] Cache accessors for bugprone-unchecked-optiona

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-16 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/112605 >From 57a913c8870b338fa127f323be65fda972d65a96 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Wed, 16 Oct 2024 19:38:45 + Subject: [PATCH 1/2] [clang][dataflow] Cache accessors for bugprone-unchecked-optiona

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-16 Thread Jan Voung via cfe-commits
https://github.com/jvoung ready_for_review https://github.com/llvm/llvm-project/pull/112605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-16 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/112605 Treat calls to zero-param const methods as having stable return values (with a cache) to address issue #58510. The cache is invalidated when non-const methods are called. This uses the infrastructure from PR #1110

[clang] [clang][dataflow] Add a test demonstrating an issue in unchecked-optional-access-check (PR #110870)

2024-10-02 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/110870 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-22 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/112605 >From 57a913c8870b338fa127f323be65fda972d65a96 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Wed, 16 Oct 2024 19:38:45 + Subject: [PATCH 1/4] [clang][dataflow] Cache accessors for bugprone-unchecked-optiona

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-22 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/112605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-24 Thread Jan Voung via cfe-commits
@@ -0,0 +1,218 @@ +//===-- CachedConstAccessorsLattice.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][dataflow] Disambiguate a ref to "internal" in CachedConstAccessorsLattice (PR #113601)

2024-10-24 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/113601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Disambiguate a ref to "internal" in CachedConstAccessorsLattice (PR #113601)

2024-10-24 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/113601 Disambiguate to fix a build error (e.g., on windows with clang-cl) >From f5470d4bee2ab991942d6640dd48631ca343bc85 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 24 Oct 2024 17:37:03 + Subject: [PATCH]

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-24 Thread Jan Voung via cfe-commits
@@ -0,0 +1,218 @@ +//===-- CachedConstAccessorsLattice.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-05 Thread Jan Voung via cfe-commits
https://github.com/jvoung ready_for_review https://github.com/llvm/llvm-project/pull/115051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-05 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/115051 >From 8d83ec25ccdedad5f6a48e4a23176435f71a3e72 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 5 Nov 2024 19:20:36 + Subject: [PATCH 1/2] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-opti

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-05 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/115051 We currently do not handle ASSERT_TRUE(opt.has_value()) macros from googletest (and other macros), so would see lots of false positives in test TUs. >From 8d83ec25ccdedad5f6a48e4a23176435f71a3e72 Mon Sep 17 00:0

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-05 Thread Jan Voung via cfe-commits
jvoung wrote: > A quick middle-point solution is to add an option to allow ignoring code that > is executed from within macros, or even allow the user to specify which > macros to ignore. Unfortunately, the problem is exactly that we're not (fully) understanding the content of `ASSERT_TRUE` a

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-05 Thread Jan Voung via cfe-commits
jvoung wrote: > Relying on Google-test internal implementation details that are outside of > our control and may change at any point in time does not feel good. > > The patch should instead fix the root cause of the problem. I agree that it's not good to rely on implementation details, but the

[clang] [clang][dataflow] Cache accessors returning pointers in bugprone-unchecked-optional-access (PR #113922)

2024-10-28 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/113922 >From 21f15146b8a7941781b6d728cdbb0d0be50b02fc Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Mon, 28 Oct 2024 14:45:39 + Subject: [PATCH 1/2] [clang][dataflow] Cache accessors returning pointers in bugprone

[clang] [clang][dataflow] Cache accessors returning pointers in bugprone-unchecked-optional-access (PR #113922)

2024-10-28 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/113922 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Cache accessors returning pointers in bugprone-unchecked-optional-access (PR #113922)

2024-10-28 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/113922 Previously, we covered returning refs, or copies of optional, and bools. Now cover returning pointers (to any type). This is useful for cases like operator-> of smart pointers. Addresses more of issue llvm#58510

[clang] [clang][dataflow] Don't clear cached field state if field is const (PR #113698)

2024-10-28 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/113698 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-11 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/115051 >From 8d83ec25ccdedad5f6a48e4a23176435f71a3e72 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 5 Nov 2024 19:20:36 + Subject: [PATCH 1/3] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-opti

[clang] [clang][dataflow] Disambiguate a ref to "internal" in CachedConstAccessorsLattice (PR #113601)

2024-10-25 Thread Jan Voung via cfe-commits
jvoung wrote: > AST_MATCHER_P_OVERLOAD Ah, missed the part where the macro is generating the `internal` namespaces. I don't think we want to move to the top of the file exactly (the instantiation refers to some functions defined right above, so would need fwd decls?), but we can change the na

[clang] [clang][dataflow] Don't clear cached field state if field is const (PR #113698)

2024-10-25 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/113698 ... in the unchecked optional access model. >From 8b955ead1e7445a7226f51078ba2d05e52f15c23 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Fri, 25 Oct 2024 14:56:49 + Subject: [PATCH] [clang][dataflow] Don't

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-13 Thread Jan Voung via cfe-commits
jvoung wrote: Any other concerns? I think I've elaborated on why the ignore/exclude alternative is not better. Otherwise, eventually, it would be great to be able to understand the various macros and how they could serve as checks for later accesses, but I think this is an improvement on the

[clang] [clang][dataflow] Add a test demonstrating an issue in unchecked-optional-access-check (PR #110870)

2024-10-02 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/110870 createStorageLocation used in transferCallReturningOptional: https://github.com/llvm/llvm-project/blob/09ba83be0ac178851e3c9c9c8fefddbdd4d8353f/clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.

[clang] [clang][dataflow] Add a test demonstrating an issue in unchecked-optional-access-check (PR #110870)

2024-10-02 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/110870 >From d148d4b3187d507fb1ba1735a3111c3eac2d2157 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Wed, 2 Oct 2024 15:26:32 + Subject: [PATCH 1/2] [clang][dataflow] Add a test demonstrating an issue in unchecked-

[clang] [clang][dataflow] Add a test demonstrating an issue in unchecked-optional-access-check (PR #110870)

2024-10-02 Thread Jan Voung via cfe-commits
https://github.com/jvoung ready_for_review https://github.com/llvm/llvm-project/pull/110870 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add a test demonstrating an issue in unchecked-optional-access-check (PR #110870)

2024-10-02 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/110870 >From d148d4b3187d507fb1ba1735a3111c3eac2d2157 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Wed, 2 Oct 2024 15:26:32 + Subject: [PATCH 1/3] [clang][dataflow] Add a test demonstrating an issue in unchecked-

[clang] [clang][dataflow] Add a lattice to help represent cache const accessor methods (PR #111006)

2024-10-03 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/111006 By caching const accessor methods we can sometimes treat method call results as stable (e.g., for issue https://github.com/llvm/llvm-project/issues/58510). Users can clear the cache when a non-const method is call

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-03 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/111006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-03 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/111006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-03 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/111006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-03 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/111006 >From f82e63e470f704f29f4c161579fd592c27301868 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 3 Oct 2024 15:21:32 + Subject: [PATCH 1/2] [clang][dataflow] Add a lattice to help represent cache const acc

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-03 Thread Jan Voung via cfe-commits
https://github.com/jvoung ready_for_review https://github.com/llvm/llvm-project/pull/111006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-15 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/111006 >From f82e63e470f704f29f4c161579fd592c27301868 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 3 Oct 2024 15:21:32 + Subject: [PATCH 1/4] [clang][dataflow] Add a lattice to help represent cache const acc

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-15 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/111006 >From f82e63e470f704f29f4c161579fd592c27301868 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Thu, 3 Oct 2024 15:21:32 + Subject: [PATCH 1/3] [clang][dataflow] Add a lattice to help represent cache const acc

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-15 Thread Jan Voung via cfe-commits
@@ -0,0 +1,217 @@ +//===- unittests/Analysis/FlowSensitive/CachedConstAccessorsLatticeTest.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] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-15 Thread Jan Voung via cfe-commits
@@ -0,0 +1,217 @@ +//===- unittests/Analysis/FlowSensitive/CachedConstAccessorsLatticeTest.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] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-15 Thread Jan Voung via cfe-commits
@@ -0,0 +1,218 @@ +//===-- CachedConstAccessorsLattice.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-15 Thread Jan Voung via cfe-commits
@@ -0,0 +1,218 @@ +//===-- CachedConstAccessorsLattice.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-07 Thread Jan Voung via cfe-commits
jvoung wrote: > > > we're not (fully) understanding the content > > > > > > My thinking was that we don't even need to understand the content, we > > simply exclude code that is contained within any of the problematic public > > macros. This sounds like it should be possible to do? Unfortunat

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-06 Thread Jan Voung via cfe-commits
jvoung wrote: > > we're not (fully) understanding the content > > My thinking was that we don't even need to understand the content, we simply > exclude code that is contained within any of the problematic public macros. > This sounds like it should be possible to do? Unfortunately I don't kno

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-06 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/115051 >From 8d83ec25ccdedad5f6a48e4a23176435f71a3e72 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 5 Nov 2024 19:20:36 + Subject: [PATCH 1/3] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-opti

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-06 Thread Jan Voung via cfe-commits
jvoung wrote: > > but these are not internal implementation details - these are key elements > > of the public API > > In the unit test, you have copied internal code from here: > https://github.com/google/googletest/blob/d144031940543e15423a25ae5a8a74141044862f/googletest/include/gtest/intern

[clang] [llvm] [LLVM][NFC] Use `used`'s element type if available (PR #116804)

2024-11-20 Thread Jan Voung via cfe-commits
https://github.com/jvoung approved this pull request. https://github.com/llvm/llvm-project/pull/116804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-11-14 Thread Jan Voung via cfe-commits
jvoung wrote: > I don't think we can ignore a TU simply because it has the Google Test header > included, which this will do. This would ignore real problems, such as That is true (and we've considered that -- FWIW, ymand and our team have been maintaining this checker). But as is, we are curr

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-12-02 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/115051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-12-02 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/115051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-12-02 Thread Jan Voung via cfe-commits
jvoung wrote: Hi @5chmidti and @HerrCai0907 any thoughts on the "Would it help if this was instead a checker option?"? Given the volume of false positives right now, I think skip by default, but can turn on if needed. I updated the description to include the point of "we are currently seeing m

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-12-02 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/115051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2025-01-07 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/120249 >From c526263a7accc434dbf6e93c2995ceb2f95873b8 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 17 Dec 2024 15:38:19 + Subject: [PATCH 1/7] [clang][dataflow] Use smart pointer caching in unchecked optiona

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2025-01-07 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/120249 >From c526263a7accc434dbf6e93c2995ceb2f95873b8 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 17 Dec 2024 15:38:19 + Subject: [PATCH 1/7] [clang][dataflow] Use smart pointer caching in unchecked optiona

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2025-01-07 Thread Jan Voung via cfe-commits
@@ -58,6 +63,106 @@ ast_matchers::StatementMatcher isSmartPointerLikeOperatorArrow(); ast_matchers::StatementMatcher isSmartPointerLikeValueMethodCall(); ast_matchers::StatementMatcher isSmartPointerLikeGetMethodCall(); +// Common transfer functions. + +/// Returns the "canon

[clang] [clang] [dataflow] use unqualified type for smart pointer matching (PR #125958)

2025-02-05 Thread Jan Voung via cfe-commits
https://github.com/jvoung approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/125958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fix smart pointer accessor caching to handle aliases (PR #124964)

2025-01-30 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/124964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-16 Thread Jan Voung via cfe-commits
https://github.com/jvoung ready_for_review https://github.com/llvm/llvm-project/pull/120102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-16 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/120102 This is part 1 of caching for smart pointer accessors, building on top of the CachedConstAccessorsLattice, which caches "normal" accessors. Smart pointer accessors are a bit different in that they may: - have ali

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-17 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/120102 >From f9b8cbaed4c01c2051cdcde105d6a9bca1684388 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Mon, 16 Dec 2024 16:06:43 + Subject: [PATCH 1/2] [clang][dataflow] Add matchers for smart pointer accessors to be

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2024-12-17 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/120249 Part 2 (and final part) following https://github.com/llvm/llvm-project/pull/120102 Allows users to do things like: ``` if (o->x.has_value()) { ((*o).x).value(); } ``` where the `->` and `*` are operator overlo

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-17 Thread Jan Voung via cfe-commits
@@ -0,0 +1,134 @@ +#include "clang/Analysis/FlowSensitive/SmartPointerAccessorCaching.h" + +#include "clang/AST/CanonicalType.h" +#include "clang/AST/DeclCXX.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/Basic/OperatorKinds.h" + +namespace clang::dataflow { + +na

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-17 Thread Jan Voung via cfe-commits
@@ -0,0 +1,134 @@ +#include "clang/Analysis/FlowSensitive/SmartPointerAccessorCaching.h" + +#include "clang/AST/CanonicalType.h" +#include "clang/AST/DeclCXX.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/Basic/OperatorKinds.h" + +namespace clang::dataflow { + +na

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-17 Thread Jan Voung via cfe-commits
@@ -0,0 +1,194 @@ +//===- unittests/Analysis/FlowSensitive/SmartPointerAccessorCachingTest.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] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-17 Thread Jan Voung via cfe-commits
@@ -0,0 +1,134 @@ +#include "clang/Analysis/FlowSensitive/SmartPointerAccessorCaching.h" + +#include "clang/AST/CanonicalType.h" +#include "clang/AST/DeclCXX.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/Basic/OperatorKinds.h" + +namespace clang::dataflow { + +na

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2024-12-20 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/120249 >From c526263a7accc434dbf6e93c2995ceb2f95873b8 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 17 Dec 2024 15:38:19 + Subject: [PATCH] [clang][dataflow] Use smart pointer caching in unchecked optional ac

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2024-12-20 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/120249 >From c526263a7accc434dbf6e93c2995ceb2f95873b8 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 17 Dec 2024 15:38:19 + Subject: [PATCH 1/2] [clang][dataflow] Use smart pointer caching in unchecked optiona

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-19 Thread Jan Voung via cfe-commits
@@ -0,0 +1,134 @@ +#include "clang/Analysis/FlowSensitive/SmartPointerAccessorCaching.h" + +#include "clang/AST/CanonicalType.h" +#include "clang/AST/DeclCXX.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/Basic/OperatorKinds.h" + +namespace clang::dataflow { + +na

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-19 Thread Jan Voung via cfe-commits
@@ -0,0 +1,63 @@ +//===-- SmartPointerAccessorCaching.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-19 Thread Jan Voung via cfe-commits
@@ -0,0 +1,133 @@ +#include "clang/Analysis/FlowSensitive/SmartPointerAccessorCaching.h" + +#include "clang/AST/CanonicalType.h" +#include "clang/AST/DeclCXX.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/Basic/OperatorKinds.h" + +namespace clang::dataflow { + +na

[clang] [clang][dataflow] Add matchers for smart pointer accessors to be cached (PR #120102)

2024-12-20 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/120102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fix a missing break from a switch case -Wimplicit-fallthrough (PR #120739)

2024-12-20 Thread Jan Voung via cfe-commits
jvoung wrote: > Thanks for the fix! Thanks for helping merge! And sorry again about the breakage! https://github.com/llvm/llvm-project/pull/120739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2024-12-20 Thread Jan Voung via cfe-commits
https://github.com/jvoung ready_for_review https://github.com/llvm/llvm-project/pull/120249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2024-12-20 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/120249 >From c526263a7accc434dbf6e93c2995ceb2f95873b8 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 17 Dec 2024 15:38:19 + Subject: [PATCH 1/4] [clang][dataflow] Use smart pointer caching in unchecked optiona

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-12-06 Thread Jan Voung via cfe-commits
https://github.com/jvoung edited https://github.com/llvm/llvm-project/pull/115051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-12-06 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/115051 >From 8d83ec25ccdedad5f6a48e4a23176435f71a3e72 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 5 Nov 2024 19:20:36 + Subject: [PATCH 1/5] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-opti

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-12-06 Thread Jan Voung via cfe-commits
jvoung wrote: Thanks! Ok that does that look useful (and I think the our other reviewer ymand@ wrote it =) https://reviews.llvm.org/D74840). - I'll work on using those in parallel - It will need to be extended a little to handle a few more matches (right now it's the binary comparison eq/ne, e

[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-12-06 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/115051 >From 8d83ec25ccdedad5f6a48e4a23176435f71a3e72 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 5 Nov 2024 19:20:36 + Subject: [PATCH 1/4] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-opti

[clang] [clang][dataflow] Use smart pointer caching in unchecked optional accessor (PR #120249)

2025-01-08 Thread Jan Voung via cfe-commits
https://github.com/jvoung closed https://github.com/llvm/llvm-project/pull/120249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   >