[PATCH] D117563: [clang][dataflow] Remove obsolete FIXME

2022-01-18 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd7c19f947e0c: [clang][dataflow] Remove obsolete FIXME (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https

[PATCH] D117567: [clang][dataflow] Add a test to justify skipping past references in UO_Deref

2022-01-18 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A dataflow

[PATCH] D117567: [clang][dataflow] Add a test to justify skipping past references in UO_Deref

2022-01-18 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added a comment. I also think that we should prefer checking instantiations. We have a single Clang-Tidy check that works on templates and I believe this is the only special support that it needs. We can revisit that later and remove this support if it proves to be unnecessary. Reposit

[PATCH] D117567: [clang][dataflow] Add a test to justify skipping past references in UO_Deref

2022-01-18 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG68226e572f41: [clang][dataflow] Add a test to justify skipping past references in UO_Deref (authored by sgatev). Repository: rG LLVM Github Monore

[PATCH] D117567: [clang][dataflow] Add a test to justify skipping past references in UO_Deref

2022-01-18 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added a comment. Thanks for sharing this. I reverted the patch and will look at why it fails on Windows. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117567/new/ https://reviews.llvm.org/D117567 ___

[PATCH] D117567: [clang][dataflow] Add a test to justify skipping past references in UO_Deref

2022-01-19 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added a comment. @gribozavr2 suggested that this is probably because we use delayed template parsing on Windows for MSVC compatibility. I reproduced the error using the `--target=x86_64-windows-msvc` arg and verified that adding `-fno-delayed-template-parsing` arg fixes it. Repository:

[PATCH] D117667: [clang][dataflow] Add a transfer function for conditional operator

2022-01-19 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A dataflow

[PATCH] D117667: [clang][dataflow] Add a transfer function for conditional operator

2022-01-19 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8e53ae3d3719: [clang][dataflow] Add a transfer function for conditional operator (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D117754: [clang][dataflow] Intersect ExprToLoc when joining environments

2022-01-20 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A dataflow

[PATCH] D117754: [clang][dataflow] Intersect ExprToLoc when joining environments

2022-01-20 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 401581. sgatev marked an inline comment as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117754/new/ https://reviews.llvm.org/D117754 Files: clang/li

[PATCH] D117754: [clang][dataflow] Intersect ExprToLoc when joining environments

2022-01-20 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked an inline comment as done. sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:49 + // in tests. + std::set Preds; Preds.insert(Block.pred_begin(), Block.pred_end()); xazax.hun wrote: > xaza

[PATCH] D117754: [clang][dataflow] Intersect ExprToLoc when joining environments

2022-01-20 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked 2 inline comments as done. sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:49 + // in tests. + std::set Preds; Preds.insert(Block.pred_begin(), Block.pred_end()); xazax.hun wrote: > sgat

[PATCH] D117754: [clang][dataflow] Intersect ExprToLoc when joining environments

2022-01-20 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 401615. sgatev marked an inline comment as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117754/new/ https://reviews.llvm.org/D117754 Files: clang/li

[PATCH] D117754: [clang][dataflow] Intersect ExprToLoc when joining environments

2022-01-20 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked an inline comment as done. sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:49 + // in tests. + std::set Preds; Preds.insert(Block.pred_begin(), Block.pred_end()); xazax.hun wrote: > sgat

[PATCH] D117754: [clang][dataflow] Intersect ExprToLoc when joining environments

2022-01-20 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc95cb4de1b66: [clang][dataflow] Intersect ExprToLoc when joining environments (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117754/new/

[PATCH] D118038: [clang][dataflow] Enable merging distinct values in Environment::join

2022-01-24 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. Make specializations of `DataflowAnalysis` extendable with domain-specific logic for merging

[PATCH] D118038: [clang][dataflow] Enable merging distinct values in Environment::join

2022-01-24 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 402490. sgatev added a comment. Add missing include. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118038/new/ https://reviews.llvm.org/D118038 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalys

[PATCH] D118038: [clang][dataflow] Enable merging distinct values in Environment::join

2022-01-24 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 402529. sgatev marked an inline comment as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118038/new/ https://reviews.llvm.org/D118038 Files: clang/in

[PATCH] D118038: [clang][dataflow] Enable merging distinct values in Environment::join

2022-01-24 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added a comment. Right. To model the behavior of a language feature (e.g. a simple model that tracks whether a `std::optional` value is engaged) clients can attach properties to symbolic values and decide how distinct values are joined. This doesn't completely rule out the possibility of

[PATCH] D118038: [clang][dataflow] Enable merging distinct values in Environment::join

2022-01-24 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 402550. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118038/new/ https://reviews.llvm.org/D118038 Files: clang/include/clang/Analysis/FlowSensitive/Datafl

[PATCH] D118038: [clang][dataflow] Enable merging distinct values in Environment::join

2022-01-24 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked an inline comment as done. sgatev added a comment. Yes, I think we should be able to propagate properties across copy and move operations in the framework. Clients can override this behavior by modeling the copy and move operations and storing different values in the environment.

[PATCH] D118119: [clang][dataflow] Add a transfer function for InitListExpr

2022-01-25 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A

[PATCH] D118119: [clang][dataflow] Add a transfer function for InitListExpr

2022-01-25 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 402840. sgatev marked an inline comment as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118119/new/ https://reviews.llvm.org/D118119 Files: clang/in

[PATCH] D118119: [clang][dataflow] Add a transfer function for InitListExpr

2022-01-25 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:421 +QualType Type = S->getType(); +assert(Type->isStructureOrClassType()); + xazax.hun wrote: > Why do we expect this assertion to be true? Aren't `InitListExpr`s als

[PATCH] D118119: [clang][dataflow] Add a transfer function for InitListExpr

2022-01-25 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG64ba462b6e39: [clang][dataflow] Add a transfer function for InitListExpr (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D118226: [clang][dataflow] Assign aggregate storage locations to union stmts

2022-01-26 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This patch ensures that the dataflow analysis framework does not crash when it enco

[PATCH] D118226: [clang][dataflow] Assign aggregate storage locations to union stmts

2022-01-26 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG188d28f73cc7: [clang][dataflow] Assign aggregate storage locations to union stmts (authored by sgatev). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D118038: [clang][dataflow] Enable merging distinct values in Environment::join

2022-01-26 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd3597ec0aaad: [clang][dataflow] Enable merging distinct values in Environment::join (authored by sgatev). Changed prior to commit: https://reviews.llvm.org/D118038?vs=402550&id=403201#toc Repository:

[PATCH] D118236: [clang][dataflow] Add a transfer function for CXXBoolLiteralExpr

2022-01-26 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A

[PATCH] D118178: [clang][dataflow] Allow clients to disable built-in transfer functions.

2022-01-26 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev accepted this revision. sgatev added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h:44 class TypeErasedDataflowAnalysis { + // Determines whether to apply the built-in

[PATCH] D118236: [clang][dataflow] Add a transfer function for CXXBoolLiteralExpr

2022-01-26 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG75c22b382f2a: [clang][dataflow] Add a transfer function for CXXBoolLiteralExpr (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D118480: [clang][dataflow] Merge distinct pointer values in Environment::join

2022-01-28 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A

[PATCH] D118480: [clang][dataflow] Merge distinct pointer values in Environment::join

2022-01-29 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked 2 inline comments as done. sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:114 +if (auto *FirstVal = dyn_cast(Val)) { + auto *SecondVal = cast(It->second); xazax.hun wrote: > xazax.hun wr

[PATCH] D118480: [clang][dataflow] Merge distinct pointer values in Environment::join

2022-01-29 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG56cc69732344: [clang][dataflow] Merge distinct pointer values in Environment::join (authored by sgatev). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-01-31 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. Make specializations of `DataflowAnalysis` extendable with domain-specific logic fo

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-01-31 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 404743. sgatev added a comment. Reformat code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118596/new/ https://reviews.llvm.org/D118596 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-02-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 404886. sgatev marked an inline comment as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118596/new/ https://reviews.llvm.org/D118596 Files: clang/in

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-02-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 404888. sgatev added a comment. Update comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118596/new/ https://reviews.llvm.org/D118596 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-02-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added a comment. Mentioned the breaking interface change in the description. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:151 -if (auto *FirstVal = dyn_cast(Val)) { - auto *SecondVal = cast(It->second); - if (&FirstVal->getPointeeL

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-02-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 404890. sgatev added a comment. Update comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118596/new/ https://reviews.llvm.org/D118596 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-02-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 404923. sgatev marked an inline comment as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118596/new/ https://reviews.llvm.org/D118596 Files: clang/in

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-02-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:64 +/// +/// `Val1` must be assigned to a storage location of type `Type`. +/// ymandel wrote: > What does this comment mean, now that there's

[PATCH] D118596: [clang][dataflow] Enable comparison of distinct values in Environment

2022-02-01 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6b8800dfb5c9: [clang][dataflow] Enable comparison of distinct values in Environment (authored by sgatev). Repository: rG LLVM Github Monorepo CHA

[PATCH] D120149: [clang][dataflow] Add support for global storage values

2022-02-18 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A

[PATCH] D120149: [clang][dataflow] Add support for global storage values

2022-02-18 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 410014. sgatev marked 3 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120149/new/ https://reviews.llvm.org/D120149 Files: clang/li

[PATCH] D120149: [clang][dataflow] Add support for global storage values

2022-02-18 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked an inline comment as done. sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:80 + +/// Initializes global storage values in sub-expressions of `S`. +static void initGlobalVars(const Stmt &S, Environment &Env) { --

[PATCH] D120149: [clang][dataflow] Add support for global storage values

2022-02-18 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked 2 inline comments as done. sgatev added a comment. I think we should provide such functionality and it probably should also apply to some of the pointer and reference values. Not sure what the default should be, but having the ability to choose the level of soundness for certain a

[PATCH] D120149: [clang][dataflow] Add support for global storage values

2022-02-18 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 410041. sgatev marked an inline comment as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120149/new/ https://reviews.llvm.org/D120149 Files: clang/li

[PATCH] D120289: [clang][dataflow] Add SAT solver interface and implementation

2022-02-21 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, mstorsjo, rnkovacs, mgorny. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis frame

[PATCH] D120289: [clang][dataflow] Add SAT solver interface and implementation

2022-02-21 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 410460. sgatev marked 6 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120289/new/ https://reviews.llvm.org/D120289 Files: clang/in

[PATCH] D120289: [clang][dataflow] Add SAT solver interface and implementation

2022-02-21 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Solver.h:39 + /// All elements in `Vals` must be non-null. + virtual Result solve(llvm::DenseSet Vals) = 0; +}; ymandel wrote: > Which `Result` is expected if the `Solver` giv

[PATCH] D120149: [clang][dataflow] Add support for global storage values

2022-02-22 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 410580. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120149/new/ https://reviews.llvm.org/D120149 Files: clang/include/clang/Analysis/FlowSensitive/Datafl

[PATCH] D120289: [clang][dataflow] Add SAT solver interface and implementation

2022-02-22 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added a comment. > Did you look into reusing existing SAT solvers like miniSAT? What was the > main reason for rolling our own instead of picking something up off the > shelves? Mainly to provide a lightweight out-of-the-box alternative. The solver interface is simple so one should be a

[PATCH] D120149: [clang][dataflow] Add support for global storage values

2022-02-23 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7ea103de140b: [clang][dataflow] Add support for global storage values (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120149/new/ https:

[PATCH] D120414: [clang][dataflow] Update StructValue child when assigning a value

2022-02-23 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. When assigning a value to a storage location of a struct member we need to also upd

[PATCH] D120289: [clang][dataflow] Add SAT solver interface and implementation

2022-02-23 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added a comment. In D120289#3338262 , @xazax.hun wrote: > In D120289#3338244 , @sgatev wrote: > >>> I wonder if it would make sense to have a SAT base class for the SMT API >>> and reuse that here? >> >> I

[PATCH] D120414: [clang][dataflow] Update StructValue child when assigning a value

2022-02-24 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGbaa0f221d6df: [clang][dataflow] Update StructValue child when assigning a value (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D120495: [clang][dataflow] Add transfer functions for structured bindings

2022-02-24 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A

[PATCH] D120289: [clang][dataflow] Add SAT solver interface and implementation

2022-02-25 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 411400. sgatev marked 5 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120289/new/ https://reviews.llvm.org/D120289 Files: clang/in

[PATCH] D120289: [clang][dataflow] Add SAT solver interface and implementation

2022-02-25 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added a comment. > Are there plans to get a model/assignment of the variables from the solver? > That could be helpful for generating warning messages in the future :) Absolutely! That was only discussed briefly so far. One challenge would be distilling this model to present only relevan

[PATCH] D120289: [clang][dataflow] Add SAT solver interface and implementation

2022-02-25 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG53dcd9efd16f: [clang][dataflow] Add SAT solver interface and implementation (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs, mgorny. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 412034. sgatev added a comment. Minor changes to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120711/new/ https://reviews.llvm.org/D120711 Files: clang/include/clang/Analysis/FlowSensitive/Dataflow

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 412160. sgatev marked 8 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120711/new/ https://reviews.llvm.org/D120711 Files: clang/in

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:41 + /// + /// `Slvr` must not be null. + DataflowAnalysisContext(std::unique_ptr Slvr) xazax.hun wrote: > ymandel wrote: > > I think `S` would be

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 412162. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120711/new/ https://reviews.llvm.org/D120711 Files: clang/include/clang/Analysis/FlowSensitive/Datafl

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 412256. sgatev added a comment. Herald added a project: All. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120711/new/ https://reviews.llvm.org/D120711 Files: clang/include/clang/

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked 2 inline comments as done. sgatev added a comment. Thanks! Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:43 + + auto Res = ConjunctionVals.try_emplace( + std::move(Key), ymandel wrote: > xazax.hun wrote: > > As far

[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

2022-03-02 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGae60884dfe16: [clang][dataflow] Add flow condition constraints to Environment (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D120890: [clang][dataflow] Add a lattice to track source locations.

2022-03-03 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev accepted this revision. sgatev added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/Analysis/FlowSensitive/SourceLocationsLattice.h:13 + +#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_SOURCELOCATIONS_LATTICE_H_ +#define LLVM_

[PATCH] D120890: [clang][dataflow] Add a lattice to track source locations.

2022-03-03 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/SourceLocationsLattice.h:26 + +// Lattice for dataflow analysis that keeps track of a set of source locations. +// Doc comments start with `///`. Comment at:

[PATCH] D120890: [clang][dataflow] Add a lattice to track source locations.

2022-03-03 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev accepted this revision. sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/SourceLocationsLattice.h:56 +// Returns a string that represents the source locations of the lattice. +std::string DebugString(const SourceLocationsLattice &Lattic

[PATCH] D120984: [clang][dataflow] Extend flow conditions from block terminators

2022-03-04 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow ana

[PATCH] D120984: [clang][dataflow] Extend flow conditions from block terminators

2022-03-04 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 412969. sgatev added a comment. Minor tweaks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120984/new/ https://reviews.llvm.org/D120984 Files: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h

[PATCH] D120984: [clang][dataflow] Extend flow conditions from block terminators

2022-03-07 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 413426. sgatev marked 5 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120984/new/ https://reviews.llvm.org/D120984 Files: clang/in

[PATCH] D120984: [clang][dataflow] Extend flow conditions from block terminators

2022-03-07 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:99 + const Environment &Env2, Value &MergedVal, + Environment &Env) { return false; xazax.hun wrote: > `M

[PATCH] D120984: [clang][dataflow] Extend flow conditions from block terminators

2022-03-07 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 413523. sgatev marked an inline comment as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120984/new/ https://reviews.llvm.org/D120984 Files: clang/in

[PATCH] D120984: [clang][dataflow] Extend flow conditions from block terminators

2022-03-07 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:90 + void VisitBinaryOperator(const BinaryOperator *S) { +auto *LHS = S->getLHS()->IgnoreParenImpCasts(); +assert(LHS != nullptr); xazax.hun wrote:

[PATCH] D120984: [clang][dataflow] Extend flow conditions from block terminators

2022-03-07 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1e5715857abd: [clang][dataflow] Extend flow conditions from block terminators (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D121197: [clang][dataflow] Add analysis that detects unsafe accesses to optionals

2022-03-08 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs, mgorny. Herald added a project: All. sgatev requested review of this revision. Herald added a reviewer: jdoerfert. Herald added a subscriber: sstefan1. Heral

[PATCH] D121197: [clang][dataflow] Add analysis that detects unsafe accesses to optionals

2022-03-08 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 413743. sgatev added a comment. Mark functions as static and add TODOs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121197/new/ https://reviews.llvm.org/D121197 Files: clang/include/clang/Analysis/FlowSens

[PATCH] D121197: [clang][dataflow] Add analysis that detects unsafe accesses to optionals

2022-03-08 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 413852. sgatev marked 2 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121197/new/ https://reviews.llvm.org/D121197 Files: clang/i

[PATCH] D121197: [clang][dataflow] Add analysis that detects unsafe accesses to optionals

2022-03-08 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h:20 +/// +/// FIXME: Consider separating the models from the unchecked access analysis. +class UncheckedOptionalAccessModel ymandel wrote: >

[PATCH] D116368: [clang][dataflow] Add transfer function for VarDecl statements

2021-12-30 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 396660. sgatev marked 12 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116368/new/ https://reviews.llvm.org/D116368 Files: clang/i

[PATCH] D116368: [clang][dataflow] Add transfer function for VarDecl statements

2021-12-30 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:61 + /// `D` must not be assigned a storage location. + void setStorageLocation(const VarDecl &D, StorageLocation &Loc) { +assert(VarDeclToLoc.find(&D) == VarDec

[PATCH] D116368: [clang][dataflow] Add transfer function for VarDecl statements

2021-12-30 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 396668. sgatev added a comment. Canonicalize types. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116368/new/ https://reviews.llvm.org/D116368 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysi

[PATCH] D116370: [clang][dataflow] Add multi-variable constant propagation example.

2021-12-30 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp:9 +// +// This file defines a simplistic version of Constant Propagation as an example +// of a forward, monotonic dataflow analysis. The analysis tracks all

[PATCH] D116368: [clang][dataflow] Add transfer function for VarDecl statements

2021-12-31 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 396778. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116368/new/ https://reviews.llvm.org/D116368 Files: clang/include/clang/Analysis/FlowSensitive/Datafl

[PATCH] D116368: [clang][dataflow] Add transfer function for VarDecl statements

2021-12-31 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked 4 inline comments as done. sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:32 +template +bool denseMapsAreEqual(const llvm::DenseMap &Map1, + const llvm::DenseMap &Map2) { xaz

[PATCH] D116368: [clang][dataflow] Add transfer function for VarDecl statements

2022-01-01 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked 3 inline comments as done. sgatev added a comment. Thanks for the reviews! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116368/new/ https://reviews.llvm.org/D116368 ___ cfe-commits mailing

[PATCH] D116370: [clang][dataflow] Add multi-variable constant propagation example.

2022-01-02 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev accepted this revision. sgatev added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp:171-173 + Vars[Var] = (E->EvaluateAsInt(R, Context) && R.Val.isInt()) + ? ValueLattice(R.Val.getInt().get

[PATCH] D116368: [clang][dataflow] Add transfer function for VarDecl statements

2022-01-04 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGaf7bc39ba17d: [clang][dataflow] Add transfer function for VarDecl statements (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D116596: [clang][dataflow] Add transfer functions for assignment

2022-01-04 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added a subscriber: rnkovacs. sgatev requested review of this revision. Herald added a project: clang. This is part of the implementation of the dataflow analysis framework. See "[RFC] A dataflow analysis

[PATCH] D116596: [clang][dataflow] Add transfer functions for assignment

2022-01-04 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 397275. sgatev added a comment. Extend TransferTest. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116596/new/ https://reviews.llvm.org/D116596 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalys

[PATCH] D116596: [clang][dataflow] Add transfer functions for assignment

2022-01-05 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 397508. sgatev marked 3 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116596/new/ https://reviews.llvm.org/D116596 Files: clang/in

[PATCH] D116596: [clang][dataflow] Add transfer functions for assignment

2022-01-05 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:34 +/// storage locations or values. +enum class SkipPast { + /// No indirections should be skipped past. xazax.hun wrote: > I am just wondering if this is

[PATCH] D116834: [clang][dataflow] Change `transfer` function to update lattice element in place.

2022-01-09 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev accepted this revision. sgatev added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:167 - FunctionCallLattice transfer(const Stmt *S, const FunctionCallLattice &E,

[PATCH] D116596: [clang][dataflow] Add transfer functions for assignment

2022-01-10 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 398629. sgatev marked 8 inline comments as done. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116596/new/ https://reviews.llvm.org/D116596 Files: clang/in

[PATCH] D116596: [clang][dataflow] Add transfer functions for assignment

2022-01-10 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:36 +/// FIXME: Consider replacing this with a model that is more aligned with C++ +/// value categories. +enum class SkipPast { xazax.hun wrote: > ymandel w

[PATCH] D116596: [clang][dataflow] Add transfer functions for assignment

2022-01-10 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe7481f6ee591: [clang][dataflow] Add transfer functions for assignment (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

<    1   2   3   4   >