delete m_range_allocator;
}
+// Enable a query to evaluate staements/ramnges based on picking up ranges
+// from just an ssa-cache.
+
+bool
+ssa_cache::range_of_expr (vrange &r, tree expr, gimple *stmt)
+{
+ if (!gimple_range_ssa_p (expr))
+ return get_tree_range (r, expr, stmt);
+
+ if (!get_range (r, expr))
+ gimple_range_global (r, expr, cfun);
+ return true;
+}
+
// Return TRUE if the global range of NAME has a cache entry.
bool
// has been visited during this incarnation. Once the ranger evaluates
// a name, it is typically not re-evaluated again.
-class ssa_cache
+class ssa_cache : public range_query
{
public:
ssa_cache ();
virtual void clear_range (tree name);
virtual void clear ();
void dump (FILE *f = stderr);
+ virtual bool range_of_expr (vrange &r, tree expr, gimple *stmt);
+
protected:
vec<vrange_storage *> m_tab;
vrange_allocator *m_range_allocator;
bool get_global_range (vrange &r, tree name) const;
bool get_global_range (vrange &r, tree name, bool ¤t_p);
void set_global_range (tree name, const vrange &r, bool changed = true);
+ range_query &const_query () { return m_globals; }
void propagate_updated_value (tree name, basic_block bb);
m_stmt_list.release ();
}
+// Return a range_query which accesses just the known global values.
+
+range_query &
+gimple_ranger::const_query ()
+{
+ return m_cache.const_query ();
+}
+
bool
gimple_ranger::range_of_expr (vrange &r, tree expr, gimple *stmt)
{
bool fold_stmt (gimple_stmt_iterator *gsi, tree (*) (tree));
void register_inferred_ranges (gimple *s);
void register_transitive_inferred_ranges (basic_block bb);
+ range_query &const_query ();
protected:
bool fold_range_internal (vrange &r, gimple *s, tree name);
void prefill_name (vrange &r, tree name);