{
public:
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;
};
#endif // GCC_RANGE_OP_MIXED_H
r.set_varying (type);
}
-
class pointer_and_operator : public range_operator
{
public:
rel);
}
-// When PRANGE is implemented, these are all the opcodes which are currently
-// expecting routines with PRANGE signatures.
-
-pointer_table::pointer_table ()
-{
- set (MAX_EXPR, op_ptr_min_max);
-}
-
// ----------------------------------------------------------------------
// Hybrid operators for the 4 operations which integer and pointers share,
// but which have different implementations. Simply check the type in
}
} op_hybrid_min;
+class hybrid_max_operator : public operator_max
+{
+public:
+ void update_bitmask (irange &r, const irange &lh,
+ const irange &rh) const final override
+ {
+ if (!r.undefined_p () && INTEGRAL_TYPE_P (r.type ()))
+ operator_max::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_max::wi_fold (r, type, lh_lb, lh_ub, rh_lb, rh_ub);
+ else
+ return op_ptr_min_max.wi_fold (r, type, lh_lb, lh_ub, rh_lb, rh_ub);
+ }
+} op_hybrid_max;
// Initialize any pointer operators to the primary table
set (BIT_AND_EXPR, op_hybrid_and);
set (BIT_IOR_EXPR, op_hybrid_or);
set (MIN_EXPR, op_hybrid_min);
+ set (MAX_EXPR, op_hybrid_max);
}
#include "tree-ssa-ccp.h"
#include "range-op-mixed.h"
-pointer_table pointer_tree_table;
-
// Instantiate a range_op_table for unified operations.
class unified_table : public range_op_table
{
// set (BIT_AND_EXPR, op_bitwise_and);
// set (BIT_IOR_EXPR, op_bitwise_or);
// set (MIN_EXPR, op_min);
- set (MAX_EXPR, op_max);
+ // set (MAX_EXPR, op_max);
}
// The tables are hidden and accessed via a simple extern function.
range_operator *
-get_op_handler (enum tree_code code, tree type)
+get_op_handler (enum tree_code code, tree)
{
- // If this is pointer type and there is pointer specifc routine, use it.
- if (POINTER_TYPE_P (type) && pointer_tree_table[code])
- return pointer_tree_table[code];
-
return unified_tree_table[code];
}
m_range_tree[code] = &op;
}
-// Instantiate a range op table for pointer operations.
-
-class pointer_table : public range_op_table
-{
-public:
- pointer_table ();
-};
-extern pointer_table pointer_tree_table;
-
extern range_operator *ptr_op_widen_mult_signed;
extern range_operator *ptr_op_widen_mult_unsigned;
extern range_operator *ptr_op_widen_plus_signed;