a VARYING of the unknown value as the 2nd operand. */
value_range varying (type);
varying.set_varying (type);
- out.set_type (type);
+ out.set_range_class (type);
if (handler.fold_range (out, type, arg_vr, varying))
return true;
}
range_op_handler handler (m_op);
if (handler)
{
- out.set_type (type);
+ out.set_range_class (type);
if (handler.fold_range (out, get_type (), lhs, rhs))
return true;
}
tree type = stream_read_tree (ib, data_in);
// Initialize the value_range to the correct type.
- vr.set_type (type);
+ vr.set_range_class (type);
if (is_a <irange> (vr))
{
gimple *src_stmt;
if (op1_in_chain)
{
- vr.set_type (TREE_TYPE (op1));
+ vr.set_range_class (TREE_TYPE (op1));
if (!compute_operand1_range (vr, handler, lhs, src, vrel_ptr))
return false;
src_stmt = SSA_NAME_DEF_STMT (op1);
else
{
gcc_checking_assert (op2_in_chain);
- vr.set_type (TREE_TYPE (op2));
+ vr.set_range_class (TREE_TYPE (op2));
if (!compute_operand2_range (vr, handler, lhs, src, vrel_ptr))
return false;
src_stmt = SSA_NAME_DEF_STMT (op2);
return false;
// Now get the range thru op1.
- vr.set_type (TREE_TYPE (handler.operand1 ()));
+ vr.set_range_class (TREE_TYPE (handler.operand1 ()));
if (!compute_operand1_range (vr, handler, lhs, src, rel))
return false;
src_stmt = SSA_NAME_DEF_STMT (handler.operand1 ());
fur_stmt src (stmt, q);
if (op1)
{
- op1_range.set_type (TREE_TYPE (op1));
+ op1_range.set_range_class (TREE_TYPE (op1));
src.get_operand (op1_range, op1);
}
// And satisfy the second operand for single op satements.
if (op2)
{
- op2_range.set_type (TREE_TYPE (op2));
+ op2_range.set_range_class (TREE_TYPE (op2));
src.get_operand (op2_range, op2);
}
else if (op1)
// If there was already a range, leave it and do no further evaluation.
if (si.ssa1 && !r.has_range (si.ssa1))
{
- tmp.set_type (TREE_TYPE (si.ssa1));
+ tmp.set_range_class (TREE_TYPE (si.ssa1));
if (si.calc_op1 (tmp, lhs, si.op2_range))
si.op1_range.intersect (tmp);
if (!si.op1_range.varying_p ())
if (si.ssa2 && !r.has_range (si.ssa2))
{
- tmp.set_type (TREE_TYPE (si.ssa2));
+ tmp.set_range_class (TREE_TYPE (si.ssa2));
if (si.calc_op2 (tmp, lhs, si.op1_range))
si.op2_range.intersect (tmp);
if (!si.op2_range.varying_p ())
// If there was already a range, leave it and do no further evaluation.
if (si.ssa1)
{
- tmp.set_type (TREE_TYPE (si.ssa1));
+ tmp.set_range_class (TREE_TYPE (si.ssa1));
if (si.calc_op1 (tmp, lhs, si.op2_range))
si.op1_range.intersect (tmp);
gimple *src = SSA_NAME_DEF_STMT (si.ssa1);
if (si.ssa2)
{
- tmp.set_type (TREE_TYPE (si.ssa2));
+ tmp.set_range_class (TREE_TYPE (si.ssa2));
if (si.calc_op2 (tmp, lhs, si.op1_range))
si.op2_range.intersect (tmp);
gimple *src = SSA_NAME_DEF_STMT (si.ssa2);
but nothing else (union, intersect, etc). This allows us to set
bottoms on any ranges, and is safe as all users of the lattice
check for bottom first. */
- m_vr.set_type (void_type_node);
+ m_vr.set_range_class (void_type_node);
m_vr.set_varying (void_type_node);
return true;
ipcp_vr_lattice::init (tree type)
{
if (type)
- m_vr.set_type (type);
+ m_vr.set_range_class (type);
// Otherwise m_vr will default to unsupported_range.
m_recipient_only = false;
avals->m_known_value_ranges.safe_grow_cleared (count,
true);
for (int i = 0; i < count; ++i)
- avals->m_known_value_ranges[i].set_type (void_type_node);
+ avals->m_known_value_ranges[i].set_range_class
+ (void_type_node);
}
avals->m_known_value_ranges[i] = vr;
}
void
ipa_vr::get_vrange (value_range &r) const
{
- r.set_type (m_type);
+ r.set_range_class (m_type);
m_storage->get_vrange (r, m_type);
}
varying.set_varying (type);
// Ensure we are in the correct mode for the call to fold.
- r.set_type (type);
+ r.set_range_class (type);
// Call op_convert, if it fails, the result is varying.
if (!range_op_handler (CONVERT_EXPR).fold_range (r, type, tmp, varying))
//
// Using any of the various constructors initializes the object
// appropriately, but the default constructor is uninitialized and
-// must be initialized either with set_type() or by assigning into it.
+// must be initialized either with set_range_class() or by assigning into /it.
//
// Assigning between incompatible types is allowed. For example if a
// temporary holds an irange, you can assign an frange into it, and
// all the right things will happen. However, before passing this
// object to a function accepting a vrange, the correct type must be
-// set. If it isn't, you can do so with set_type().
+// set. If it isn't, you can do so with set_range_class().
class value_range
{
value_range (tree, tree, value_range_kind kind = VR_RANGE);
value_range (const value_range &);
~value_range ();
- void set_type (tree type);
+ void set_range_class (tree type);
vrange& operator= (const vrange &);
value_range& operator= (const value_range &);
bool operator== (const value_range &r) const;
};
// The default constructor is uninitialized and must be initialized
-// with either set_type() or with an assignment into it.
+// with either set_range_class() or with an assignment into it.
inline
value_range::value_range ()
// Initialize object to an UNDEFINED range that can hold ranges of
// TYPE. Clean-up memory if there was a previous object.
+// Note that this does *not* set the type of the underlying vrange.
inline void
-value_range::set_type (tree type)
+value_range::set_range_class (tree type)
{
if (m_vrange)
m_vrange->~vrange ();
// Initialize object to an UNDEFINED range that can hold ranges of
// TYPE.
+// Note that this does *not* set the type of the underlying vrange.
inline void
value_range::init (tree type)