[PATCH] D128521: [clang][dataflow] Implement functionality to compare if two boolean values are equivalent.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:138 +bool DataflowAnalysisContext::equivalentBoolValues(BoolValue , + BoolValue ) { sgatev wrote: > This seems

[PATCH] D128363: [clang][dataflow] Implement functionality for flow condition variable substitution.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439810. wyt marked 2 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128363/new/ https://reviews.llvm.org/D128363 Files:

[PATCH] D128519: [clang][dataflow] Move logic for creating implication and iff expressions into `DataflowAnalysisContext` from `DataflowEnvironment`.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439761. wyt marked 2 inline comments as done. wyt added a comment. Address comments - rename createIff/Implication to getOrCreateIff/Implication and add tests for these functions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D128521: [clang][dataflow] Implement functionality to compare if two boolean values are equivalent.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439762. wyt added a comment. Rename createIff to getOrCreateIff based on change in parent patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128521/new/ https://reviews.llvm.org/D128521 Files:

[PATCH] D128521: [clang][dataflow] Implement functionality to compare if two boolean values are equivalent.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439899. wyt added a comment. Propagate change from parent patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128521/new/ https://reviews.llvm.org/D128521 Files:

[PATCH] D128520: [clang][dataflow] Refactor function that queries the solver for satisfiability checking.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439898. wyt marked an inline comment as done. wyt added a comment. Rename `checkUnsatisfiable` to `isUnsatisfiable` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128520/new/ https://reviews.llvm.org/D128520

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 442845. wyt added a comment. Fix comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129180/new/ https://reviews.llvm.org/D129180 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 442848. wyt added a comment. Replace std::optional with llvm::Optional Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129180/new/ https://reviews.llvm.org/D129180 Files:

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 442828. wyt added a comment. Make scope resolution consistent (Solver:: instead of WatchedLiteralsSolver::). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129180/new/ https://reviews.llvm.org/D129180 Files:

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 442825. wyt marked 3 inline comments as done. wyt added a comment. Typo fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129180/new/ https://reviews.llvm.org/D129180 Files:

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 442824. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129180/new/ https://reviews.llvm.org/D129180 Files:

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 442840. wyt marked 3 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129180/new/ https://reviews.llvm.org/D129180 Files:

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 442874. wyt added a comment. Remove decomposing declarations which are not available in llvm. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129180/new/ https://reviews.llvm.org/D129180 Files:

[PATCH] D128359: [clang][dataflow] Move logic for `createStorageLocation` from `DataflowEnvironment` to `DataflowAnalysisContext`.

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 440123. wyt marked an inline comment as done. wyt added a comment. Fix comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128359/new/ https://reviews.llvm.org/D128359 Files:

[PATCH] D128363: [clang][dataflow] Implement functionality for flow condition variable substitution.

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 440119. wyt marked an inline comment as done. wyt added a comment. Address comments - add example to `buildAndSubstituteFlowCondition` doc comment, add tests for atomic and negated flow condition. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 440162. wyt marked 2 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128056/new/ https://reviews.llvm.org/D128056 Files:

[PATCH] D128659: [clang][dataflow] Add `buildAndSubstituteFlowCondition` to `DataflowEnvironment`

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Depends On D128658 Repository: rG

[PATCH] D128658: [clang][dataflow] Ensure atomic boolean values representing true and false are not replaced in `buildAndSubstituteFlowCondition`

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D128658

[PATCH] D128659: [clang][dataflow] Add `buildAndSubstituteFlowCondition` to `DataflowEnvironment`

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 440336. wyt added a comment. Propagate change from parent patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128659/new/ https://reviews.llvm.org/D128659 Files:

[PATCH] D128658: [clang][dataflow] Do not allow substitution of true/false boolean literals in `buildAndSubstituteFlowCondition`

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 440341. wyt added a comment. Add assert message. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128658/new/ https://reviews.llvm.org/D128658 Files: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp

[PATCH] D128658: [clang][dataflow] Do not allow substitution of true/false boolean literals in `buildAndSubstituteFlowCondition`

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 440333. wyt added a comment. Add macro for only testing asserts in debug mode. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128658/new/ https://reviews.llvm.org/D128658 Files:

[PATCH] D128659: [clang][dataflow] Add `buildAndSubstituteFlowCondition` to `DataflowEnvironment`

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 440305. wyt added a comment. Fix comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128659/new/ https://reviews.llvm.org/D128659 Files: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h

[PATCH] D128658: [clang][dataflow] Ensure atomic boolean values representing true and false are not replaced in `buildAndSubstituteFlowCondition`

2022-06-27 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 440304. wyt added a comment. Assert that user does not try to substitute true/false booleans. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128658/new/ https://reviews.llvm.org/D128658 Files:

[PATCH] D128363: [clang][dataflow] Implement functionality for flow condition variable substitution.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439719. wyt marked an inline comment as done. wyt added a comment. Address comments - improve test clarity by comparing substituted flow condition with an expected value using `equivalentBoolValues` utility. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D128359: [clang][dataflow] Move logic for `createStorageLocation` from `DataflowEnvironment` to `DataflowAnalysisContext`.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439720. wyt marked 5 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128359/new/ https://reviews.llvm.org/D128359 Files:

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439721. wyt marked 5 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128056/new/ https://reviews.llvm.org/D128056 Files:

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:252-255 + // FIXME: The pointer values are indexed by the pointee types which are + // required to initialize the `PointeeLoc` field in `PointerValue`. Consider + //

[PATCH] D128363: [clang][dataflow] Implement functionality for flow condition variable substitution.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt marked 3 inline comments as done. wyt added a comment. @xazax.hun > Could you elaborate on why do we need this? We are currently working on a pointer nullability analysis here: https://github.com/google/crubit/tree/main/nullability_verification. One of the things we are trying to do is to

[PATCH] D128359: [clang][dataflow] Move logic for `createStorageLocation` from `DataflowEnvironment` to `DataflowAnalysisContext`.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439730. wyt marked 3 inline comments as done. wyt added a comment. Fix comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128359/new/ https://reviews.llvm.org/D128359 Files:

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443905. wyt added a comment. Extract recursion into boolean subvalues into separate statements to enforce order of evaluation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129547/new/

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443868. wyt added a comment. Update CMakeList for DebugSupportTest.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129547/new/ https://reviews.llvm.org/D129547 Files:

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun, mgorny. Herald added a reviewer: NoQ. Herald added a project: All. wyt requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. Depends On D129546

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, mgrang, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Depends On D129547

[PATCH] D129546: [clang][dataflow] Refactor boolean creation as a test utility.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D129546

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443917. wyt added a comment. Use std::vector as input to `debugString` to maintain order stability of boolean constraints to enable testing. `debugString` which takes a `llvm::DenseSet` is now a wrapper around the logic applied to std::vector. Repository:

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443914. wyt added a comment. Minor fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129547/new/ https://reviews.llvm.org/D129547 Files: clang/docs/tools/clang-formatted-files.txt

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443941. wyt marked 2 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129548/new/ https://reviews.llvm.org/D129548 Files:

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443968. wyt added a comment. Fix use after move. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129547/new/ https://reviews.llvm.org/D129547 Files: clang/docs/tools/clang-formatted-files.txt

[PATCH] D129568: [clang][dataflow] Rename `Status` field in a `Solver::Result` struct to `SATCheckStatus`.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Previously, `Status` was named after the enum

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443940. wyt marked 10 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129547/new/ https://reviews.llvm.org/D129547 Files:

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443947. wyt added a comment. Fix comment, remove unused import. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129548/new/ https://reviews.llvm.org/D129548 Files:

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443971. wyt added a comment. Remove unnecessary enum keyword. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129548/new/ https://reviews.llvm.org/D129548 Files:

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443983. wyt added a comment. Change propagated from parent patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129548/new/ https://reviews.llvm.org/D129548 Files:

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443982. wyt added a comment. Move `DebugStringGenerator` class into anonymous namespace. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129547/new/ https://reviews.llvm.org/D129547 Files:

[PATCH] D129546: [clang][dataflow] Refactor boolean creation as a test utility.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 443938. wyt marked 2 inline comments as done. wyt added a comment. Address comments on renaming. Removed test fixture class, replacing TEST_F with TEST. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129546/new/

[PATCH] D129546: [clang][dataflow] Refactor boolean creation as a test utility.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 444026. wyt marked an inline comment as done. wyt added a comment. Address comments: add used import, remove unused imports. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129546/new/

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 444029. wyt marked an inline comment as done. wyt added a comment. Address comment on renaming parameter. Add const qualifier to BoolValue input to debugString. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 444030. wyt marked 3 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129548/new/ https://reviews.llvm.org/D129548 Files:

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt added a comment. Comment at: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp:119-133 +std::vector> LinesData; +for (auto : AtomAssignments) { + auto Name = getAtomName(AtomAssignment.first); + MaxNameLength = std::max(MaxNameLength, Name.size()); +

[PATCH] D129546: [clang][dataflow] Refactor boolean creation as a test utility.

2022-07-12 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 444031. wyt added a comment. Removed unused imports in SolverTest.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129546/new/ https://reviews.llvm.org/D129546 Files:

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-06 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-22 Thread weiyi via Phabricator via cfe-commits
wyt marked an inline comment as done. wyt added a comment. @xazax.hun > Since you always want this function to create a null pointer value, I think > it would be less error prone to ask for the location instead of an arbitrary > value. Currently, a confused caller could put a non-null value

[PATCH] D128357: [clang][dataflow] Store flow condition constraints in a single `FlowConditionConstraints` map.

2022-06-22 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. A flow condition is represented with an atomic boolean token, and it is

[PATCH] D128359: [clang][dataflow] Move logic for `createStorageLocation` from `DataflowEnvironment` to `DataflowAnalysisContext`.

2022-06-22 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. `createStorageLocation` in `DataflowEnvironment` is now a trivial wrapper

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-22 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439078. wyt added a comment. Use QualType as key to singleton map, implement getOrCreate factory function for retrieving null pointer values. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128056/new/

[PATCH] D128363: [clang][dataflow] Implement functionality for flow condition variable substitution.

2022-06-22 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch introduces `buildAndSubstituteFlowCondition` - given a flow

[PATCH] D128357: [clang][dataflow] Store flow condition constraints in a single `FlowConditionConstraints` map.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 439714. wyt marked 3 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128357/new/ https://reviews.llvm.org/D128357 Files:

[PATCH] D128520: [clang][dataflow] Refactor function that queries the solver for satisfiability checking.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Given a set of `Constraints`, `querySolver` adds common background

[PATCH] D128519: [clang][dataflow] Move logic for creating implication and iff expressions into `DataflowAnalysisContext` from `DataflowEnvironment`.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. To keep functionality of creating boolean expressions in a consistent

[PATCH] D128521: [clang][dataflow] Implement functionality to compare if two boolean values are equivalent.

2022-06-24 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. `equivBoolVals` compares equivalence between two booleans. The current

[PATCH] D127196: [clang][dataflow] Enable use of synthetic properties on all Value instances.

2022-06-08 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 435121. wyt added a comment. Remove cast to StructValues since get/setProperty can be used directly on Values now Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127196/new/ https://reviews.llvm.org/D127196 Files:

[PATCH] D127196: [clang][dataflow] Enable use of synthetic properties on all Value instances.

2022-06-08 Thread weiyi via Phabricator via cfe-commits
wyt marked 2 inline comments as done. wyt added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Value.h:29 /// Base class for all values computed by abstract interpretation. +/// All Value instances should be separately allocated and stored by pointer

[PATCH] D127312: [clang][dataflow] Move PointeeLoc field from IndirectionValue into PointerValue and ReferenceValue classes

2022-06-08 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: tschuett, steakhal, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D127312

[PATCH] D127312: [clang][dataflow] Remove IndirectionValue class, moving PointeeLoc field into PointerValue and ReferenceValue

2022-06-08 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 435271. wyt marked 2 inline comments as done. wyt added a comment. Rename function as suggested Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127312/new/ https://reviews.llvm.org/D127312 Files:

[PATCH] D127196: [clang][dataflow] Enable use of synthetic properties on all Value instances.

2022-06-07 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: tschuett, steakhal, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch moves the implementation of synthetic properties from the

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-17 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When a `nullptr` is assigned to a pointer variable, it is wrapped in a

[PATCH] D127745: [clang][dataflow] Rename `getPointeeLoc` to `getReferencePointeeLoc` and `getPointerPointeeLoc` respectively for ReferenceValue and PointerValue.

2022-06-14 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 436816. wyt added a comment. Modified renaming: getPointeeLoc of ReferenceValue is modified to getReferentLoc, getPointeeLoc remains unchanged for PointerValue Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D127745: [clang][dataflow] Rename `getPointeeLoc` to `getReferentLoc` for ReferenceValue.

2022-06-14 Thread weiyi via Phabricator via cfe-commits
wyt added a comment. In D127745#3582085 , @sgatev wrote: > On a high level, what's wrong with having `getPointeeLoc` members with > different return types in `ReferenceValue` and `PointerValue`? IMO, it would be nice to distinguish the type of Value we

[PATCH] D127746: [clang][dataflow] Convert `PointeeLoc` of PointerValue from reference to pointer. This allows PointeeLoc to be empty in the case of `nullptr`

2022-06-14 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 436817. wyt added a comment. Update naming of getPointeeLoc with respect to change in parent Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127746/new/ https://reviews.llvm.org/D127746 Files:

[PATCH] D127746: [clang][dataflow] Convert `PointeeLoc` of PointerValue from reference to pointer. This allows PointeeLoc to be empty in the case of `nullptr`

2022-06-14 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: tschuett, steakhal, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Depends On D127745 Repository: rG

[PATCH] D127745: [clang][dataflow] Rename `getPointeeLoc` to `getReferencePointeeLoc` and `getPointerPointeeLoc` respectively for ReferenceValue and PointerValue.

2022-06-14 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: tschuett, steakhal, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. We distinguish between getting pointee location for `ReferenceValue` and

[PATCH] D127312: [clang][dataflow] Remove IndirectionValue class, moving PointeeLoc field into PointerValue and ReferenceValue

2022-06-08 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:63 -auto *IndVal2 = cast(Val2); -assert(IndVal1->getKind() == IndVal2->getKind()); -if (>getPointeeLoc() == >getPointeeLoc()) gribozavr2 wrote: > This

[PATCH] D129546: [clang][dataflow] Refactor boolean creation as a test utility.

2022-07-13 Thread weiyi 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 rG632de855a042: [clang][dataflow] Refactor boolean creation as a test utility. (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values for debugging purposes.

2022-07-13 Thread weiyi 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 rGc9666d2339e5: [clang][dataflow] Generate readable form of boolean values. (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D129568: [clang][dataflow] Rename `Status` field in a `Solver::Result` struct to `SATCheckStatus`.

2022-07-13 Thread weiyi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3ec2b2f4ec32: [clang][dataflow] Rename `Status` field in a `Solver::Result` struct to… (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-13 Thread weiyi 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 rGb8d83e8004e4: [clang][dataflow] Generate readable form of input and output of satisfiability… (authored by wyt). Repository: rG LLVM Github

[PATCH] D132229: [clang][dataflow] Mark `getDeclCtx` function in dataflow `Environment` `const`.

2022-08-19 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo

[PATCH] D131891: [clang][dataflow] Debug string for value kinds.

2022-08-19 Thread weiyi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdbb95c2a851c: [clang][dataflow] Debug string for value kinds. (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131891/new/

[PATCH] D131616: [clang][dataflow] Generalise match switch utility to other AST types and add a `CFGMatchSwitch` which currently handles `CFGStmt` and `CFGInitializer`.

2022-08-23 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454869. wyt added a comment. Fix comments for consistency. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131616/new/ https://reviews.llvm.org/D131616 Files:

[PATCH] D131616: [clang][dataflow] Generalise match switch utility to other AST types and add a `CFGMatchSwitch` which currently handles `CFGStmt` and `CFGInitializer`.

2022-08-23 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454868. wyt marked 13 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131616/new/ https://reviews.llvm.org/D131616 Files:

[PATCH] D131616: [clang][dataflow] Generalise match switch utility to other AST types and add a `CFGMatchSwitch` which currently handles `CFGStmt` and `CFGInitializer`.

2022-08-23 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/CFGMatchSwitch.h:55 +MSActionT A) && { +std::move(std::move(StmtBuilder).template CaseOf(M, A)); +return std::move(*this); sgatev

[PATCH] D132377: [clang][dataflow] Add `SetupTest` parameter for `AnalysisInputs`.

2022-08-23 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454754. wyt marked 5 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132377/new/ https://reviews.llvm.org/D132377 Files:

[PATCH] D132756: [clang][dataflow] Refactor `TypeErasedDataflowAnalysisTest` - replace usage of the deprecated overload of `checkDataflow`.

2022-08-26 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D132756 Files:

[PATCH] D132745: [clang] Fix ambiguous use of `report_fatal_error`.

2022-08-26 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. `report_fatal_error` is overloaded on `StringRef` and `Twine &`, therefore passing a `std::string` argument leads to ambiguity as

[PATCH] D132763: [clang][dataflow] Use `StringMap` for storing analysis states at annotated points instead of `vector>`.

2022-08-29 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456308. wyt marked 6 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132763/new/ https://reviews.llvm.org/D132763 Files:

[PATCH] D132763: [clang][dataflow] Use `StringMap` for storing analysis states at annotated points instead of `vector>`.

2022-08-29 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:363-365 +std::sort(AnnotationStatesAsVector.begin(), + AnnotationStatesAsVector.end(), + [](auto a, auto b) { return a.first < b.first; });

[PATCH] D132377: [clang][dataflow] Add `SetupTest` parameter for `AnalysisInputs`.

2022-08-29 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456307. wyt marked an inline comment as done. wyt added a comment. Propagate change from parent patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132377/new/ https://reviews.llvm.org/D132377 Files:

[PATCH] D132377: [clang][dataflow] Add `SetupTest` parameter for `AnalysisInputs`.

2022-08-29 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:88 +/// Arguments for building the dataflow analysis. +template struct AnalysisInputs { + /// Input code that is analyzed. sgatev wrote: > Why move this? It makes it

[PATCH] D132763: [clang][dataflow] Use `StringMap` for storing analysis states at annotated points instead of `vector>`.

2022-08-29 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456323. wyt marked an inline comment as done. wyt added a comment. Address comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132763/new/ https://reviews.llvm.org/D132763 Files:

[PATCH] D132756: [clang][dataflow] Refactor `TypeErasedDataflowAnalysisTest` - replace usage of the deprecated overload of `checkDataflow`.

2022-08-29 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456317. wyt marked 2 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132756/new/ https://reviews.llvm.org/D132756 Files:

[PATCH] D132147: [clang][dataflow] Refactor `TestingSupport.h`

2022-08-29 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456305. wyt marked 5 inline comments as done. wyt added a comment. Address comments: add const qualifiers where applicable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132147/new/

[PATCH] D132745: [clang] Fix ambiguous use of `report_fatal_error`.

2022-08-29 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456311. wyt marked an inline comment as done. wyt added a comment. Address comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132745/new/ https://reviews.llvm.org/D132745 Files:

[PATCH] D132763: [clang][dataflow] Use `StringMap` for storing analysis states at annotated points instead of `vector>`.

2022-08-26 Thread weiyi via Phabricator via cfe-commits
wyt created this revision. Herald added subscribers: martong, mgrang, xazax.hun. Herald added a project: All. wyt requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Depends On D132377 Repository: rG LLVM

[PATCH] D132147: [clang][dataflow] Refactor `TestingSupport.h`

2022-08-26 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456032. wyt added a comment. Fix typo and indentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132147/new/ https://reviews.llvm.org/D132147 Files: clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp

[PATCH] D131614: [clang][dataflow] Extend transfer functions for other `CFGElement`s

2022-08-26 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456049. wyt added a comment. Mark override for virtual transfer function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131614/new/ https://reviews.llvm.org/D131614 Files:

[PATCH] D132147: [clang][dataflow] Refactor `TestingSupport.h`

2022-08-26 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456029. wyt marked 4 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132147/new/ https://reviews.llvm.org/D132147 Files:

[PATCH] D132377: [clang][dataflow] Add `SetupTest` parameter for `AnalysisInputs`.

2022-08-26 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 456030. wyt added a comment. Propagate change from parent patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132377/new/ https://reviews.llvm.org/D132377 Files:

[PATCH] D131614: [clang][dataflow] Extend transfer functions for other `CFGElement`s

2022-08-26 Thread weiyi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4b815eb4fde0: [clang][dataflow] Extend transfer functions for other `CFGElement`s (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D131614: [clang][dataflow] Extend transfer functions for other `CFGElement`s

2022-08-26 Thread weiyi via Phabricator via cfe-commits
wyt added a comment. @thakis Thanks for pointing that out, will revert and recommit - since it also ran into some build failures. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131614/new/ https://reviews.llvm.org/D131614

[PATCH] D132745: [clang] Fix ambiguous use of `report_fatal_error`.

2022-08-29 Thread weiyi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd346eb7bf08c: [clang] Fix ambiguous use of `report_fatal_error`. (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132745/new/

  1   2   >