Skip to content

Commit

Permalink
Remove range_has_numeric_bounds_p.
Browse files Browse the repository at this point in the history
gcc/ChangeLog:

	* value-range.cc (irange::copy_legacy_to_multi_range): Rewrite use
	of range_has_numeric_bounds_p with irange API.
	(range_has_numeric_bounds_p): Delete.
	* value-range.h (range_has_numeric_bounds_p): Delete.
  • Loading branch information
aldyh committed Apr 26, 2023
1 parent ebef388 commit 5db3d28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
12 changes: 3 additions & 9 deletions gcc/value-range.cc
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,9 @@ irange::copy_legacy_to_multi_range (const irange &src)
set_varying (src.type ());
else
{
if (range_has_numeric_bounds_p (&src))
if (!src.undefined_p ()
&& TREE_CODE (src.min ()) == INTEGER_CST
&& TREE_CODE (src.max ()) == INTEGER_CST)
set (src.min (), src.max (), src.kind ());
else
{
Expand Down Expand Up @@ -3068,14 +3070,6 @@ ranges_from_anti_range (const value_range *ar,
return !vr0->undefined_p ();
}

bool
range_has_numeric_bounds_p (const irange *vr)
{
return (!vr->undefined_p ()
&& TREE_CODE (vr->min ()) == INTEGER_CST
&& TREE_CODE (vr->max ()) == INTEGER_CST);
}

/* Return whether VAL is equal to the maximum value of its type.
We can't do a simple equality comparison with TYPE_MAX_VALUE because
C typedefs and Ada subtypes can produce types whose TYPE_MAX_VALUE
Expand Down
1 change: 0 additions & 1 deletion gcc/value-range.h
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,6 @@ irange::legacy_mode_p () const
return m_max_ranges == 1;
}

extern bool range_has_numeric_bounds_p (const irange *);
extern bool ranges_from_anti_range (const value_range *,
value_range *, value_range *);
extern value_range_kind get_legacy_range (const irange &, tree &min, tree &max);
Expand Down

0 comments on commit 5db3d28

Please sign in to comment.