[all-commits] [llvm/llvm-project] bdfe55: [clang][dataflow] Implement functionality for flow...

weiyi via All-commits all-commits at lists.llvm.org
Mon Jun 27 02:38:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bdfe556dd837007c5671f33384d26e9ea315db53
      https://github.com/llvm/llvm-project/commit/bdfe556dd837007c5671f33384d26e9ea315db53
  Author: Wei Yi Tee <wyt at google.com>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    M clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
    M clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
    M clang/unittests/Analysis/FlowSensitive/DataflowAnalysisContextTest.cpp

  Log Message:
  -----------
  [clang][dataflow] Implement functionality for flow condition variable substitution.

This patch introduces `buildAndSubstituteFlowCondition` - given a flow condition token, this function returns the expression of constraints defining the flow condition, with values substituted where specified.

As an example:
Say we have tokens `FC1`, `FC2`, `FC3`:
```
FlowConditionConstraints: {
 FC1: C1,
 FC2: C2,
 FC3: (FC1 v FC2) ^ C3,
}
```
`buildAndSubstituteFlowCondition(FC3, /*Substitutions:*/{{C1 -> C1'}})`
returns a value corresponding to `(C1' v C2) ^ C3`.

Note:
This function returns the flow condition expressed directly as its constraints, which differs to how we currently represent the flow condition as a token bound to a set of constraints and dependencies. Making the representation consistent may be an option to consider in the future.

Depends On D128357

Reviewed By: gribozavr2, xazax.hun

Differential Revision: https://reviews.llvm.org/D128363




More information about the All-commits mailing list