LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
llvm::AA::RangeTy Struct Reference

Helper to represent an access offset and size, with logic to deal with uncertainty and check for overlapping accesses. More...

#include "llvm/Transforms/IPO/Attributor.h"

Public Member Functions

 RangeTy (int64_t Offset, int64_t Size)
 
 RangeTy ()=default
 
bool offsetOrSizeAreUnknown () const
 Return true if offset or size are unknown.
 
bool offsetAndSizeAreUnknown () const
 Return true if offset and size are unknown, thus this is the default unknown object.
 
bool isUnassigned () const
 Return true if the offset and size are unassigned.
 
bool mayOverlap (const RangeTy &Range) const
 Return true if this offset and size pair might describe an address that overlaps with Range.
 
RangeTyoperator&= (const RangeTy &R)
 

Static Public Member Functions

static RangeTy getUnknown ()
 
static bool OffsetLessThan (const RangeTy &L, const RangeTy &R)
 Comparison for sorting ranges by offset.
 

Public Attributes

int64_t Offset = Unassigned
 
int64_t Size = Unassigned
 

Static Public Attributes

static constexpr int64_t Unassigned = std::numeric_limits<int32_t>::min()
 Constants used to represent special offsets or sizes.
 
static constexpr int64_t Unknown = std::numeric_limits<int32_t>::max()
 

Detailed Description

Helper to represent an access offset and size, with logic to deal with uncertainty and check for overlapping accesses.

Definition at line 237 of file Attributor.h.

Constructor & Destructor Documentation

◆ RangeTy() [1/2]

llvm::AA::RangeTy::RangeTy ( int64_t  Offset,
int64_t  Size 
)
inline

Definition at line 241 of file Attributor.h.

◆ RangeTy() [2/2]

llvm::AA::RangeTy::RangeTy ( )
default

Member Function Documentation

◆ getUnknown()

static RangeTy llvm::AA::RangeTy::getUnknown ( )
inlinestatic

Definition at line 243 of file Attributor.h.

References Unknown.

Referenced by llvm::AAPointerInfo::RangeList::setUnknown().

◆ isUnassigned()

bool llvm::AA::RangeTy::isUnassigned ( ) const
inline

Return true if the offset and size are unassigned.

Definition at line 257 of file Attributor.h.

References assert(), Offset, Size, and Unassigned.

Referenced by operator&=().

◆ mayOverlap()

bool llvm::AA::RangeTy::mayOverlap ( const RangeTy Range) const
inline

Return true if this offset and size pair might describe an address that overlaps with Range.

Definition at line 265 of file Attributor.h.

References Offset, offsetOrSizeAreUnknown(), Range, and Size.

◆ offsetAndSizeAreUnknown()

bool llvm::AA::RangeTy::offsetAndSizeAreUnknown ( ) const
inline

Return true if offset and size are unknown, thus this is the default unknown object.

Definition at line 252 of file Attributor.h.

References Offset, Size, and Unknown.

Referenced by operator&=().

◆ OffsetLessThan()

static bool llvm::AA::RangeTy::OffsetLessThan ( const RangeTy L,
const RangeTy R 
)
inlinestatic

Comparison for sorting ranges by offset.

Returns true if the offset L is less than that of R.

Definition at line 300 of file Attributor.h.

Referenced by llvm::AAPointerInfo::RangeList::insert(), llvm::AAPointerInfo::RangeList::push_back(), and llvm::AAPointerInfo::RangeList::set_difference().

◆ offsetOrSizeAreUnknown()

bool llvm::AA::RangeTy::offsetOrSizeAreUnknown ( ) const
inline

Return true if offset or size are unknown.

Definition at line 246 of file Attributor.h.

References Offset, Size, and Unknown.

Referenced by llvm::AA::getInitialValueForObj(), and mayOverlap().

◆ operator&=()

RangeTy & llvm::AA::RangeTy::operator&= ( const RangeTy R)
inline

Definition at line 275 of file Attributor.h.

References isUnassigned(), Offset, offsetAndSizeAreUnknown(), Size, and Unknown.

Member Data Documentation

◆ Offset

int64_t llvm::AA::RangeTy::Offset = Unassigned

◆ Size

int64_t llvm::AA::RangeTy::Size = Unassigned

◆ Unassigned

constexpr int64_t llvm::AA::RangeTy::Unassigned = std::numeric_limits<int32_t>::min()
staticconstexpr

Constants used to represent special offsets or sizes.

  • We cannot assume that Offsets and Size are non-negative.
  • The constants should not clash with DenseMapInfo, such as EmptyKey (INT64_MAX) and TombstoneKey (INT64_MIN). We use values "in the middle" of the 64 bit range to represent these special cases.

Definition at line 310 of file Attributor.h.

Referenced by isUnassigned().

◆ Unknown

constexpr int64_t llvm::AA::RangeTy::Unknown = std::numeric_limits<int32_t>::max()
staticconstexpr

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