This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h | ||
---|---|---|
99 | MergedEnv? Also, the documentation above gives a short description of the relationship between Val1, Val2, and MergedVal. But it gives little pointers what are we supposed to do with the Environment. | |
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp | ||
123 | Is this actually correct? Or did you mean Conjunction? |
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp | ||
---|---|---|
123 | Oh, sorry. Just realized the empty set is interpreted as true. In this case this is correct. |
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp | ||
---|---|---|
154 | The current comment gets at the big picture, but focusing on the actual disjunction that is being guarded (that is, just the remaining, unshared clauses) may be better. So, maybe instead point out that "True v (X ^ ...)" is equivalent to "True", since if either val is nullptr it represents "true"? | |
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp | ||
111 | Can we be more specific? I'd think we need to invert for specifically the successor corresponding to "else" or what not. |
Address reviewers' comments.
clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h | ||
---|---|---|
99 | Updated the name and added some pointers in the documentation. | |
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp | ||
154 | I added a general comment at the top and modified the comment here to target the specific case. | |
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp | ||
111 | Yup. Updated the comment to be more specific. |
Thanks, with the new comments it is much clearer what is going on!
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp | ||
---|---|---|
89 | We only expect || and && to be terminators right? I wonder if we should add an assert so we get notified if the language gets extended with a new operator that we do not support yet. |
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp | ||
---|---|---|
89 | Right. Adding an assert here sounds good to me. |
MergedEnv? Also, the documentation above gives a short description of the relationship between Val1, Val2, and MergedVal. But it gives little pointers what are we supposed to do with the Environment.