Split gimple range folding with ranges into a stand alone class.
Introduces fold_using_range which folds any kind of gimple statement by querying argument ranges thru a generic range_query. This pulls all the statement processing into a client neutral location. * gimple-range.cc (fur_source::get_operand): New. (gimple_range_fold): Delete. (fold_using_range::fold_stmt): Move from gimple_ranger::calc_stmt. (fold_using_range::range_of_range_op): Move from gimple_ranger. (fold_using_range::range_of_address): Ditto. (fold_using_range::range_of_phi): Ditto. (fold_using_range::range_of_call): Ditto. (fold_using_range::range_of_builtin_ubsan_call): Move from range_of_builtin_ubsan_call. (fold_using_range::range_of_builtin_call): Move from range_of_builtin_call. (gimple_ranger::range_of_builtin_call): Delete. (fold_using_range::range_of_cond_expr): Move from gimple_ranger. (gimple_ranger::fold_range_internal): New. (gimple_ranger::range_of_stmt): Use new fold_using_range API. (fold_using_range::range_of_ssa_name_with_loop_info): Move from gimple_ranger. Improve ranges of SSA_NAMES when possible. * gimple-range.h (gimple_ranger): Remove various range_of routines. (class fur_source): New. (class fold_using_range): New. (fur_source::fur_source): New. (fold_range): New. * vr-values.c (vr_values::extract_range_basic): Use fold_using_range instead of range_of_builtin_call.
Loading
Please register or sign in to comment