This patch refactors the ArrayBoundCheckerV2 to use more SValVisitor machinery.
IMO this pattern leads to a more functional style, thus more readable - compared to an ad-hoc recursion what getSimplifiedOffsets did.
I also drastically reduce the scope of the mutated local variables for readability.
This resulted in a fairly large change:
- Use MemRegionVisitor to compute RegionRawOffsetV2 of a memory region.
- Use SymExprVisitor to simplify subscript expression.
- Remove getSimplifiedOffsets function.
- Split up ArrayBoundCheckerV2::checkLocation into checkLowerBound and checkUpperBound.