From 51ce06385bf259a092f830f1a6dcc4b98757919e Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 1 Sep 2022 10:34:55 -0400 Subject: Create gimple_range_op_handler in a new source file. Range-ops is meant to be IL independent. Some gimple processing has be placed in range-ops, and some is located in gori. Split it all into a file and isolate it in a new class gimple_range_op_handler. * Makefile.in (OBJS): Add gimple-range-op.o. * gimple-range-edge.cc (gimple_outgoing_range_stmt_p): Use gimple_range_op_handler. * gimple-range-fold.cc (gimple_range_base_of_assignment): Move to a method in gimple_range_op_handler. (gimple_range_operand1): Ditto. (gimple_range_operand2): Ditto. (fold_using_range::fold_stmt): Use gimple_range_op_handler. (fold_using_range::range_of_range_op): Ditto. (fold_using_range::relation_fold_and_or): Ditto. (fur_source::register_outgoing_edges): Ditto. (gimple_range_ssa_names): Relocate to gimple-range-op.cc. * gimple-range-fold.h: Adjust prototypes. * gimple-range-gori.cc (gimple_range_calc_op1): Move to a method in gimple_range_op_handler. (gimple_range_calc_op2): Ditto. (gori_compute::compute_operand_range): Use gimple_range_op_handler. (gori_compute::compute_logical_operands): Ditto. (compute_operand1_range): Ditto. (gori_compute::compute_operand2_range): Ditto. (gori_compute::compute_operand1_and_operand2_range): Ditto. * gimple-range-gori.h: Adjust protoypes. * gimple-range-op.cc: New. Supply gimple_range_op_handler methods. * gimple-range-op.h: New. Supply gimple_range_op_handler class. * gimple-range.cc (gimple_ranger::prefill_name): Use gimple_range_op_handler. (gimple_ranger::prefill_stmt_dependencies): Ditto. * gimple-range.h: Include gimple-range-op.h. * range-op.cc (range_op_handler::range_op_handler): Adjust and remove gimple * parameter option. * range-op.h: Adjust prototypes. --- gcc/gimple-range-fold.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'gcc/gimple-range-fold.h') diff --git a/gcc/gimple-range-fold.h b/gcc/gimple-range-fold.h index f2eab72..ce18c66 100644 --- a/gcc/gimple-range-fold.h +++ b/gcc/gimple-range-fold.h @@ -96,15 +96,6 @@ range_compatible_p (tree type1, tree type2) && TYPE_SIGN (type1) == TYPE_SIGN (type2)); } -extern tree gimple_range_operand1 (const gimple *s); -extern tree gimple_range_operand2 (const gimple *s); - -// Given stmt S, fill VEC, up to VEC_SIZE elements, with relevant ssa-names -// on the statement. For efficiency, it is an error to not pass in enough -// elements for the vector. Return the number of ssa-names. - -unsigned gimple_range_ssa_names (tree *vec, unsigned vec_size, gimple *stmt); - // Source of all operands for fold_using_range and gori_compute. // It abstracts out the source of an operand so it can come from a stmt or // and edge or anywhere a derived class of fur_source wants. @@ -169,7 +160,8 @@ public: bool fold_stmt (vrange &r, gimple *s, class fur_source &src, tree name = NULL_TREE); protected: - bool range_of_range_op (vrange &r, gimple *s, fur_source &src); + bool range_of_range_op (vrange &r, gimple_range_op_handler &handler, + fur_source &src); bool range_of_call (vrange &r, gcall *call, fur_source &src); bool range_of_cond_expr (vrange &r, gassign* cond, fur_source &src); bool range_of_address (irange &r, gimple *s, fur_source &src); -- cgit v1.1