klee
klee::ExtractExpr Class Reference

#include <Expr.h>

Inheritance diagram for klee::ExtractExpr:
Collaboration diagram for klee::ExtractExpr:

Public Member Functions

Width getWidth () const
 
Kind getKind () const
 
unsigned getNumKids () const
 
ref< ExprgetKid (unsigned i) const
 
int compareContents (const Expr &b) const
 
virtual ref< Exprrebuild (ref< Expr > kids[]) const
 
virtual unsigned computeHash ()
 
- Public Member Functions inherited from klee::Expr
 Expr ()
 
virtual ~Expr ()
 
virtual Kind getKind () const =0
 
virtual Width getWidth () const =0
 
virtual unsigned getNumKids () const =0
 
virtual ref< ExprgetKid (unsigned i) const =0
 
virtual void print (llvm::raw_ostream &os) const
 
void dump () const
 dump - Print the expression to stderr. More...
 
virtual unsigned hash () const
 Returns the pre-computed hash of the current expression. More...
 
virtual unsigned computeHash ()
 
int compare (const Expr &b) const
 
virtual ref< Exprrebuild (ref< Expr > kids[]) const =0
 
bool isZero () const
 isZero - Is this a constant zero. More...
 
bool isTrue () const
 isTrue - Is this the true expression. More...
 
bool isFalse () const
 isFalse - Is this the false expression. More...
 

Static Public Member Functions

static ref< Expralloc (const ref< Expr > &e, unsigned o, Width w)
 
static ref< Exprcreate (ref< Expr > e, unsigned bitOff, Width w)
 Creates an ExtractExpr with the given bit offset and width. More...
 
static bool classof (const Expr *E)
 
static bool classof (const ExtractExpr *)
 
- Static Public Member Functions inherited from klee::NonConstantExpr
static bool classof (const Expr *E)
 
static bool classof (const NonConstantExpr *)
 
- Static Public Member Functions inherited from klee::Expr
static void printKind (llvm::raw_ostream &os, Kind k)
 
static void printWidth (llvm::raw_ostream &os, Expr::Width w)
 
static unsigned getMinBytesForWidth (Width w)
 returns the smallest number of bytes in which the given width fits More...
 
static ref< ExprcreateSExtToPointerWidth (ref< Expr > e)
 
static ref< ExprcreateZExtToPointerWidth (ref< Expr > e)
 
static ref< ExprcreateImplies (ref< Expr > hyp, ref< Expr > conc)
 
static ref< ExprcreateIsZero (ref< Expr > e)
 
static ref< ExprcreateTempRead (const Array *array, Expr::Width w)
 
static ref< ConstantExprcreatePointer (uint64_t v)
 
static ref< ExprcreateFromKind (Kind k, std::vector< CreateArg > args)
 
static bool isValidKidWidth (unsigned kid, Width w)
 
static bool needsResultType ()
 
static bool classof (const Expr *)
 

Public Attributes

ref< Exprexpr
 
unsigned offset
 
Width width
 
- Public Attributes inherited from klee::Expr
class ReferenceCounter _refCount
 Required by klee::ref-managed objects. More...
 

Static Public Attributes

static const Kind kind = Extract
 
static const unsigned numKids = 1
 
- Static Public Attributes inherited from klee::Expr
static unsigned count = 0
 
static const unsigned MAGIC_HASH_CONSTANT = 39
 
static const Width InvalidWidth = 0
 
static const Width Bool = 1
 
static const Width Int8 = 8
 
static const Width Int16 = 16
 
static const Width Int32 = 32
 
static const Width Int64 = 64
 
static const Width Fl80 = 80
 

Private Member Functions

 ExtractExpr (const ref< Expr > &e, unsigned b, Width w)
 

Additional Inherited Members

- Public Types inherited from klee::Expr
enum  Kind {
  InvalidKind = -1 , Constant = 0 , NotOptimized , Read =NotOptimized+2 ,
  Select , Concat , Extract , ZExt ,
  SExt , Not , Add , Sub ,
  Mul , UDiv , SDiv , URem ,
  SRem , And , Or , Xor ,
  Shl , LShr , AShr , Eq ,
  Ne , Ult , Ule , Ugt ,
  Uge , Slt , Sle , Sgt ,
  Sge , LastKind =Sge , CastKindFirst =ZExt , CastKindLast =SExt ,
  BinaryKindFirst =Add , BinaryKindLast =Sge , CmpKindFirst =Eq , CmpKindLast =Sge
}
 
typedef unsigned Width
 The type of an expression is simply its width, in bits. More...
 
virtual int compareContents (const Expr &b) const =0
 
