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

OffsetSpan - Used internally by ObjectSizeOffsetVisitor. More...

#include "llvm/Analysis/MemoryBuiltins.h"

Public Member Functions

 OffsetSpan ()=default
 Number of allocated bytes after this point.
 
 OffsetSpan (APInt Before, APInt After)
 
bool knownBefore () const
 
bool knownAfter () const
 
bool anyKnown () const
 
bool bothKnown () const
 
bool operator== (const OffsetSpan &RHS) const
 
bool operator!= (const OffsetSpan &RHS) const
 

Static Public Member Functions

static bool known (const APInt &V)
 

Public Attributes

APInt Before
 
APInt After
 Number of allocated bytes before this point.
 

Detailed Description

OffsetSpan - Used internally by ObjectSizeOffsetVisitor.

Represents a point in memory as a pair of allocated bytes before and after it.

Before and After fields are signed values. It makes it possible to represent out-of-bound access, e.g. as a result of a GEP, at the expense of not being able to represent very large allocation.

Definition at line 230 of file MemoryBuiltins.h.

Constructor & Destructor Documentation

◆ OffsetSpan() [1/2]

llvm::OffsetSpan::OffsetSpan ( )
default

Number of allocated bytes after this point.

◆ OffsetSpan() [2/2]

llvm::OffsetSpan::OffsetSpan ( APInt  Before,
APInt  After 
)
inline

Definition at line 235 of file MemoryBuiltins.h.

Member Function Documentation

◆ anyKnown()

bool llvm::OffsetSpan::anyKnown ( ) const
inline

Definition at line 239 of file MemoryBuiltins.h.

References knownAfter(), and knownBefore().

◆ bothKnown()

bool llvm::OffsetSpan::bothKnown ( ) const
inline

◆ known()

static bool llvm::OffsetSpan::known ( const APInt V)
inlinestatic

Definition at line 247 of file MemoryBuiltins.h.

Referenced by knownAfter(), and knownBefore().

◆ knownAfter()

bool llvm::OffsetSpan::knownAfter ( ) const
inline

Definition at line 238 of file MemoryBuiltins.h.

References After, and known().

Referenced by anyKnown(), bothKnown(), and llvm::ObjectSizeOffsetVisitor::compute().

◆ knownBefore()

bool llvm::OffsetSpan::knownBefore ( ) const
inline

Definition at line 237 of file MemoryBuiltins.h.

References Before, and known().

Referenced by anyKnown(), bothKnown(), and llvm::ObjectSizeOffsetVisitor::compute().

◆ operator!=()

bool llvm::OffsetSpan::operator!= ( const OffsetSpan RHS) const
inline

Definition at line 245 of file MemoryBuiltins.h.

References RHS.

◆ operator==()

bool llvm::OffsetSpan::operator== ( const OffsetSpan RHS) const
inline

Definition at line 242 of file MemoryBuiltins.h.

References After, Before, and RHS.

Member Data Documentation

◆ After

APInt llvm::OffsetSpan::After

Number of allocated bytes before this point.

Definition at line 232 of file MemoryBuiltins.h.

Referenced by llvm::ObjectSizeOffsetVisitor::compute(), knownAfter(), and operator==().

◆ Before

APInt llvm::OffsetSpan::Before

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