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

#include <CxtStmt.h>

Inheritance diagram for SVF::CxtProc:
SVF::CxtThreadProc

Public Member Functions

 CxtProc (const CallStrCxt &c, const FunObjVar *f)
 Constructor.
 
 CxtProc (const CxtProc &ctm)
 Copy constructor.
 
virtual ~CxtProc ()
 Destructor.
 
const FunObjVargetProc () const
 Return current procedure.
 
const CallStrCxtgetContext () const
 Return current context.
 
bool operator< (const CxtProc &rhs) const
 
CxtProcoperator= (const CxtProc &rhs)
 Overloading operator=.
 
bool operator== (const CxtProc &rhs) const
 Overloading operator==.
 
bool operator!= (const CxtProc &rhs) const
 Overloading operator==.
 
std::string cxtToStr () const
 Return context in string format.
 
void dump () const
 Dump CxtProc.
 

Protected Attributes

CallStrCxt cxt
 
const FunObjVarfun
 

Detailed Description

Context-sensitive procedure <c,m> c represent current context m represent current procedure

Definition at line 307 of file CxtStmt.h.

Constructor & Destructor Documentation

◆ CxtProc() [1/2]

SVF::CxtProc::CxtProc ( const CallStrCxt c,
const FunObjVar f 
)
inline

Constructor.

Definition at line 311 of file CxtStmt.h.

311 :
312 cxt(c), fun(f)
313 {
314 }
const FunObjVar * fun
Definition CxtStmt.h:384
CallStrCxt cxt
Definition CxtStmt.h:383
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ CxtProc() [2/2]

SVF::CxtProc::CxtProc ( const CxtProc ctm)
inline

Copy constructor.

Definition at line 316 of file CxtStmt.h.

316 :
317 cxt(ctm.getContext()), fun(ctm.getProc())
318 {
319 }

◆ ~CxtProc()

virtual SVF::CxtProc::~CxtProc ( )
inlinevirtual

Destructor.

Definition at line 321 of file CxtStmt.h.

322 {
323 }

Member Function Documentation

◆ cxtToStr()

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

Return context in string format.

Definition at line 364 of file CxtStmt.h.

365 {
366 std::string str;
367 std::stringstream rawstr(str);
368 rawstr << "[:";
369 for (CallStrCxt::const_iterator it = cxt.begin(), eit = cxt.end(); it != eit; ++it)
370 {
371 rawstr << *it << " ";
372 }
373 rawstr << " ]";
374 return rawstr.str();
375 }

◆ dump()

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

Dump CxtProc.

Definition at line 377 of file CxtStmt.h.

378 {
379 SVFUtil::outs() << "[ Proc: " << fun->getName() << "\t Contexts: " << cxtToStr() << " ]\n";
380 }
std::string cxtToStr() const
Return context in string format.
Definition CxtStmt.h:364
virtual const std::string & getName() const
Definition SVFValue.h:186
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:52

◆ getContext()

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

Return current context.

Definition at line 330 of file CxtStmt.h.

331 {
332 return cxt;
333 }

◆ getProc()

const FunObjVar * SVF::CxtProc::getProc ( ) const
inline

Return current procedure.

Definition at line 325 of file CxtStmt.h.

326 {
327 return fun;
328 }

◆ operator!=()

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

Overloading operator==.

Definition at line 359 of file CxtStmt.h.

360 {
361 return !(*this == rhs);
362 }

◆ operator<()

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

337 {
338 if (fun != rhs.getProc())
339 return fun < rhs.getProc();
340 else
341 return cxt < rhs.getContext();
342 }

◆ operator=()

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

Overloading operator=.

Definition at line 344 of file CxtStmt.h.

345 {
346 if (*this != rhs)
347 {
348 fun = rhs.getProc();
349 cxt = rhs.getContext();
350 }
351 return *this;
352 }

◆ operator==()

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

Overloading operator==.

Definition at line 354 of file CxtStmt.h.

355 {
356 return (fun == rhs.getProc() && cxt == rhs.getContext());
357 }

Member Data Documentation

◆ cxt

CallStrCxt SVF::CxtProc::cxt
protected

Definition at line 383 of file CxtStmt.h.

◆ fun

const FunObjVar* SVF::CxtProc::fun
protected

Definition at line 384 of file CxtStmt.h.


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