- Protected Attributes inherited from klee::Expr
unsigned hashValue
 

Detailed Description

This class represents an extract from expression {\tt expr}, at bit offset {\tt offset} of width {\tt width}. Bit 0 is the right most bit of the expression.

Definition at line 739 of file Expr.h.

Constructor & Destructor Documentation

◆ ExtractExpr()

klee::ExtractExpr::ExtractExpr ( const ref< Expr > &  e,
unsigned  b,
Width  w 
)
inlineprivate

Definition at line 779 of file Expr.h.

Referenced by alloc().

Here is the caller graph for this function:

Member Function Documentation

◆ alloc()

static ref< Expr > klee::ExtractExpr::alloc ( const ref< Expr > &  e,
unsigned  o,
Width  w 
)
inlinestatic

Definition at line 750 of file Expr.h.

References klee::Expr::computeHash(), and ExtractExpr().

Referenced by klee::ExprOptimizer::buildConstantSelectExpr(), and create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ classof() [1/2]

static bool klee::ExtractExpr::classof ( const Expr E)
inlinestatic

Definition at line 783 of file Expr.h.

References klee::Expr::Extract, and klee::Expr::getKind().

Here is the call graph for this function:

◆ classof() [2/2]

static bool klee::ExtractExpr::classof ( const ExtractExpr )
inlinestatic

Definition at line 786 of file Expr.h.

◆ compareContents()

int klee::ExtractExpr::compareContents ( const Expr b) const
inlinevirtual

Compares b to this Expr and determines how they are ordered (ignoring their kid expressions - i.e. those returned by getKid()).

Typically this requires comparing internal attributes of the Expr.

Implementations can assume that b and this are of the same kind.

This method effectively defines a partial order over Expr of the same kind (partial because kid Expr are not compared).

This method should not be called directly. Instead compare() should be used.

Parameters
[in]bExpr to compare this to.
Returns
One of the following values:
  • -1 if this is < b ignoring kid expressions.
  • 1 if this is > b ignoring kid expressions.
  • 0 if this and b are not ordered.

< and > are binary relations that express the partial order.

Implements klee::Expr.

Definition at line 765 of file Expr.h.

References offset, and width.

◆ computeHash()

unsigned ExtractExpr::computeHash ( )
virtual

(Re)computes the hash of the current expression. Returns the hash value.

Reimplemented from klee::Expr.

Definition at line 211 of file Expr.cpp.

References expr, getWidth(), klee::Expr::hash(), klee::Expr::hashValue, klee::Expr::MAGIC_HASH_CONSTANT, and offset.

Here is the call graph for this function:

◆ create()

ref< Expr > ExtractExpr::create ( ref< Expr e,
unsigned  bitOff,
Width  w 
)
static

◆ getKid()

ref< Expr > klee::ExtractExpr::getKid ( unsigned  i) const
inlinevirtual

Implements klee::Expr.

Definition at line 763 of file Expr.h.

References expr.

◆ getKind()

Kind klee::ExtractExpr::getKind ( ) const
inlinevirtual

Implements klee::Expr.

Definition at line 760 of file Expr.h.

References klee::Expr::Extract.

◆ getNumKids()

unsigned klee::ExtractExpr::getNumKids ( ) const
inlinevirtual

Implements klee::Expr.

Definition at line 762 of file Expr.h.

References numKids.

◆ getWidth()

Width klee::ExtractExpr::getWidth ( ) const
inlinevirtual

Implements klee::Expr.

Definition at line 759 of file Expr.h.

References width.

Referenced by computeHash(), and create().

Here is the caller graph for this function:

◆ rebuild()

virtual ref< Expr > klee::ExtractExpr::rebuild ( ref< Expr kids[]) const
inlinevirtual

Implements klee::Expr.

Definition at line 772 of file Expr.h.

References create(), offset, and width.

Here is the call graph for this function:

Member Data Documentation

◆ expr

ref<Expr> klee::ExtractExpr::expr

Definition at line 745 of file Expr.h.

Referenced by computeHash(), create(), getKid(), and PPrinter::printExtract().

◆ kind

const Kind klee::ExtractExpr::kind = Extract
static

Definition at line 741 of file Expr.h.

◆ numKids

const unsigned klee::ExtractExpr::numKids = 1
static

Definition at line 742 of file Expr.h.

Referenced by getNumKids().

◆ offset

unsigned klee::ExtractExpr::offset

Definition at line 746 of file Expr.h.

Referenced by compareContents(), computeHash(), PPrinter::printExtract(), and rebuild().

◆ width

Width klee::ExtractExpr::width

Definition at line 747 of file Expr.h.

Referenced by compareContents(), getWidth(), and rebuild().


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