GCC Middle and Back End API Reference
access_ref Struct Reference

#include <pointer-query.h>

Public Member Functions

 access_ref ()
 
gphiphi () const
 
void merge_ref (vec< access_ref > *all_refs, tree, gimple *, int, bool, ssa_name_limit_t &, pointer_query &)
 
tree get_ref (vec< access_ref > *, access_ref *=nullptr, int=1, ssa_name_limit_t *=nullptr, pointer_query *=nullptr) const
 
bool offset_zero () const
 
bool offset_bounded () const
 
offset_int size_remaining (offset_int *=nullptr) const
 
bool offset_in_range (const offset_int &) const
 
bool ref_declared () const
 
void set_max_size_range ()
 
void add_offset (const offset_int &off)
 
void add_offset (const offset_int &, const offset_int &)
 
void add_max_offset ()
 
void inform_access (access_mode, int=1) const
 
void dump (FILE *) const
 

Data Fields

tree ref
 
offset_int offrng [2]
 
offset_int sizrng [2]
 
offset_int offmax [2]
 
tree(* eval )(tree)
 
int deref
 
bool ref_nullptr_p
 
bool trail1special
 
bool base0
 
bool parmarray
 

Detailed Description

Describes a reference to an object used in an access.   

Constructor & Destructor Documentation

◆ access_ref()

access_ref::access_ref ( )
Initialize the object.   

Member Function Documentation

◆ add_max_offset()

void access_ref::add_max_offset ( )
inline

◆ add_offset() [1/2]

void access_ref::add_offset ( const offset_int & min,
const offset_int & max )
Add the range [MIN, MAX] to the offset range.  For known objects (with
zero-based offsets) at least one of whose offset's bounds is in range,
constrain the other (or both) to the bounds of the object (i.e., zero
and the upper bound of its size).  This improves the quality of
diagnostics.   

References wi::abs(), add_max_offset(), base0, ggc_alloc(), offmax, offrng, ptrdiff_type_node, size_remaining(), sizrng, wi::to_offset(), and TYPE_MAX_VALUE.

◆ add_offset() [2/2]

void access_ref::add_offset ( const offset_int & off)
inline

References add_offset().

Referenced by add_max_offset(), and add_offset().

◆ dump()

◆ get_ref()

tree access_ref::get_ref ( vec< access_ref > * all_refs,
access_ref * pref = nullptr,
int ostype = 1,
ssa_name_limit_t * psnlim = nullptr,
pointer_query * qry = nullptr ) const
Determine and return the largest object to which *THIS refers.  If
*THIS refers to a PHI and PREF is nonnull, fill *PREF with the details
of the object determined by compute_objsize(ARG, OSTYPE) for each PHI
argument ARG.   

References gcc_assert, ggc_alloc(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_phi_arg_def(), gimple_phi_num_args(), i, is_gimple_assign(), max_object_size(), NULL, NULL_TREE, phi(), pref, ref, SSA_NAME_DEF_STMT, wi::to_offset(), and TREE_CODE.

Referenced by inform_access().

◆ inform_access()

◆ merge_ref()

void access_ref::merge_ref ( vec< access_ref > * all_refs,
tree arg,
gimple * stmt,
int ostype,
bool skip_null,
ssa_name_limit_t & snlim,
pointer_query & qry )
Determine the size and offset for ARG, append it to ALL_REFS, and
merge the result with *THIS.  Ignore ARG if SKIP_NULL is set and
ARG refers to the null pointer.  Return true on success and false
on failure.   

References add_max_offset(), base0, compute_objsize_r(), deref, ggc_alloc(), integer_zerop(), max_object_size(), offrng, parmarray, set_max_size_range(), sizrng, wi::to_offset(), and TREE_CODE.

◆ offset_bounded()

bool access_ref::offset_bounded ( ) const
Return true if OFFRNG is bounded to a subrange of offset values
valid for the largest possible object.   

References offrng, ptrdiff_type_node, wi::to_offset(), TYPE_MAX_VALUE, and TYPE_MIN_VALUE.

◆ offset_in_range()

bool access_ref::offset_in_range ( const offset_int & size) const
Return true if the offset and object size are in range for SIZE.   

References base0, ggc_alloc(), offmax, ptrdiff_type_node, size_remaining(), sizrng, wi::to_offset(), and TYPE_MAX_VALUE.

◆ offset_zero()

bool access_ref::offset_zero ( ) const
inline

References offrng.

◆ phi()

gphi * access_ref::phi ( ) const
Return the PHI node REF refers to or null if it doesn't.   

References ggc_alloc(), NULL, ref, SSA_NAME_DEF_STMT, and TREE_CODE.

Referenced by dump(), get_ref(), inform_access(), and maybe_warn_for_bound().

◆ ref_declared()

bool access_ref::ref_declared ( ) const
inline

References base0, DECL_P, deref, and ref.

◆ set_max_size_range()

void access_ref::set_max_size_range ( )
inline

References max_object_size(), sizrng, and wi::to_offset().

Referenced by merge_ref().

◆ size_remaining()

offset_int access_ref::size_remaining ( offset_int * pmin = nullptr) const
Return the maximum amount of space remaining and if non-null, set
argument to the minimum.   

References base0, gcc_checking_assert, ggc_alloc(), max_object_size(), offrng, sizrng, and wi::to_offset().

Referenced by add_offset(), check_access(), maybe_warn_for_bound(), and offset_in_range().

Field Documentation

◆ base0

◆ deref

int access_ref::deref

Referenced by dump(), merge_ref(), and ref_declared().

◆ eval

tree(* access_ref::eval) (tree)

◆ offmax

offset_int access_ref::offmax[2]

Referenced by add_offset(), and offset_in_range().

◆ offrng

◆ parmarray

bool access_ref::parmarray

Referenced by check_access(), and merge_ref().

◆ ref

◆ ref_nullptr_p

bool access_ref::ref_nullptr_p

Referenced by inform_access().

◆ sizrng

◆ trail1special

bool access_ref::trail1special

The documentation for this struct was generated from the following files: