]> git.ipfire.org Git - thirdparty/gcc.git/commit
Move common code from range-op.cc to header files.
authorAldy Hernandez <aldyh@redhat.com>
Thu, 28 Apr 2022 18:19:14 +0000 (20:19 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 29 Apr 2022 08:44:18 +0000 (10:44 +0200)
commit9eb38e88ce8003c0b852144da3c265b6785ede3c
treede9fa3bb22a6ca19b61d597912911d45c87cc536
parentc13fd1b8fd8eef009370a629bd2ca2bbdb2f828d
Move common code from range-op.cc to header files.

In preparation for the agnostication of ranger, this patch moves
common code that can be shared between non-integer ranges (initially
pointers) into the relevant header files.

This is a relatively non-invasive change, as any changes that would
need to be ported to GCC 12, would occur in the range-op entries
themselves, not in the supporting glue which I'm moving.

Tested and benchmarked on x86-64 Linux.

gcc/ChangeLog:

* range-op.cc (empty_range_varying): Move to range-op.h.
(range_true): Move to range.h.
(range_false): Same.
(range_true_and_false): Same.
(enum bool_range_state): Move to range-op.h.
(relop_early_resolve): Same.
(operator_equal::op1_op2_relation): Abstract code to...
(equal_op1_op2_relation): ...here.
(operator_not_equal::op1_op2_relation): Abstract code to...
(not_equal_op1_op2_relation): ...here.
(operator_lt::op1_op2_relation): Abstract code to...
(lt_op1_op2_relation): ...here.
(operator_le::op1_op2_relation): Abstract code to...
(le_op1_op2_relation): ...here.
(operator_gt::op1_op2_relation): Abstract code to...
(gt_op1_op2_relation): ...here.
(operator_ge::op1_op2_relation): Abstract code to...
(ge_op1_op2_relation): ...here.
(class range_op_table): Move to range-op.h.
* range-op.h (equal_op1_op2_relation): Moved from range-op.cc.
(not_equal_op1_op2_relation): Same.
(lt_op1_op2_relation): Same.
(le_op1_op2_relation): Same.
(gt_op1_op2_relation): Same.
(ge_op1_op2_relation): Same.
(enum bool_range_state): Same.
(get_bool_state): Same.
(empty_range_varying): Same.
(relop_early_resolve): Same.
(class range_op_table): Same.
* range.h (range_true): Same.
(range_false): Same.
(range_true_and_false): Same.
gcc/range-op.cc
gcc/range-op.h
gcc/range.h