#include "tree.h"
#include "gimple.h"
#include "ssa.h"
+#include "pointer-query.h"
#include "gimple-array-bounds.h"
#include "gimple-iterator.h"
#include "gimple-walk.h"
#include "domwalk.h"
#include "tree-cfg.h"
#include "attribs.h"
-#include "pointer-query.h"
+
+array_bounds_checker::array_bounds_checker (struct function *func,
+ range_query *qry)
+ : fun (func), m_ptr_qry (qry)
+{
+ /* No-op. */
+}
// This purposely returns a value_range, not a value_range_equiv, to
// break the dependency on equivalences for this pass.
const value_range *
array_bounds_checker::get_value_range (const_tree op, gimple *stmt)
{
- return ranges->get_value_range (op, stmt);
+ return m_ptr_qry.rvals->get_value_range (op, stmt);
}
/* Try to determine the DECL that REF refers to. Return the DECL or
axssize = wi::to_offset (access_size);
access_ref aref;
- if (!compute_objsize (ref, m_stmt, 0, &aref, ranges))
+ if (!m_ptr_qry.get_ref (ref, m_stmt, &aref, 0))
return false;
if (aref.offset_in_range (axssize))
#ifndef GCC_GIMPLE_ARRAY_BOUNDS_H
#define GCC_GIMPLE_ARRAY_BOUNDS_H
+#include "pointer-query.h"
+
class array_bounds_checker
{
friend class check_array_bounds_dom_walker;
public:
- array_bounds_checker (struct function *fun, range_query *v)
- : fun (fun), ranges (v) { }
+ array_bounds_checker (struct function *, range_query *);
void check ();
private:
/* Current function. */
struct function *fun;
- /* Ranger instance. */
- range_query *ranges;
+ /* A pointer_query object to store information about pointers and
+ their targets in. */
+ pointer_query m_ptr_qry;
/* Current statement. */
gimple *m_stmt;
};