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

2025-01-06 Thread Yitzhak Mandelbaum 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 smart pointer caching in unchecked optional accessor (PR #120249)

2025-01-06 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. 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][transformer] Allow usage of applyFirst with rewriteDescendants (PR #117658)

2024-12-30 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > Yes, indeed the original match happens in separate context, but all contexts > share one `NodesMap`, which values are overriden with a consecutive match > ('clash'). I see -- I'd missed the reuse of the MatchResult. Now that I understand the problem, I don't think that you're s

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-30 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/120967 >From db206514c03a58065e24afccd55886a012b2abcc Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 23 Dec 2024 13:42:21 + Subject: [PATCH] Introduce virtual interface for lattices and remove dependen

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-23 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/120967 >From 2273b56b783b7923108dbb3a5857d256fc4a44ca Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 23 Dec 2024 13:42:21 + Subject: [PATCH] Introduce virtual interface for lattices and remove dependen

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-23 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/120967 >From 3792a385b1ecd2dd029fc6321bacac1de5d8eb46 Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 23 Dec 2024 13:42:21 + Subject: [PATCH] Introduce virtual interface for lattices and remove dependen

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-23 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/120967 >From 27ef09ae6f7a83fa3cf9ee98a46b02880607add8 Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 23 Dec 2024 13:42:21 + Subject: [PATCH] Introduce virtual interface for lattices and remove dependen

[clang] Introduce virtual interface for lattices and remove dependency on `llvm::Any`. (PR #120967)

2024-12-23 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand created https://github.com/llvm/llvm-project/pull/120967 This PR has 2 related goals: *Remove dependency on `llvm::Any`*. For some platforms, use of `llvm::Any` forces users to explicitly define internal details related to `Any`. Aside from aesthetics, this places an ob

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

2024-12-18 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. 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-18 Thread Yitzhak Mandelbaum 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-18 Thread Yitzhak Mandelbaum 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-18 Thread Yitzhak Mandelbaum 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-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

2024-12-18 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: Gentle ping, since it's been a week since my last post. 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][transformer] Allow usage of applyFirst with rewriteDescendants (PR #117658)

2024-12-18 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > > Can you expand on your concern about the clash? > > The clash is happening in `NodesMap`. See, > > 1. the matcher which is associated with `rewriteDescendants` gets "Tag0", > 2. tags for matchers from `applyfirst` are shifted, they get "Tag1", ... > 3. that is why `transformer:

[clang] [clang][transformer] Allow usage of applyFirst with rewriteDescendants (PR #117658)

2024-12-13 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > Without these changes a clash appears between a Tag, which is bound to > enclosing match, and a Tag, which is associated with first Case of applyFirst > in rewriteDescendands. Can you expand on your concern about the clash? Your approach of using the matcher ID seems like an im

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-10 Thread Yitzhak Mandelbaum via cfe-commits
@@ -143,6 +143,15 @@ const Formula &getFormula(const ValueDecl &D, const Environment &Env) { return cast(Env.getValue(D))->formula(); } +const BindingDecl *findBindingDecl(const char *Name, ASTContext &ASTCtx) { ymand wrote: nit: Please use StringRef. htt

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-10 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/117858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-10 Thread Yitzhak Mandelbaum via cfe-commits
@@ -143,6 +143,15 @@ const Formula &getFormula(const ValueDecl &D, const Environment &Env) { return cast(Env.getValue(D))->formula(); } +const BindingDecl *findBindingDecl(const char *Name, ASTContext &ASTCtx) { ymand wrote: why place this parameter second

[clang] [clang][transformer] Allow usage of applyFirst with rewriteDescendants (PR #117658)

2024-12-10 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > @ymand, could you please take a look? Yes -- sorry, missed the notification. I'll try to review within 24h. https://github.com/llvm/llvm-project/pull/117658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

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

2024-12-09 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: This review has been going on for longer than a month so, as one of the reviewers and the original author of this check, I wanted to jump in and see if we can bring it to an agreeable conclusion. I’d like to start with some background: * This check was introduced in 2020 with the

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

2024-12-09 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > I am still confused why your team did not just disable this rule for test > folder? It is normal cases that source code and test code have different > quality metrics. Our codebase doesn't use test folders. We have no foolproof way of distinguishing code from test based on the

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-27 Thread Yitzhak Mandelbaum via cfe-commits
@@ -281,6 +282,17 @@ ReferencedDecls getReferencedDecls(const FunctionDecl &FD) { Visitor.TraverseStmt(FD.getBody()); if (const auto *CtorDecl = dyn_cast(&FD)) Visitor.traverseConstructorInits(CtorDecl); + if (const auto *Method = dyn_cast(&FD); ymand

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-27 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/117771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Yitzhak Mandelbaum via cfe-commits
@@ -146,6 +146,10 @@ struct ReferencedDecls { /// Free functions and member functions which are referenced (but not /// necessarily called). llvm::DenseSet Functions; + /// Parameters of other functions, captured by reference by a lambda. This is + /// empty except when

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Yitzhak Mandelbaum via cfe-commits
@@ -146,6 +146,10 @@ struct ReferencedDecls { /// Free functions and member functions which are referenced (but not /// necessarily called). llvm::DenseSet Functions; + /// Parameters of other functions, captured by reference by a lambda. This is ymand w

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Yitzhak Mandelbaum via cfe-commits
@@ -281,6 +282,17 @@ ReferencedDecls getReferencedDecls(const FunctionDecl &FD) { Visitor.TraverseStmt(FD.getBody()); if (const auto *CtorDecl = dyn_cast(&FD)) Visitor.traverseConstructorInits(CtorDecl); + if (const auto *Method = dyn_cast(&FD); ymand

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand edited https://github.com/llvm/llvm-project/pull/117771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add captured parameters to ReferencedDecls for lamb… (PR #117771)

2024-11-26 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand requested changes to this pull request. I think the comments could be a bit stronger, but the code looks fine. https://github.com/llvm/llvm-project/pull/117771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

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

2024-11-05 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. 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] Cache accessors returning pointers in bugprone-unchecked-optional-access (PR #113922)

2024-10-28 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. Thanks! 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 Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. 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] Don't clear cached field state if field is const (PR #113698)

2024-10-28 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. 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] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-23 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > idk if this was kinda the explanation you were after or not > https://discourse.llvm.org/t/supporting-llvm-build-llvm-dylib-on-windows/58891 Indeed, thank you! https://github.com/llvm/llvm-project/pull/108051 ___ cfe-commits mailing li

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-23 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. Thanks for the discussion/explanation and the comments! https://github.com/llvm/llvm-project/pull/108051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-23 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: I discussed with other code owners -- we think our best option is to remove our use of llvm::Any entirely. So, I think you can go ahead with the changes here (no need for a new NoopLattice.cpp), but please add some comments explaining what's going on (even a pointer to some explan

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-22 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > > What are the implications/requirements for users of DataflowAnalysis? Every > > instance specifices it's own lattice, which is converted to/from llvm::Any. > > Will every lattice definition require these new declarations? > > If you think they will be used from external from t

[clang] [FlowSensitive] Allow to dump nested RecordStorageLocation (PR #112457)

2024-10-22 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. I would suggest a brief comment explaining the choice not to filter. https://github.com/llvm/llvm-project/pull/112457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang][transformer] Add `join` stencil. (PR #107366)

2024-10-22 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. Sorry for the delay! I missed the notification... https://github.com/llvm/llvm-project/pull/107366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-22 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: What are the implications/requirements for users of DataflowAnalysis? Every instance specifices it's own lattice, which is converted to/from llvm::Any. Will every lattice definition require these new declarations? https://github.com/llvm/llvm-project/pull/108051 __

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-22 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > @ymand, is your concern resolved? Sorry, it isn't -- a) we still need comments with at least minimal explanation and b) I'm not sure why the definition is now in TypeErasedDataflowAnalysis.cpp -- is this because we lack NoopAnalysis.cpp? If so, why is TypeErasedDataflowAnalysis

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

2024-10-21 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. 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-21 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. 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-21 Thread Yitzhak Mandelbaum 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][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-16 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. 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 Yitzhak Mandelbaum 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 Yitzhak Mandelbaum 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 Yitzhak Mandelbaum 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 Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. modulo the requests for tests. This looks great! https://github.com/llvm/llvm-project/pull/111006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

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

2024-10-15 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand 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] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-15 Thread Yitzhak Mandelbaum via cfe-commits
@@ -28,12 +28,24 @@ #include "clang/Analysis/FlowSensitive/MatchSwitch.h" #include "clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h" #include "clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h" +#include "clang/Support/Compiler.h" #include "llvm/ADT/STLExtras.h"

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-14 Thread Yitzhak Mandelbaum via cfe-commits
@@ -28,12 +28,24 @@ #include "clang/Analysis/FlowSensitive/MatchSwitch.h" #include "clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h" #include "clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h" +#include "clang/Support/Compiler.h" #include "llvm/ADT/STLExtras.h"

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-14 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand requested changes to this pull request. https://github.com/llvm/llvm-project/pull/108051 ___ 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 Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. 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][transformer] Make `describe()` terser for `NamedDecl`s. (PR #108215)

2024-09-11 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/108215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Collect local variables referenced within a functio… (PR #104459)

2024-08-19 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand closed https://github.com/llvm/llvm-project/pull/104459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Collect local variables referenced within a functio… (PR #104459)

2024-08-19 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/104459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Collect local variables referenced within a functio… (PR #104459)

2024-08-16 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: Looks good, but please add a test. Thanks! https://github.com/llvm/llvm-project/pull/104459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Collect local variables referenced within a functio… (PR #104459)

2024-08-15 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: Should we make this flag controlled? Or is the idea that analyses can simply ignore the new `Locals` field? https://github.com/llvm/llvm-project/pull/104459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #102510)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: https://github.com/llvm/llvm-project/pull/103219 has been merged as https://github.com/llvm/llvm-project/commit/661dda9df13c65ce021407bb726b558c7a414731. https://github.com/llvm/llvm-project/pull/102510 ___ cfe-commits mailing list cfe-co

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #103219)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand closed https://github.com/llvm/llvm-project/pull/103219 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #103219)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/103219 >From cde9e0eb8090a95df22bc83527a68d385fa847a9 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 8 Aug 2024 14:22:03 -0300 Subject: [PATCH 1/4] [clang] Add frontend flag to enable support for broken exter

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #103219)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/103219 >From cde9e0eb8090a95df22bc83527a68d385fa847a9 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 8 Aug 2024 14:22:03 -0300 Subject: [PATCH 1/3] [clang] Add frontend flag to enable support for broken exter

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #102510)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: I've posted a fix as https://github.com/llvm/llvm-project/pull/103219 https://github.com/llvm/llvm-project/pull/102510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #103219)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand ready_for_review https://github.com/llvm/llvm-project/pull/103219 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #103219)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand edited https://github.com/llvm/llvm-project/pull/103219 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #103219)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand edited https://github.com/llvm/llvm-project/pull/103219 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #103219)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/103219 >From cde9e0eb8090a95df22bc83527a68d385fa847a9 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 8 Aug 2024 14:22:03 -0300 Subject: [PATCH 1/2] [clang] Add frontend flag to enable support for broken exter

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #103219)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand edited https://github.com/llvm/llvm-project/pull/103219 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #103219)

2024-08-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand created https://github.com/llvm/llvm-project/pull/103219 There are some external projects that can't rely on our own sugar propagation for templated entities, because they need to resugar types which only exist within their framework, and so are entirely invisible to our

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #102510)

2024-08-12 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: Gentle ping. It's critical that this land so we can unbreak our system. Thanks! https://github.com/llvm/llvm-project/pull/102510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [clang-tools-extra] [clang-tidy] Add support for bsl::optional (PR #101450)

2024-08-02 Thread Yitzhak Mandelbaum via cfe-commits
@@ -784,6 +814,12 @@ auto buildTransferMatchSwitch() { isOptionalMemberCallWithNameMatcher(hasName("operator bool")), transferOptionalHasValueCall) + // NullableValue::isNull + // Only NullableValue has isNull + .CaseOfCFGStmt( + isO

[clang] [clang-tools-extra] [clang-tidy] Add support for bsl::optional (PR #101450)

2024-08-02 Thread Yitzhak Mandelbaum via cfe-commits
@@ -38,10 +38,22 @@ namespace clang { namespace dataflow { -static bool isTopLevelNamespaceWithName(const NamespaceDecl &NS, -llvm::StringRef Name) { - return NS.getDeclName().isIdentifier() && NS.getName() == Name && - NS.getPa

[clang] [clang-tools-extra] [clang-tidy] Add support for bsl::optional (PR #101450)

2024-08-02 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand requested changes to this pull request. https://github.com/llvm/llvm-project/pull/101450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Handle this-capturing lambdas in field initializers. (PR #99519)

2024-07-22 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand closed https://github.com/llvm/llvm-project/pull/99519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Handle this-capturing lambdas in field initializers. (PR #99519)

2024-07-18 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/99519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Handle this-capturing lambdas in field initializers. (PR #99519)

2024-07-18 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand edited https://github.com/llvm/llvm-project/pull/99519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][transformer] Introduce a `constructExprArgs` range selector. (PR #95901)

2024-06-26 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/95901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Teach `AnalysisASTVisitor` that `typeid()` can be evaluated. (PR #96731)

2024-06-26 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/96731 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][nullability] Don't return null fields from `getReferencedDecls()`. (PR #94983)

2024-06-10 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. Thanks! I'm once again struck by how much this project would benefit from Nullability annotations/checking. https://github.com/llvm/llvm-project/pull/94983 ___ cfe-commits mailing list cfe-commits@l

[clang] [clang][dataflow] Handle `AtomicExpr` in `ResultObjectVisitor`. (PR #94963)

2024-06-10 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/94963 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Propagate storage location of compound assignment operators. (PR #94332)

2024-06-04 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/94332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][nullability] Propagate storage location / value of `++`/`--` operators. (PR #94217)

2024-06-03 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/94217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Rewrite `getReferencedDecls()` with a `RecursiveASTVisitor`. (PR #93461)

2024-05-29 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/93461 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Rewrite `getReferencedDecls()` with a `RecursiveASTVisitor`. (PR #93461)

2024-05-29 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand edited https://github.com/llvm/llvm-project/pull/93461 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Rewrite `getReferencedDecls()` with a `RecursiveASTVisitor`. (PR #93461)

2024-05-29 Thread Yitzhak Mandelbaum via cfe-commits
@@ -188,90 +188,97 @@ static MemberExpr *getMemberForAccessor(const CXXMemberCallExpr &C) { return nullptr; } -static void getReferencedDecls(const Decl &D, ReferencedDecls &Referenced) { - insertIfGlobal(D, Referenced.Globals); - insertIfFunction(D, Referenced.Functions)

[clang] [clang][dataflow] Rewrite `getReferencedDecls()` with a `RecursiveASTVisitor`. (PR #93461)

2024-05-29 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/93461 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][dataflow] Make `CNFFormula` externally accessible. (PR #92401)

2024-05-17 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/92401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-15 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand closed https://github.com/llvm/llvm-project/pull/91616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/91616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Yitzhak Mandelbaum via cfe-commits
@@ -476,7 +476,7 @@ runTypeErasedDataflowAnalysis( PrettyStackTraceAnalysis CrashInfo(ACFG, "runTypeErasedDataflowAnalysis"); std::optional MaybeStartingEnv; - if (InitEnv.callStackSize() == 1) { + if (InitEnv.callStackSize() == 0) { ymand wrote: aside:

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. Nice! https://github.com/llvm/llvm-project/pull/91616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Yitzhak Mandelbaum via cfe-commits
@@ -718,29 +730,46 @@ class Environment { void pushCallInternal(const FunctionDecl *FuncDecl, ArrayRef Args); + // FIXME: Add support for resetting globals after function calls to enable + // the implementation of sound analyses. + /// Assigns st

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand edited https://github.com/llvm/llvm-project/pull/91616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > I agree with the usefulness of storing the initial target separately, > reducing checks and branching based on whether the current target is a `Stmt` > or `Function`. Since I was touching everywhere `CallStack` was used anyway, I > went ahead with not pushing the starting `Funct

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-10 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand commented: I think we can do this without resorting to a pointer union and templating of the initialization functions, but it will take a little refactoring. First, notice that `stmt` doesn't make sense for the CallStack. The call stack serves two purposes -- to avoid

[clang] [llvm] [clang][dataflow] Make `SolverTest` a type-parameterized test. (PR #91455)

2024-05-08 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/91455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Allow `DataflowAnalysisContext` to use a non-owned `Solver`. (PR #91316)

2024-05-07 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/91316 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Allow `DataflowAnalysisContext` to use a non-owned `Solver`. (PR #91316)

2024-05-07 Thread Yitzhak Mandelbaum via cfe-commits
@@ -209,6 +221,9 @@ class DataflowAnalysisContext { using DenseMapInfo::isEqual; }; + DataflowAnalysisContext(Solver &S, std::unique_ptr OwnedSolver, ymand wrote: Please add comments either here or on the fields relating S and OwnedSolver. https://git

[clang] [clang][dataflow] Allow `DataflowAnalysisContext` to use a non-owned `Solver`. (PR #91316)

2024-05-07 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/91316 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Allow `DataflowAnalysisContext` to use a non-owned `Solver`. (PR #91316)

2024-05-07 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand edited https://github.com/llvm/llvm-project/pull/91316 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   7   >