Depends on D126560. getKnownValue has been changed by the parent patch
in a way that simplification was removed. This is not correct when the
function is called by the Checkers. Thus, a new internal function is
introduced, getConstValue, which simply queries the constraint manager.
This getConstValue is used internally in the SimpleSValBuilder when a
binop is evaluated, this way we avoid the recursion into the Simplifier.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
80 ms | x64 debian > Clang.CodeGen::builtins-memcpy-inline.c |
Event Timeline
LGTM
Schedule a measurement to see what changes. Let's hope it won't introduce more crashes.
If everything checks out, it gets approved.
clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | ||
---|---|---|
25–28 | I'm also wondering if this should be at the top. I would rather put it below simplifySValOnce(). |
Oh sure. The SimpleSValBuilder is not escaped like code or class entities should be in the summary. But it's really not that important.
- Add one more sentence in the comments.
clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | ||
---|---|---|
25–28 | It is a good idea to draw the checker writer's attention to use getKnownValue, however, this is a private function deliberately for this exact reason.
I've put it here because simplifySValOnce references this even in its header comment. |
clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | ||
---|---|---|
25–28 |
I know. My point is that the name of those two functions won't express the difference; thus I wanted to have a more verbose way of expressing that the private impl. fn. should not be exposed. I won't insist though.
Well, it also refers to simplifySValOnce(), yet that's below that comment. |
Results are good. No new assertion failures, neither crashes. Runtime is the same (in the margin of error). Redis has been added to the set of analyzed projects this time.
I'm also wondering if this should be at the top. I would rather put it below simplifySValOnce().