Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
SVF::CxtThread Class Reference

#include <CxtStmt.h>

Public Member Functions

 CxtThread (const CallStrCxt &c, const ICFGNode *fork)
 Constructor.
 
 CxtThread (const CxtThread &ct)
 Copy constructor.
 
virtual ~CxtThread ()
 Destructor.
 
const CallStrCxtgetContext () const
 Return context of the thread.
 
const ICFGNodegetThread () const
 Return forksite.
 
bool operator< (const CxtThread &rhs) const
 
CxtThreadoperator= (const CxtThread &rhs)
 Overloading operator=.
 
bool operator== (const CxtThread &rhs) const
 Overloading operator==.
 
bool operator!= (const CxtThread &rhs) const
 Overloading operator==.
 
std::string cxtToStr () const
 Return context in string format.
 
void setInloop (bool in)
 inloop, incycle attributes
 
bool isInloop () const
 
void setIncycle (bool in)
 
bool isIncycle () const
 
void dump () const
 Dump CxtThread.
 

Protected Attributes

CallStrCxt cxt
 
const ICFGNodeforksite
 
bool inloop
 
bool incycle
 

Detailed Description

Context-sensitive thread <c,t>

Definition at line 187 of file CxtStmt.h.

Constructor & Destructor Documentation

◆ CxtThread() [1/2]

SVF::CxtThread::CxtThread ( const CallStrCxt c,
const ICFGNode fork 
)
inline

Constructor.

Definition at line 191 of file CxtStmt.h.

191 : cxt(c), forksite(fork), inloop(false), incycle(false)
192 {
193 }
const ICFGNode * forksite
Definition CxtStmt.h:296
CallStrCxt cxt
Definition CxtStmt.h:295
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ CxtThread() [2/2]

SVF::CxtThread::CxtThread ( const CxtThread ct)
inline

Copy constructor.

Definition at line 195 of file CxtStmt.h.

195 :
196 cxt(ct.getContext()), forksite(ct.getThread()), inloop(ct.isInloop()), incycle(ct.isIncycle())
197 {
198 }

◆ ~CxtThread()

virtual SVF::CxtThread::~CxtThread ( )
inlinevirtual

Destructor.

Definition at line 200 of file CxtStmt.h.

201 {
202 }

Member Function Documentation

◆ cxtToStr()

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

Return context in string format.

Definition at line 243 of file CxtStmt.h.

244 {
245 std::string str;
246 std::stringstream rawstr(str);
247 rawstr << "[:";
248 for(CallStrCxt::const_iterator it = cxt.begin(), eit = cxt.end(); it!=eit; ++it)
249 {
250 rawstr << *it << " ";
251 }
252 rawstr << " ]";
253 return rawstr.str();
254 }

◆ dump()

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

Dump CxtThread.

Definition at line 277 of file CxtStmt.h.

278 {
279 std::string loop = inloop?", inloop":"";
280 std::string cycle = incycle?", incycle":"";
281
282 if(forksite)
283 {
284 SVFUtil::outs() << "[ Thread: "
285 << forksite->toString() << "\t Contexts: " << cxtToStr()
286 << loop << cycle <<" ]\n";
287 }
288 else
289 {
290 SVFUtil::outs() << "[ Thread: " << "main " << "\t Contexts: " << cxtToStr()
291 << loop << cycle <<" ]\n";
292 }
293 }
std::string cxtToStr() const
Return context in string format.
Definition CxtStmt.h:243
virtual const std::string toString() const
Definition ICFG.cpp:50
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:52

◆ getContext()

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

Return context of the thread.

Definition at line 204 of file CxtStmt.h.

205 {
206 return cxt;
207 }

◆ getThread()

const ICFGNode * SVF::CxtThread::getThread ( ) const
inline

Return forksite.

Definition at line 209 of file CxtStmt.h.

210 {
211 return forksite;
212 }

◆ isIncycle()

bool SVF::CxtThread::isIncycle ( ) const
inline

Definition at line 270 of file CxtStmt.h.

271 {
272 return incycle;
273 }

◆ isInloop()

bool SVF::CxtThread::isInloop ( ) const
inline

Definition at line 262 of file CxtStmt.h.

263 {
264 return inloop;
265 }

◆ operator!=()

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

Overloading operator==.

Definition at line 238 of file CxtStmt.h.

239 {
240 return !(*this==rhs);
241 }

◆ operator<()

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

216 {
217 if (forksite != rhs.getThread())
218 return forksite < rhs.getThread();
219 else
220 return cxt < rhs.getContext();
221 }

◆ operator=()

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

Overloading operator=.

Definition at line 223 of file CxtStmt.h.

224 {
225 if(*this!=rhs)
226 {
227 forksite = rhs.getThread();
228 cxt = rhs.getContext();
229 }
230 return *this;
231 }

◆ operator==()

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

Overloading operator==.

Definition at line 233 of file CxtStmt.h.

234 {
235 return (forksite == rhs.getThread() && cxt == rhs.getContext());
236 }

◆ setIncycle()

void SVF::CxtThread::setIncycle ( bool  in)
inline

Definition at line 266 of file CxtStmt.h.

267 {
268 incycle = in;
269 }

◆ setInloop()

void SVF::CxtThread::setInloop ( bool  in)
inline

inloop, incycle attributes

Definition at line 258 of file CxtStmt.h.

259 {
260 inloop = in;
261 }

Member Data Documentation

◆ cxt

CallStrCxt SVF::CxtThread::cxt
protected

Definition at line 295 of file CxtStmt.h.

◆ forksite

const ICFGNode* SVF::CxtThread::forksite
protected

Definition at line 296 of file CxtStmt.h.

◆ incycle

bool SVF::CxtThread::incycle
protected

Definition at line 298 of file CxtStmt.h.

◆ inloop

bool SVF::CxtThread::inloop
protected

Definition at line 297 of file CxtStmt.h.


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