LLVM 23.0.0git
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 242 of file MemoryBuiltins.h.

Constructor & Destructor Documentation

◆ OffsetSpan() [1/2]

llvm::OffsetSpan::OffsetSpan ( )
default

Number of allocated bytes after this point.

Referenced by operator!=(), and operator==().

◆ OffsetSpan() [2/2]

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

Definition at line 247 of file MemoryBuiltins.h.

References After, and Before.

Member Function Documentation

◆ anyKnown()

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

Definition at line 251 of file MemoryBuiltins.h.

References knownAfter(), and knownBefore().

◆ bothKnown()

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

◆ known()

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

Definition at line 259 of file MemoryBuiltins.h.

Referenced by knownAfter(), and knownBefore().

◆ knownAfter()

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

Definition at line 250 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 249 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 257 of file MemoryBuiltins.h.

References OffsetSpan(), and RHS.

◆ operator==()

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

Definition at line 254 of file MemoryBuiltins.h.

References After, Before, OffsetSpan(), and RHS.

Member Data Documentation

◆ After

APInt llvm::OffsetSpan::After

Number of allocated bytes before this point.

Definition at line 244 of file MemoryBuiltins.h.

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

◆ Before

APInt llvm::OffsetSpan::Before

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