Tweaks to ranger cache
authorAndrew MacLeod <amacleod@redhat.com>
Mon, 2 Nov 2020 18:06:46 +0000 (13:06 -0500)
committerAndrew MacLeod <amacleod@redhat.com>
Tue, 3 Nov 2020 15:17:39 +0000 (10:17 -0500)
commit220929c067717605cab96a9c5fe93e2e01532e51
tree8c765d51a3957f50fe64638e064b3a5a9eb23f69
parentc2856ceec2e7542fe9b0bf104afeeeeb57d6996d
Tweaks to ranger cache

Add some bounds checking to ssa_block_ranges, and privatize the
ranges block cache and global cache, adding API points for accessing them.

* gimple-range-cache.h (block_range_cache): Add new entry point.
(ranger_cache): Privatize global abnd block cache members.
* gimple-range-cache.cc (ssa_block_ranges::set_bb_range): Add bounds
check.
(ssa_block_ranges::set_bb_varying): Ditto.
(ssa_block_ranges::get_bb_range): Ditto.
(ssa_block_ranges::bb_range_p): Ditto.
(block_range_cache::get_block_ranges): Fix formatting.
(block_range_cache::query_block_ranges): New.
(block_range_cache::get_bb_range): Use Query_block_ranges.
(block_range_cache::bb_range_p): Ditto.
(ranger_cache::dump): New.
(ranger_cache::get_global_range): New.
(ranger_cache::set_global_range): New.
* gimple-range.cc (gimple_ranger::range_of_expr): Use new API.
(gimple_ranger::range_of_stmt): Ditto.
(gimple_ranger::export_global_ranges): Ditto.
(gimple_ranger::dump): Ditto.
gcc/gimple-range-cache.cc
gcc/gimple-range-cache.h
gcc/gimple-range.cc