Initiate the reorganization of the equality information during symbol
simplification. E.g., if we bump into c + 1 == 0 during simplification
then we'd like to express that c == -1. It makes sense to do this only
with SymIntExprs.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The coverage report of the test shows that L2124 is uncovered. Please add a test demonstrating that path as well.
I'm gonna come back to this tomorrow.
clang/test/Analysis/solver-sym-simplification-adjustment.c | ||
---|---|---|
37 | Please express that C: [-2,-1] is then intersected with the already associated range which is [-1,1], thus we get c: [-1,-1]. | |
56 | Can we infer within this true branch that b must be 0 to make this path feasible? |
clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp | ||
---|---|---|
2126–2130 | Can the simplification of a SymSymExpr result in IntSymExpr? If it can happen, then we could see such instances and we should do the right thing with them as well. |
- Add comment about intersection in the test file
- Add check in the feasible case in the test file
I've added such a test, thanks for the notice!
clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp | ||
---|---|---|
2126–2130 |
Yes it can. However, in order to handle them we should extend computeAdjustment properly, which is absolutely not trivial - considering the test cases in additive-folding.cpp - So, I'd rather address that in another patch. | |
clang/test/Analysis/solver-sym-simplification-adjustment.c | ||
37 | Ok, I've added that comment. | |
56 |
Yes, we can.
Ok, I've added the appropriate clang_analyzer_eval to check this. |
Awesome!
So clean, and I also like the tests.
Good job.
clang/test/Analysis/solver-sym-simplification-adjustment.c | ||
---|---|---|
59 | Please assert clang_analyzer_eval(c == 0) as well. |
Can the simplification of a SymSymExpr result in IntSymExpr? If it can happen, then we could see such instances and we should do the right thing with them as well.
WDYT?