LLVM  7.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
llvm::ValueLatticeElement Class Reference

#include "llvm/Analysis/ValueLattice.h"

Collaboration diagram for llvm::ValueLatticeElement:
Collaboration graph
[legend]

Public Member Functions

 ValueLatticeElement ()
 
 ~ValueLatticeElement ()
 Custom destructor to ensure Range is properly destroyed, when the object is deallocated. More...
 
 ValueLatticeElement (const ValueLatticeElement &Other)
 Custom copy constructor, to ensure Range gets initialized when copying a constant range lattice element. More...
 
ValueLatticeElementoperator= (const ValueLatticeElement &Other)
 Custom assignment operator, to ensure Range gets initialized when assigning a constant range lattice element. More...
 
bool isUndefined () const
 
bool isConstant () const
 
bool isNotConstant () const
 
bool isConstantRange () const
 
bool isOverdefined () const
 
ConstantgetConstant () const
 
ConstantgetNotConstant () const
 
const ConstantRangegetConstantRange () const
 
Optional< APIntasConstantInteger () const
 
bool mergeIn (const ValueLatticeElement &RHS, const DataLayout &DL)
 Updates this object to approximate both this object and RHS. More...
 
ConstantIntgetConstantInt () const
 
ConstantgetCompare (CmpInst::Predicate Pred, Type *Ty, const ValueLatticeElement &Other) const
 Compares this symbolic value with Other using Pred and returns either true, false or undef constants, or nullptr if the comparison cannot be evaluated. More...
 

Static Public Member Functions

static ValueLatticeElement get (Constant *C)
 
static ValueLatticeElement getNot (Constant *C)
 
static ValueLatticeElement getRange (ConstantRange CR)
 
static ValueLatticeElement getOverdefined ()
 

Detailed Description

Definition at line 27 of file ValueLattice.h.

Constructor & Destructor Documentation

◆ ValueLatticeElement() [1/2]

llvm::ValueLatticeElement::ValueLatticeElement ( )
inline

Definition at line 64 of file ValueLattice.h.

◆ ~ValueLatticeElement()

llvm::ValueLatticeElement::~ValueLatticeElement ( )
inline

Custom destructor to ensure Range is properly destroyed, when the object is deallocated.

Definition at line 68 of file ValueLattice.h.

References Range.

◆ ValueLatticeElement() [2/2]

llvm::ValueLatticeElement::ValueLatticeElement ( const ValueLatticeElement Other)
inline

Custom copy constructor, to ensure Range gets initialized when copying a constant range lattice element.

Definition at line 83 of file ValueLattice.h.

Member Function Documentation

◆ asConstantInteger()

Optional<APInt> llvm::ValueLatticeElement::asConstantInteger ( ) const
inline

◆ get()

static ValueLatticeElement llvm::ValueLatticeElement::get ( Constant C)
inlinestatic

◆ getCompare()

Constant* llvm::ValueLatticeElement::getCompare ( CmpInst::Predicate  Pred,
Type Ty,
const ValueLatticeElement Other 
) const
inline

Compares this symbolic value with Other using Pred and returns either true, false or undef constants, or nullptr if the comparison cannot be evaluated.

Definition at line 292 of file ValueLattice.h.

References contains(), llvm::UndefValue::get(), llvm::ConstantExpr::getCompare(), getConstant(), getConstantRange(), llvm::ConstantInt::getFalse(), llvm::CmpInst::getInversePredicate(), llvm::ConstantInt::getTrue(), isConstant(), isConstantRange(), isUndefined(), llvm::ConstantRange::makeSatisfyingICmpRegion(), and llvm::operator<<().

Referenced by tryToReplaceWithConstantRange().

◆ getConstant()

Constant* llvm::ValueLatticeElement::getConstant ( ) const
inline

◆ getConstantInt()

ConstantInt* llvm::ValueLatticeElement::getConstantInt ( ) const
inline

Definition at line 283 of file ValueLattice.h.

References assert(), getConstant(), and isConstant().

◆ getConstantRange()

const ConstantRange& llvm::ValueLatticeElement::getConstantRange ( ) const
inline

◆ getNot()

static ValueLatticeElement llvm::ValueLatticeElement::getNot ( Constant C)
inlinestatic

◆ getNotConstant()

Constant* llvm::ValueLatticeElement::getNotConstant ( ) const
inline

Definition at line 154 of file ValueLattice.h.

References assert(), ConstVal, and isNotConstant().

Referenced by asConstantInteger(), getPredicateResult(), mergeIn(), and llvm::operator<<().

◆ getOverdefined()

static ValueLatticeElement llvm::ValueLatticeElement::getOverdefined ( )
inlinestatic

◆ getRange()

static ValueLatticeElement llvm::ValueLatticeElement::getRange ( ConstantRange  CR)
inlinestatic

◆ isConstant()

bool llvm::ValueLatticeElement::isConstant ( ) const
inline

◆ isConstantRange()

bool llvm::ValueLatticeElement::isConstantRange ( ) const
inline

◆ isNotConstant()

bool llvm::ValueLatticeElement::isNotConstant ( ) const
inline

◆ isOverdefined()

bool llvm::ValueLatticeElement::isOverdefined ( ) const
inline

◆ isUndefined()

bool llvm::ValueLatticeElement::isUndefined ( ) const
inline

◆ mergeIn()

bool llvm::ValueLatticeElement::mergeIn ( const ValueLatticeElement RHS,
const DataLayout DL 
)
inline

Updates this object to approximate both this object and RHS.

Returns true if this object has been changed.

Definition at line 241 of file ValueLattice.h.

References assert(), getConstant(), getConstantRange(), getNotConstant(), isConstant(), isConstantRange(), llvm::ConstantRange::isFullSet(), isNotConstant(), isOverdefined(), isUndefined(), and llvm::ConstantRange::unionWith().

Referenced by isObjectDereferencedInBlock().

◆ operator=()

ValueLatticeElement& llvm::ValueLatticeElement::operator= ( const ValueLatticeElement Other)
inline

Custom assignment operator, to ensure Range gets initialized when assigning a constant range lattice element.

Definition at line 89 of file ValueLattice.h.

References ConstVal, isConstant(), isConstantRange(), isNotConstant(), and Range.

Member Data Documentation

◆ ConstVal

Constant* llvm::ValueLatticeElement::ConstVal

Definition at line 58 of file ValueLattice.h.

Referenced by asConstantInteger(), getConstant(), getNotConstant(), and operator=().

◆ Range

ConstantRange llvm::ValueLatticeElement::Range

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