diff options
Diffstat (limited to 'gcc/rtl-ssa/accesses.h')
-rw-r--r-- | gcc/rtl-ssa/accesses.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/rtl-ssa/accesses.h b/gcc/rtl-ssa/accesses.h index 98403f7..b3a31fb 100644 --- a/gcc/rtl-ssa/accesses.h +++ b/gcc/rtl-ssa/accesses.h @@ -1044,6 +1044,42 @@ public: int comparison; }; +// This class represents the result of looking for a use of a particular +// definition at a particular point, here referred to as point P. +// There are four states: +// +// - USE is null if the definition has no uses. +// +// - Otherwise, COMPARISON is 0 if we found a definition at P. USE then +// contains this use. +// +// - Otherwise, COMPARISON is greater than 0 if we found a use that precedes P. +// USE then contains this use. +// +// - Otherwise, COMPARISON is less than zero and we found a use that follows P. +// USE then contains this use. +class use_lookup +{ +public: + // If we found a use at P, return that use, otherwise return null. + use_info *matching_use () const; + + // If we found a use at P, return that use, otherwise return prev_use (). + use_info *matching_or_prev_use () const; + + // If we found a use at P, return that use, otherwise return next_use (). + use_info *matching_or_next_use () const; + + // Return the last use that occurs before P, or null if none. + use_info *prev_use () const; + + // Return the first use that occurs after P, or null if none. + use_info *next_use () const; + + use_info *use; + int comparison; +}; + void pp_resource (pretty_printer *, resource_info); void pp_access (pretty_printer *, const access_info *, unsigned int flags = PP_ACCESS_DEFAULT); |