Add gimple_range_type for statements.
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 15 Jul 2021 15:07:12 +0000 (11:07 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 15 Jul 2021 19:58:11 +0000 (15:58 -0400)
commit478cc962ad174bfc64c573152a0658935651fce3
tree092b98b66e17b719def4a96973fcfb7851187538
parentf0500db3692276f60e0562c17c87a0cb03e34398
Add gimple_range_type for statements.

The existing mechanisms for picking up the type of a statement are
inconsistent with the needs of ranger. Encapsulate all the bits
required to pick up the return type of a statement in one place, and check
whether the type is supported.

* gimple-range-fold.cc (adjust_pointer_diff_expr): Use
gimple_range_type.
(fold_using_range::fold_stmt): Ditto.
(fold_using_range::range_of_range_op): Ditto.
(fold_using_range::range_of_phi): Ditto.
(fold_using_range::range_of_call): Ditto.
(fold_using_range::range_of_builtin_ubsan_call): Ditto.
(fold_using_range::range_of_builtin_call): Ditto.
(fold_using_range::range_of_cond_expr): Ditto.
* gimple-range-fold.h (gimple_range_type): New.
gcc/gimple-range-fold.cc
gcc/gimple-range-fold.h