[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 https://reviews.l

[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/ https://reviews.l

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

2022-08-19 Thread weiyi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb0befe3ac1ba: [clang][dataflow] Mark `getDeclCtx` function in dataflow `Environment` `const`. (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

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

2022-08-19 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:144 llvm::Optional>>> -runDataflowAnalysis( +runDataflowAnalysisOnCFG( const ControlFlowContext &CFCtx, AnalysisT &Analysis, gribozavr2 wrote: > Cannot

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

2022-08-19 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454097. wyt marked 2 inline comments as done. wyt added a comment. Address comments: rename `AnalysisArguments` to `AnalysisInputs` and `AnalysisData` to `AnalysisOutputs`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

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

2022-08-19 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:125 +std::pair>>> +getAnnotationStates(AnalysisData &AD) { + using StateT = DataflowAnalysisState; gribozavr2 wrote: > Could we capture the lattice elements in the

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

2022-08-22 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. Moves the work required for retrieving annotation states into the `SetupTest` and `Po

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

2022-08-22 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454523. wyt marked 8 inline comments as done. wyt added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131614/new/ https://reviews.llvm.org/D131614 Files: clang/include/clang/Analysis

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

2022-08-22 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454525. wyt added a comment. Propagate change from parent patch. 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/TestingSu

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

2022-08-22 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454527. wyt added a comment. Herald added a reviewer: NoQ. 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: clang/include/clan

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

2022-08-22 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454532. wyt added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131614/new/ https://reviews.llvm.org/D131614 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h clang/includ

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

2022-08-22 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454534. wyt added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131616/new/ https://reviews.llvm.org/D131616 Files: clang/include/clang/Analysis/FlowSensitive/CFGMatchSwitch.h clang/include/

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

2022-08-22 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454535. wyt added a comment. Rebase. 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 clang/unittests/

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

2022-08-22 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 454537. wyt added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132377/new/ https://reviews.llvm.org/D132377 Files: clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp clang/unittests/

[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: clang/unittests/Analysis/Flo

[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: clang/include/clang/Analysi

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

[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: clang/include/clang/Analysis/FlowSensitive/CFGMatchSwi

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

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

[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: clang/unittests/Analysis/Flo

[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: clang/unittests/Analysis/FlowSensitive/TestingSu

[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
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 https://reviews.llvm.org/D131614/new

[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] 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: clang/include/clang/Analysis/FlowSensit

[PATCH] D133931: [clang][dataflow] Replace `transfer(const Stmt *, ...)` with `transfer(const CFGElement *, ...)` in `clang/Analysis/FlowSensitive`.

2022-09-16 Thread weiyi via Phabricator via cfe-commits
wyt added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp:137-140 +auto CS = E->getAs(); +if (!CS) + return; +auto S = CS->getStmt(); martong wrote: > This is exactly the same code that you

[PATCH] D133930: [clang][dataflow] Replace `transfer(const Stmt *, ...)` with `transfer(const CFGElement *, ...)` in `Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel`.

2022-09-16 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 rG41f235d26887: [clang][dataflow] Replace `transfer(const Stmt *, ...)` with `transfer(const… (authored by wyt). Repository: rG LLVM Github Monorepo

[PATCH] D134081: [clang][dataflow] Remove deprecated overloads of `checkDataflow` in `TestingSupport.h`.

2022-09-16 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D134081 Files

[PATCH] D133930: [clang][dataflow] Replace `transfer(const Stmt *, ...)` with `transfer(const CFGElement *, ...)` in `Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel`.

2022-09-16 Thread weiyi via Phabricator via cfe-commits
wyt updated this revision to Diff 460928. wyt added a comment. Herald added a subscriber: carlosgalvezp. Herald added a project: clang-tools-extra. Update UncheckedOptionalAccessCheck.cpp. Remove deprecated `runDataflowAnalysis`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D133930: [clang][dataflow] Replace usage of deprecated functions with the optional check

2022-09-19 Thread weiyi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7538b3604519: [clang][dataflow] Replace usage of deprecated functions with the optional check (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D133931: [clang][dataflow] Replace `transfer(const Stmt *, ...)` with `transfer(const CFGElement *, ...)` in `clang/Analysis/FlowSensitive`.

2022-09-19 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 rGcf94c52e35f2: [clang][dataflow] Replace `transfer(const Stmt *, ...)` with `transfer(const… (authored by wyt). Changed prior to commit: https://re

[PATCH] D133933: [clang][dataflow] Modify `transfer` in `DataflowModel` to take `CFGElement` as input instead of `Stmt`.

2022-09-19 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 rG41d52c5a7f7a: [clang][dataflow] Modify `transfer` in `DataflowModel` to take `CFGElement` as… (authored by wyt). Repository: rG LLVM Github Monore

[PATCH] D133935: [clang][dataflow] Refactor `clang/Analysis/FlowSensitive/MatchSwitchTest.cpp`.

2022-09-19 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 rG88210b81eed8: [clang][dataflow] Refactor `clang/Analysis/FlowSensitive/MatchSwitchTest.cpp`. (authored by wyt). Changed prior to commit: https://r

[PATCH] D134318: [clang][dataflow] Remove deprecated `transfer(const Stmt *, ...)` API.

2022-09-20 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 https://reviews.l

[PATCH] D134081: [clang][dataflow] Remove deprecated overloads of `checkDataflow` in `TestingSupport.h`.

2022-09-21 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 rG003566cb1fae: [clang][dataflow] Remove deprecated overloads of `checkDataflow` in… (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D134318: [clang][dataflow] Remove deprecated `transfer(const Stmt *, ...)` API.

2022-09-21 Thread weiyi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG94747094c782: [clang][dataflow] Remove deprecated `transfer(const Stmt *, ...)` API. (authored by wyt). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134318/

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

[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 https://reviews.llvm.org/D127745/n

[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: clang/include/clang/

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

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

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

[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/ https://revie

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

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

[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: clang/include/clang/Analysis

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

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

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

[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: clang/include/clang/Analysis

[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: clang/include/clang/Analysis

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

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

[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: clang/include/clang/Analysis/Flow

[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 &Val1, + BoolValue &Val2) { sgatev wrote: > T

[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 https://reviews

[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: clang/include/cl

[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: clang/include/clang/Analysis

[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 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: clang/include/clang/Analysis/FlowSensitive/Dataf

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

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

[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: clang/include/cla

[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 (&IndVal1->getPointeeLoc() == &IndVal2->getPointeeLoc()) gribozavr2

<    1   2