]> gcc.gnu.org Git - gcc.git/commit
Convert users of legacy API to get_legacy_range() function.
authorAldy Hernandez <aldyh@redhat.com>
Thu, 2 Mar 2023 14:43:20 +0000 (15:43 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Wed, 26 Apr 2023 08:35:53 +0000 (10:35 +0200)
commit5bdc5155138abeb244be1690998b359152445be6
tree6bbf380ec8df5c81aa0e690fdab291186a689287
parent964b02cb26df1016d036de6720e9d4decf87cc6f
Convert users of legacy API to get_legacy_range() function.

This patch converts the users of the legacy API to a function called
get_legacy_range() which will return the pieces of the soon to be
removed API (min, max, and kind).  This is a temporary measure while
these users are converted.

In upcoming patches I will convert most users, but most of the
middle-end warning uses will remain.  Naive attempts to remove them
showed that a lot of these uses are quite dependant on the anti-range
idiom, and converting them to the new API broke the tests, even when
the conversion was conceptually correct.  Perhaps someone who
understands these passes could take a stab at it.  In the meantime,
the legacy uses can be trivially found by grepping for
get_legacy_range.

gcc/ChangeLog:

* builtins.cc (determine_block_size): Convert use of legacy API to
get_legacy_range.
* gimple-array-bounds.cc (check_out_of_bounds_and_warn): Same.
(array_bounds_checker::check_array_ref): Same.
* gimple-ssa-warn-restrict.cc
(builtin_memref::extend_offset_range): Same.
* ipa-cp.cc (ipcp_store_vr_results): Same.
* ipa-fnsummary.cc (set_switch_stmt_execution_predicate): Same.
* ipa-prop.cc (struct ipa_vr_ggc_hash_traits): Same.
(ipa_write_jump_function): Same.
* pointer-query.cc (get_size_range): Same.
* tree-data-ref.cc (split_constant_offset): Same.
* tree-ssa-strlen.cc (get_range): Same.
(maybe_diag_stxncpy_trunc): Same.
(strlen_pass::get_len_or_size): Same.
(strlen_pass::count_nonzero_bytes_addr): Same.
* tree-vect-patterns.cc (vect_get_range_info): Same.
* value-range.cc (irange::maybe_anti_range): Remove.
(get_legacy_range): New.
(irange::copy_to_legacy): Use get_legacy_range.
(ranges_from_anti_range): Same.
* value-range.h (class irange): Remove maybe_anti_range.
(get_legacy_range): New.
* vr-values.cc (check_for_binary_op_overflow): Convert use of
legacy API to get_legacy_range.
(compare_ranges): Same.
(compare_range_with_value): Same.
(bounds_of_var_in_loop): Same.
(find_case_label_ranges): Same.
(simplify_using_ranges::simplify_switch_using_ranges): Same.
13 files changed:
gcc/builtins.cc
gcc/gimple-array-bounds.cc
gcc/gimple-ssa-warn-restrict.cc
gcc/ipa-cp.cc
gcc/ipa-fnsummary.cc
gcc/ipa-prop.cc
gcc/pointer-query.cc
gcc/tree-data-ref.cc
gcc/tree-ssa-strlen.cc
gcc/tree-vect-patterns.cc
gcc/value-range.cc
gcc/value-range.h
gcc/vr-values.cc
This page took 0.059163 seconds and 5 git commands to generate.