Static Value-Flow Analysis
Loading...
Searching...
No Matches
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.
 
 CxtStmt (const CxtStmt &ctm)
 Copy constructor.
 
virtual ~CxtStmt ()
 Destructor.
 
const CallStrCxtgetContext () const
 Return current context.
 
const ICFGNodegetStmt () const
 Return current statement.
 
bool operator< (const CxtStmt &rhs) const
 
CxtStmtoperator= (const CxtStmt &rhs)
 Overloading operator=.
 
bool operator== (const CxtStmt &rhs) const
 Overloading operator==.
 
bool operator!= (const CxtStmt &rhs) const
 Overloading operator==.
 
std::string cxtToStr () const
 Return context in string format.
 
void dump () const
 Dump CxtStmt.
 

Protected Attributes

CallStrCxt cxt
 
const ICFGNodeinst
 

Detailed Description

Context-sensitive thread statement <c,s>

Definition at line 40 of file CxtStmt.h.

Constructor & Destructor Documentation

◆ CxtStmt() [1/2]

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

Constructor.

Definition at line 44 of file CxtStmt.h.

44 :cxt(c), inst(f)
45 {
46 }
const ICFGNode * inst
Definition CxtStmt.h:115
CallStrCxt cxt
Definition CxtStmt.h:114
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ CxtStmt() [2/2]

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

Copy constructor.

Definition at line 48 of file CxtStmt.h.

48 : cxt(ctm.getContext()),inst(ctm.getStmt())
49 {
50 }

◆ ~CxtStmt()

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

Destructor.

Definition at line 52 of file CxtStmt.h.

53 {
54 }

Member Function Documentation

◆ cxtToStr()

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

Return context in string format.

Definition at line 95 of file CxtStmt.h.

96 {
97 std::string str;
98 std::stringstream rawstr(str);
99 rawstr << "[:";
100 for(CallStrCxt::const_iterator it = cxt.begin(), eit = cxt.end(); it!=eit; ++it)
101 {
102 rawstr << *it << " ";
103 }
104 rawstr << " ]";
105 return rawstr.str();
106 }

◆ dump()

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

Dump CxtStmt.

Definition at line 108 of file CxtStmt.h.

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

◆ getContext()

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

Return current context.

Definition at line 56 of file CxtStmt.h.

57 {
58 return cxt;
59 }

◆ getStmt()

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

Return current statement.

Definition at line 61 of file CxtStmt.h.

62 {
63 return inst;
64 }

◆ operator!=()

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

Overloading operator==.

Definition at line 90 of file CxtStmt.h.

91 {
92 return !(*this==rhs);
93 }

◆ 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 67 of file CxtStmt.h.

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

◆ operator=()

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

Overloading operator=.

Definition at line 75 of file CxtStmt.h.

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

◆ operator==()

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

Overloading operator==.

Definition at line 85 of file CxtStmt.h.

86 {
87 return (inst == rhs.getStmt() && cxt == rhs.getContext());
88 }

Member Data Documentation

◆ cxt

CallStrCxt SVF::CxtStmt::cxt
protected

Definition at line 114 of file CxtStmt.h.

◆ inst

const ICFGNode* SVF::CxtStmt::inst
protected

Definition at line 115 of file CxtStmt.h.


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