Static Value-Flow Analysis
Public Member Functions | Private Attributes | List of all members
SVF::CxtStmtDPItem< LocCond > Class Template Reference

#include <DPItem.h>

Inheritance diagram for SVF::CxtStmtDPItem< LocCond >:
SVF::StmtDPItem< LocCond > SVF::DPItem

Public Member Functions

 CxtStmtDPItem (const CxtVar &var, const LocCond *locCond)
 Constructor. More...
 
 CxtStmtDPItem (const CxtStmtDPItem< LocCond > &dps)
 Copy constructor. More...
 
virtual ~CxtStmtDPItem ()
 Destructor. More...
 
CxtVar getCondVar () const
 Get context var. More...
 
const ContextCondgetCond () const
 Get context. More...
 
ContextCondgetCond ()
 Get context. More...
 
bool pushContext (NodeID cxt)
 Push context. More...
 
bool matchContext (NodeID cxt)
 Match context. More...
 
bool operator< (const CxtStmtDPItem< LocCond > &rhs) const
 
CxtStmtDPItem< LocCond > & operator= (const CxtStmtDPItem< LocCond > &rhs)
 Overloading operator=. More...
 
bool operator== (const CxtStmtDPItem< LocCond > &rhs) const
 Overloading operator==. More...
 
bool operator!= (const CxtStmtDPItem< LocCond > &rhs) const
 Overloading operator==. More...
 
void dump () const
 
- Public Member Functions inherited from SVF::StmtDPItem< LocCond >
 StmtDPItem (NodeID c, const LocCond *locCond)
 Constructor. More...
 
 StmtDPItem (const StmtDPItem &dps)
 Copy constructor. More...
 
virtual ~StmtDPItem ()
 Destructor. More...
 
const LocCond * getLoc () const
 Get context. More...
 
void setLoc (const LocCond *l)
 Set location. More...
 
void setLocVar (const LocCond *l, NodeID v)
 Set location and pointer id. More...
 
bool operator< (const StmtDPItem &rhs) const
 
StmtDPItemoperator= (const StmtDPItem &rhs)
 Overloading operator==. More...
 
bool operator== (const StmtDPItem &rhs) const
 Overloading operator==. More...
 
bool operator!= (const StmtDPItem &rhs) const
 Overloading operator!=. More...
 
void dump () const
 
- Public Member Functions inherited from SVF::DPItem
 DPItem (NodeID c)
 Constructor. More...
 
 DPItem (const DPItem &dps)
 Copy constructor. More...
 
 DPItem (DPItem &&dps) noexcept
 Move constructor. More...
 
DPItemoperator= (DPItem &&rhs) noexcept
 Move operator=. More...
 
virtual ~DPItem ()
 Destructor. More...
 
NodeID getCurNodeID () const
 
void setCurNodeID (NodeID c)
 
bool operator< (const DPItem &rhs) const
 
DPItemoperator= (const DPItem &rhs)
 Overloading Operator=. More...
 
bool operator== (const DPItem &rhs) const
 Overloading Operator==. More...
 
bool operator!= (const DPItem &rhs) const
 Overloading Operator!=. More...
 
void dump () const
 

Private Attributes

ContextCond context
 

Additional Inherited Members

- Static Public Member Functions inherited from SVF::DPItem
static void setMaxBudget (u32_t max)
 set max step budge per query More...
 
static u32_t getMaxBudget ()
 
- Protected Attributes inherited from SVF::StmtDPItem< LocCond >
const LocCond * curloc
 
- Protected Attributes inherited from SVF::DPItem
NodeID cur
 
- Static Protected Attributes inherited from SVF::DPItem
static u64_t maximumBudget = ULONG_MAX - 1
 

Detailed Description

template<class LocCond>
class SVF::CxtStmtDPItem< LocCond >

Definition at line 389 of file DPItem.h.

Constructor & Destructor Documentation

◆ CxtStmtDPItem() [1/2]

template<class LocCond >
SVF::CxtStmtDPItem< LocCond >::CxtStmtDPItem ( const CxtVar var,
const LocCond *  locCond 
)
inline

Constructor.

Definition at line 395 of file DPItem.h.

395  : StmtDPItem<LocCond>(var.get_id(),locCond), context(var.get_cond())
396  {
397  }
ContextCond context
Definition: DPItem.h:392

◆ CxtStmtDPItem() [2/2]

template<class LocCond >
SVF::CxtStmtDPItem< LocCond >::CxtStmtDPItem ( const CxtStmtDPItem< LocCond > &  dps)
inline

Copy constructor.

Definition at line 399 of file DPItem.h.

