Static Value-Flow Analysis
Public Member Functions | Protected Attributes | List of all members
SVF::CxtStmt Class Reference

#include <CxtStmt.h>

Inheritance diagram for SVF::CxtStmt:
SVF::CxtThreadStmt

Public Member Functions

 CxtStmt (const CallStrCxt &c, const ICFGNode *f)
 Constructor. More...
 
 CxtStmt (const CxtStmt &ctm)
 Copy constructor. More...
 
virtual ~CxtStmt ()
 Destructor. More...
 
const CallStrCxtgetContext () const
 Return current context. More...
 
const ICFGNodegetStmt () const
 Return current statement. More...
 
bool operator< (const CxtStmt &rhs) const
 
CxtStmtoperator= (const CxtStmt &rhs)
 Overloading operator=. More...
 
bool operator== (const CxtStmt &rhs) const
 Overloading operator==. More...
 
bool operator!= (const CxtStmt &rhs) const
 Overloading operator==. More...
 
std::string cxtToStr () const
 Return context in string format. More...
 
void dump () const
 Dump CxtStmt. More...
 

Protected Attributes

CallStrCxt cxt
 
const ICFGNodeinst
 

Detailed Description

Context-sensitive thread statement <c,s>

Definition at line 42 of file CxtStmt.h.

Constructor & Destructor Documentation

◆ CxtStmt() [1/2]

SVF::CxtStmt::CxtStmt ( const CallStrCxt c,
const ICFGNode f 
)
inline

Constructor.

Definition at line 46 of file CxtStmt.h.

46  :cxt(c), inst(f)
47  {
48  }
const ICFGNode * inst
Definition: CxtStmt.h:117
CallStrCxt cxt
Definition: CxtStmt.h:116

◆ CxtStmt() [2/2]

SVF::CxtStmt::CxtStmt ( const CxtStmt ctm)
inline

Copy constructor.

Definition at line 50 of file CxtStmt.h.

50  : cxt(ctm.getContext()),inst(ctm.getStmt())
51  {
52  }

◆ ~CxtStmt()

virtual SVF::CxtStmt::~CxtStmt ( )
inlinevirtual

Destructor.

Definition at line 54 of file CxtStmt.h.

55  {
56  }

Member Function Documentation

◆ cxtToStr()

std::string SVF::CxtStmt::cxtToStr ( ) const
inline

Return context in string format.

Definition at line 97 of file CxtStmt.h.

98  {
99  std::string str;
100  std::stringstream rawstr(str);
101  rawstr << "[:";
102  for(CallStrCxt::const_iterator it = cxt.begin(), eit = cxt.end(); it!=eit; ++it)
103  {
104  rawstr << *it << " ";
105  }
106  rawstr << " ]";
107  return rawstr.str();
108  }
const char *const string
Definition: cJSON.h:172

◆ dump()

void SVF::CxtStmt::dump ( ) const
inline

Dump CxtStmt.

Definition at line 110 of file CxtStmt.h.

111  {
112  SVFUtil::outs() << "[ Current Stmt: " << inst->toString() << "\t Contexts: " << cxtToStr() << " ]\n";
113  }
std::string cxtToStr() const
Return context in string format.
Definition: CxtStmt.h:97
virtual const std::string toString() const
Definition: ICFG.cpp:61
std::ostream & outs()
Overwrite llvm::outs()
Definition: SVFUtil.h:50

◆ getContext()

const CallStrCxt& SVF::CxtStmt::getContext ( ) const
inline

Return current context.

Definition at line 58 of file CxtStmt.h.

59  {
60  return cxt;
61  }

◆ getStmt()

const ICFGNode* SVF::CxtStmt::getStmt ( ) const
inline

Return current statement.

Definition at line 63 of file CxtStmt.h.

64  {
65  return inst;
66  }

◆ operator!=()

bool SVF::CxtStmt::operator!= ( const CxtStmt rhs) const
inline

Overloading operator==.

Definition at line 92 of file CxtStmt.h.

93  {
94  return !(*this==rhs);
95  }

◆ operator<()

bool SVF::CxtStmt::operator< ( const CxtStmt 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 69 of file CxtStmt.h.

70  {
71  if(inst!=rhs.getStmt())
72  return inst < rhs.getStmt();
73  else
74  return cxt < rhs.getContext();
75  }

◆ operator=()

CxtStmt& SVF::CxtStmt::operator= ( const CxtStmt rhs)
inline

Overloading operator=.

Definition at line 77 of file CxtStmt.h.

78  {
79  if(*this!=rhs)
80  {
81  inst = rhs.getStmt();
82  cxt = rhs.getContext();
83  }
84  return *this;
85  }

◆ operator==()

bool SVF::CxtStmt::operator== ( const CxtStmt rhs) const
inline

Overloading operator==.

Definition at line 87 of file CxtStmt.h.

88  {
89  return (inst == rhs.getStmt() && cxt == rhs.getContext());
90  }

Member Data Documentation

◆ cxt

CallStrCxt SVF::CxtStmt::cxt
protected

Definition at line 116 of file CxtStmt.h.

◆ inst

const ICFGNode* SVF::CxtStmt::inst
protected

Definition at line 117 of file CxtStmt.h.


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