[PATCH] D120984: [clang][dataflow] Extend flow conditions from block terminators
Yitzhak Mandelbaum via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 6 10:31:00 PST 2022
ymandel accepted this revision.
ymandel added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:154
+
+ // `X v (X ^ Y ^ ...)` is logically equivalent to `X`. The common conditions
+ // have already been added to the result so we don't have to do anything here
----------------
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"?
================
Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:112
+
+ // The condition must be inversed in one of the successors.
+ if (BlockSuccIdx == 1)
----------------
Can we be more specific? I'd think we need to invert for specifically the successor corresponding to "else" or what not.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120984/new/
https://reviews.llvm.org/D120984
More information about the cfe-commits
mailing list