399  :
400  StmtDPItem<LocCond>(dps), context(dps.context)
401  {
402  }

◆ ~CxtStmtDPItem()

template<class LocCond >
virtual SVF::CxtStmtDPItem< LocCond >::~CxtStmtDPItem ( )
inlinevirtual

Destructor.

Definition at line 404 of file DPItem.h.

405  {
406  }

Member Function Documentation

◆ dump()

template<class LocCond >
void SVF::CxtStmtDPItem< LocCond >::dump ( ) const
inline

Definition at line 466 of file DPItem.h.

467  {
468  SVFUtil::outs() << "statement " << *(this->curloc) << ", var " << this->cur << " ";
469  SVFUtil::outs() << this->context.toString() <<"\n";
470  }
std::string toString() const
Dump context condition.
Definition: DPItem.h:360
NodeID cur
Definition: DPItem.h:47
const LocCond * curloc
Definition: DPItem.h:136
std::ostream & outs()
Overwrite llvm::outs()
Definition: SVFUtil.h:50

◆ getCond() [1/2]

template<class LocCond >
ContextCond& SVF::CxtStmtDPItem< LocCond >::getCond ( )
inline

Get context.

Definition at line 419 of file DPItem.h.

420  {
421  return this->context;
422  }

◆ getCond() [2/2]

template<class LocCond >
const ContextCond& SVF::CxtStmtDPItem< LocCond >::getCond ( ) const
inline

Get context.

Definition at line 414 of file DPItem.h.

415  {
416  return this->context;
417  }

◆ getCondVar()

template<class LocCond >
CxtVar SVF::CxtStmtDPItem< LocCond >::getCondVar ( ) const
inline

Get context var.

Definition at line 408 of file DPItem.h.

409  {
410  CxtVar var(this->context,this->cur);
411  return var;
412  }
CondVar< ContextCond > CxtVar
Definition: DPItem.h:385

◆ matchContext()

template<class LocCond >
bool SVF::CxtStmtDPItem< LocCond >::matchContext ( NodeID  cxt)
inline

Match context.

Definition at line 430 of file DPItem.h.

431  {
432  return this->context.matchContext(cxt);
433  }
virtual bool matchContext(NodeID ctx)
Match context.
Definition: DPItem.h:303

◆ operator!=()

template<class LocCond >
bool SVF::CxtStmtDPItem< LocCond >::operator!= ( const CxtStmtDPItem< LocCond > &  rhs) const
inline

Overloading operator==.

Definition at line 462 of file DPItem.h.

463  {
464  return !(*this==rhs);
465  }

◆ operator<()

template<class LocCond >
bool SVF::CxtStmtDPItem< LocCond >::operator< ( const CxtStmtDPItem< LocCond > &  rhs) const
inline

Enable compare operator to avoid duplicated item insertion in map or set to be noted that two vectors can also overload operator()

Definition at line 437 of file DPItem.h.

438  {
439  if (this->cur != rhs.cur)
440  return this->cur < rhs.cur;
441  else if(this->curloc != rhs.getLoc())
442  return this->curloc < rhs.getLoc();
443  else
444  return this->context < rhs.context;
445  }
CallStrCxt context
Definition: DPItem.h:373

◆ operator=()

template<class LocCond >
CxtStmtDPItem<LocCond>& SVF::CxtStmtDPItem< LocCond >::operator= ( const CxtStmtDPItem< LocCond > &  rhs)
inline

Overloading operator=.

Definition at line 447 of file DPItem.h.

448  {
449  if(*this!=rhs)
450  {
452  this->context = rhs.getCond();
453  }
454  return *this;
455  }
StmtDPItem & operator=(const StmtDPItem &rhs)
Overloading operator==.
Definition: DPItem.h:178

◆ operator==()

template<class LocCond >
bool SVF::CxtStmtDPItem< LocCond >::operator== ( const CxtStmtDPItem< LocCond > &  rhs) const
inline

Overloading operator==.

Definition at line 457 of file DPItem.h.

458  {
459  return (this->cur == rhs.cur && this->curloc == rhs.getLoc() && this->context == rhs.context);
460  }

◆ pushContext()

template<class LocCond >
bool SVF::CxtStmtDPItem< LocCond >::pushContext ( NodeID  cxt)
inline

Push context.

Definition at line 424 of file DPItem.h.

425  {
426  return this->context.pushContext(cxt);
427  }
virtual bool pushContext(NodeID ctx)
Push context.
Definition: DPItem.h:279

Member Data Documentation

◆ context

template<class LocCond >
ContextCond SVF::CxtStmtDPItem< LocCond >::context
private

Definition at line 392 of file DPItem.h.


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