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 SVFFunction *f)
 Constructor.
 
 CxtProc (const CxtProc &ctm)
 Copy constructor.
 
virtual ~CxtProc ()
 Destructor.
 
const SVFFunctiongetProc () 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 SVFFunctionfun
 

Detailed Description

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

Definition at line 309 of file CxtStmt.h.

Constructor & Destructor Documentation

◆ CxtProc() [1/2]

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

Constructor.

Definition at line 313 of file CxtStmt.h.

313 :
314 cxt(c), fun(f)
315 {
316 }
const SVFFunction * fun
Definition CxtStmt.h:386
CallStrCxt cxt
Definition CxtStmt.h:385
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ CxtProc() [2/2]

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

Copy constructor.

Definition at line 318 of file CxtStmt.h.

318 :
319 cxt(ctm.getContext()), fun(ctm.getProc())
320 {
321 }

◆ ~CxtProc()

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

Destructor.

Definition at line 323 of file CxtStmt.h.

324 {
325 }

Member Function Documentation

◆ cxtToStr()

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

Return context in string format.

Definition at line 366 of file CxtStmt.h.

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

◆ dump()

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

Dump CxtProc.

Definition at line 379 of file CxtStmt.h.

380 {
381 SVFUtil::outs() << "[ Proc: " << fun->getName() << "\t Contexts: " << cxtToStr() << " ]\n";
382 }
std::string cxtToStr() const
Return context in string format.
Definition CxtStmt.h:366
const std::string & getName() const
Definition SVFValue.h:243
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:50

◆ getContext()

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

Return current context.

Definition at line 332 of file CxtStmt.h.

333 {
334 return cxt;
335 }

◆ getProc()

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

Return current procedure.

Definition at line 327 of file CxtStmt.h.

328 {
329 return fun;
330 }

◆ operator!=()

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

Overloading operator==.

Definition at line 361 of file CxtStmt.h.

362 {
363 return !(*this == rhs);
364 }

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

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

◆ operator=()

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

Overloading operator=.

Definition at line 346 of file CxtStmt.h.

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

◆ operator==()

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

Overloading operator==.

Definition at line 356 of file CxtStmt.h.

357 {
358 return (fun == rhs.getProc() && cxt == rhs.getContext());
359 }

Member Data Documentation

◆ cxt

CallStrCxt SVF::CxtProc::cxt
protected

Definition at line 385 of file CxtStmt.h.

◆ fun

const SVFFunction* SVF::CxtProc::fun
protected

Definition at line 386 of file CxtStmt.h.


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