using range_operator::op2_range;
bool op1_range (irange &r, tree type,
const irange &lhs, const irange &op2,
- relation_trio rel = TRIO_VARYING) const final override;
+ relation_trio rel = TRIO_VARYING) const override;
bool op2_range (irange &r, tree type,
const irange &lhs, const irange &op1,
- relation_trio rel = TRIO_VARYING) const final override;
+ relation_trio rel = TRIO_VARYING) const override;
void update_bitmask (irange &r, const irange &lh,
- const irange &rh) const final override;
-private:
+ const irange &rh) const override;
+protected:
void wi_fold (irange &r, tree type, const wide_int &lh_lb,
const wide_int &lh_ub, const wide_int &rh_lb,
- const wide_int &rh_ub) const final override;
+ const wide_int &rh_ub) const override;
};
class operator_min : public range_operator
class pointer_or_operator : public range_operator
{
+public:
using range_operator::op1_range;
using range_operator::op2_range;
-public:
virtual bool op1_range (irange &r, tree type,
const irange &lhs,
const irange &op2,
pointer_table::pointer_table ()
{
- set (BIT_IOR_EXPR, op_pointer_or);
set (MIN_EXPR, op_ptr_min_max);
set (MAX_EXPR, op_ptr_min_max);
}
}
} op_hybrid_and;
+// Temporary class which dispatches routines to either the INT version or
+// the pointer version depending on the type. Once PRANGE is a range
+// class, we can remove the hybrid.
+
+class hybrid_or_operator : public operator_bitwise_or
+{
+public:
+ using range_operator::op1_range;
+ using range_operator::op2_range;
+ using range_operator::lhs_op1_relation;
+ bool op1_range (irange &r, tree type,
+ const irange &lhs, const irange &op2,
+ relation_trio rel = TRIO_VARYING) const final override
+ {
+ if (INTEGRAL_TYPE_P (type))
+ return operator_bitwise_or::op1_range (r, type, lhs, op2, rel);
+ else
+ return op_pointer_or.op1_range (r, type, lhs, op2, rel);
+ }
+ bool op2_range (irange &r, tree type,
+ const irange &lhs, const irange &op1,
+ relation_trio rel = TRIO_VARYING) const final override
+ {
+ if (INTEGRAL_TYPE_P (type))
+ return operator_bitwise_or::op2_range (r, type, lhs, op1, rel);
+ else
+ return op_pointer_or.op2_range (r, type, lhs, op1, rel);
+ }
+ void update_bitmask (irange &r, const irange &lh,
+ const irange &rh) const final override
+ {
+ if (!r.undefined_p () && INTEGRAL_TYPE_P (r.type ()))
+ operator_bitwise_or::update_bitmask (r, lh, rh);
+ }
+
+ void wi_fold (irange &r, tree type, const wide_int &lh_lb,
+ const wide_int &lh_ub, const wide_int &rh_lb,
+ const wide_int &rh_ub) const final override
+ {
+ if (INTEGRAL_TYPE_P (type))
+ return operator_bitwise_or::wi_fold (r, type, lh_lb, lh_ub,
+ rh_lb, rh_ub);
+ else
+ return op_pointer_or.wi_fold (r, type, lh_lb, lh_ub, rh_lb, rh_ub);
+ }
+} op_hybrid_or;
+
+
// Initialize any pointer operators to the primary table
set (POINTER_PLUS_EXPR, op_pointer_plus);
set (POINTER_DIFF_EXPR, op_pointer_diff);
set (BIT_AND_EXPR, op_hybrid_and);
+ set (BIT_IOR_EXPR, op_hybrid_or);
}