[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]

[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

[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? >> >>

[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

[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/

[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

[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:

[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`

[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:

[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

[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:

[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

[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 , Environment ) {

[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:

[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]

[PATCH] D119953: [clang][dataflow] Add transfer functions for logical and, or, not.

2022-02-17 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 rGdd4dde8d39a9: [clang][dataflow] Add transfer functions for logical and, or, not. (authored by sgatev). Repository: rG LLVM Github Monorepo

[PATCH] D119953: [clang][dataflow] Add transfer functions for logical and, or, not.

2022-02-16 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Value.h:39 +// represent conjunctions, disjunctions, and negations. +AtomicBoolValue, +BoolConjunctionValue, xazax.hun wrote: > Do we need `Value` in the `Kind` if

[PATCH] D119953: [clang][dataflow] Add transfer functions for logical and, or, not.

2022-02-16 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 409330. 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/D119953/new/ https://reviews.llvm.org/D119953 Files:

[PATCH] D119953: [clang][dataflow] Add transfer functions for logical and, or, not.

2022-02-16 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 409296. sgatev added a comment. Remove unnecessary IgnoreParens calls. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119953/new/ https://reviews.llvm.org/D119953 Files:

[PATCH] D119953: [clang][dataflow] Add transfer functions for logical and, or, not.

2022-02-16 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]

[PATCH] D119447: [clang][dataflow] Include terminator statements in buildStmtToBasicBlockMap

2022-02-11 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 rG87c32be023d2: [clang][dataflow] Include terminator statements in buildStmtToBasicBlockMap (authored by sgatev). Repository: rG LLVM Github

[PATCH] D119447: [clang][dataflow] Include terminator statements in buildStmtToBasicBlockMap

2022-02-10 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 will be necessary later when we add support for evaluating logic expressions

[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

[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
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:

[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 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 (>getPointeeLoc() ==

[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 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:

[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-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

[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

[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

[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]

[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] 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

[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]

[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=403201#toc Repository:

[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

[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

[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] 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

[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:

[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]

[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] 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:

[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

[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:

[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:

[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] 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

[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: >

[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:

[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: >

[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: >

[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:

[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] 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

[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] 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.

[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-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

[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.

[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] 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

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

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. The FIXME is no longer relevant as ControlFlowContext centralizes the construction of the

[PATCH] D117496: [clang][dataflow] Add transfer function for addrof

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. sgatev marked an inline comment as done. Closed by commit rG59e031ff9057: [clang][dataflow] Add transfer function for addrof (authored by sgatev). Repository: rG

[PATCH] D117496: [clang][dataflow] Add transfer function for addrof

2022-01-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/Transfer.cpp:190 Env.setValue(Loc, Env.takeOwnership(std::make_unique( SubExprVal->getPointeeLoc(; + break;

[PATCH] D117493: [clang][dataflow] Replace initValueInStorageLocation with createValue

2022-01-17 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 rG782eced56149: [clang][dataflow] Replace initValueInStorageLocation with createValue (authored by sgatev). Herald added a subscriber: steakhal.

[PATCH] D117496: [clang][dataflow] Add transfer function for addrof

2022-01-17 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] D117493: [clang][dataflow] Replace initValueInStorageLocation with createValue

2022-01-17 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. Since Environment's setValue method already does part of the work that initValueInStorageLocation

[PATCH] D117339: [clang][dataflow] Add transfer functions for bind temporary and static cast

2022-01-16 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 rG37e6496c800b: [clang][dataflow] Add transfer functions for bind temporary and static cast (authored by sgatev). Repository: rG LLVM Github

[PATCH] D117339: [clang][dataflow] Add transfer functions for bind temporary and static cast

2022-01-16 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 400392. 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/D117339/new/ https://reviews.llvm.org/D117339 Files:

[PATCH] D117339: [clang][dataflow] Add transfer functions for bind temporary and static cast

2022-01-14 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/Transfer.cpp:90 void VisitDeclStmt(const DeclStmt *S) { -// FIXME: Add support for group decls, e.g: `int a, b;` -if (S->isSingleDecl()) { - if

[PATCH] D117339: [clang][dataflow] Add transfer functions for bind temporary and static cast

2022-01-14 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] D117218: [clang][dataflow] Add transfer functions for constructors

2022-01-14 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7d941d6d21e9: [clang][dataflow] Add transfer functions for constructors (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117218/new/

[PATCH] D117218: [clang][dataflow] Add transfer functions for constructors

2022-01-14 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:105 - assert(SubExpr != nullptr); +if (S->getCastKind() == CK_LValueToRValue) { auto *SubExprVal = Env.getValue(*SubExpr, SkipPast::Reference); ymandel

[PATCH] D117218: [clang][dataflow] Add transfer functions for constructors

2022-01-14 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 399968. 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/D117218/new/ https://reviews.llvm.org/D117218 Files:

[PATCH] D117218: [clang][dataflow] Add transfer functions for constructors

2022-01-13 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:1362 + LangStandard::lang_cxx17); +} + xazax.hun wrote: > I think this changed from 14 to 17 in the last revision. Is this intentional? Not intentional. Thanks

[PATCH] D117218: [clang][dataflow] Add transfer functions for constructors

2022-01-13 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 399714. 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/D117218/new/ https://reviews.llvm.org/D117218 Files:

[PATCH] D117218: [clang][dataflow] Add transfer functions for constructors

2022-01-13 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 399707. 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/D117218/new/ https://reviews.llvm.org/D117218 Files:

[PATCH] D117218: [clang][dataflow] Add transfer functions for constructors

2022-01-13 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/Transfer.cpp:114 +} else if (S->getCastKind() == CK_NoOp) { + auto *SubExprLoc = Env.getStorageLocation(*SubExpr, SkipPast::None); + if (SubExprLoc

[PATCH] D117218: [clang][dataflow] Add transfer functions for constructors

2022-01-13 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] D117123: [clang][dataflow] Add transfer functions for initializers

2022-01-12 Thread Stanislav Gatev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. sgatev marked an inline comment as done. Closed by commit rG963f40051a42: [clang][dataflow] Add transfer functions for initializers (authored by sgatev). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D117123: [clang][dataflow] Add transfer functions for initializers

2022-01-12 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/Transfer.cpp:171 + +Value *InitExprVal = Env.getValue(*InitExpr, SkipPast::None); +if (InitExprVal == nullptr) ymandel wrote: > why

[PATCH] D117123: [clang][dataflow] Add transfer functions for initializers

2022-01-12 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] D117012: [clang][dataflow] Add transfer functions for data members and this pointers

2022-01-11 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 rG99f7d55c: [clang][dataflow] Add transfer functions for data members and this pointers (authored by sgatev). Repository: rG LLVM Github

[PATCH] D117012: [clang][dataflow] Add transfer functions for data members and this pointers

2022-01-11 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 399219. sgatev added a comment. Address reviewers' comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117012/new/ https://reviews.llvm.org/D117012 Files:

[PATCH] D117012: [clang][dataflow] Add transfer functions for data members and this pointers

2022-01-11 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev added a comment. Thank you both for the reviews! Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:52 + setStorageLocation(*ParamDecl, ParamLoc); + initValueInStorageLocation(ParamLoc, ParamDecl->getType()); +} xazax.hun

[PATCH] D117012: [clang][dataflow] Add transfer functions for data members and this pointers

2022-01-11 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 399094. 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/D117012/new/ https://reviews.llvm.org/D117012 Files:

[PATCH] D117012: [clang][dataflow] Add transfer functions data members and this pointers

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

[PATCH] D117012: [clang][dataflow] Add transfer functions data members and this pointers

2022-01-11 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-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

[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

[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:

[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 , -

[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

[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:

[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:

[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

<    1   2   3   4   >