diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-06-09 13:35:24 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-06-09 20:33:02 -0400 |
commit | b073d8af944119c4429b243c09eac612f22d1e83 (patch) | |
tree | 030e4acfb48d4ee9fe64b6ce8ac3b90b7373f0a9 /gcc/range-op-float.cc | |
parent | a0a8f1c735d0ab5af9ecbbf21a783bba78496939 (diff) | |
download | gcc-b073d8af944119c4429b243c09eac612f22d1e83.zip gcc-b073d8af944119c4429b243c09eac612f22d1e83.tar.gz gcc-b073d8af944119c4429b243c09eac612f22d1e83.tar.bz2 |
Unify Identity range operator
Move the declaration of the class to the range-op-mixed header, add the
floating point prototypes as well, and use it in the new unified table.
* range-op-float.cc (foperator_identity): Remove. Move prototypes
to range-op-mixed.h
(operator_identity::fold_range): Rename from foperator_identity.
(operator_identity::op1_range): Ditto.
(float_table::float_table): Remove fop_identity.
* range-op-mixed.h (class operator_identity): Combined from integer
and float files.
* range-op.cc (op_identity): New object.
(unified_table::unified_table): Add op_identity.
(class operator_identity): Move to range-op-mixed.h.
(integral_table::integral_table): Remove identity.
(pointer_table::pointer_table): Remove identity.
Diffstat (limited to 'gcc/range-op-float.cc')
-rw-r--r-- | gcc/range-op-float.cc | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 4faca62..bc8ecc6 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -541,27 +541,22 @@ build_gt (frange &r, tree type, const frange &val) } -class foperator_identity : public range_operator +bool +operator_identity::fold_range (frange &r, tree, const frange &op1, + const frange &, relation_trio) const { - using range_operator::fold_range; - using range_operator::op1_range; -public: - bool fold_range (frange &r, tree type ATTRIBUTE_UNUSED, - const frange &op1, const frange &op2 ATTRIBUTE_UNUSED, - relation_trio = TRIO_VARYING) const final override - { - r = op1; - return true; - } - bool op1_range (frange &r, tree type ATTRIBUTE_UNUSED, - const frange &lhs, const frange &op2 ATTRIBUTE_UNUSED, - relation_trio = TRIO_VARYING) const final override - { - r = lhs; - return true; - } -public: -} fop_identity; + r = op1; + return true; +} + +bool +operator_identity::op1_range (frange &r, tree, const frange &lhs, + const frange &, relation_trio) const +{ + r = lhs; + return true; +} + bool operator_equal::op2_range (frange &r, tree type, @@ -2694,11 +2689,6 @@ private: float_table::float_table () { - set (SSA_NAME, fop_identity); - set (PAREN_EXPR, fop_identity); - set (OBJ_TYPE_REF, fop_identity); - set (REAL_CST, fop_identity); - set (ABS_EXPR, fop_abs); set (NEGATE_EXPR, fop_negate); set (PLUS_EXPR, fop_plus); |