30#ifndef INCLUDE_UTIL_CXTSTMT_H_
31#define INCLUDE_UTIL_CXTSTMT_H_
98 std::stringstream rawstr(str);
100 for(CallStrCxt::const_iterator it =
cxt.begin(), eit =
cxt.end(); it!=eit; ++it)
102 rawstr << *it <<
" ";
171 return !(*
this==rhs);
240 return !(*
this==rhs);
246 std::stringstream rawstr(str);
248 for(CallStrCxt::const_iterator it =
cxt.begin(), eit =
cxt.end(); it!=eit; ++it)
250 rawstr << *it <<
" ";
279 std::string loop =
inloop?
", inloop":
"";
280 std::string cycle =
incycle?
", incycle":
"";
286 << loop << cycle <<
" ]\n";
291 << loop << cycle <<
" ]\n";
361 return !(*
this == rhs);
367 std::stringstream rawstr(str);
369 for (CallStrCxt::const_iterator it =
cxt.begin(), eit =
cxt.end(); it != eit; ++it)
371 rawstr << *it <<
" ";
444 return !(*
this==rhs);
462template <>
struct std::hash<
SVF::CxtThread>
466 std::hash<SVF::CallStrCxt> ch;
470 return pairH({forksite, ch(ct.
getContext())});
473template <>
struct std::hash<
SVF::CxtThreadProc>
477 std::hash<SVF::CallStrCxt> ch;
479 return pairH({ctp.
getTid(),
483template <>
struct std::hash<
SVF::CxtStmt>
487 std::hash<SVF::CallStrCxt> ch;
492template <>
struct std::hash<
SVF::CxtThreadStmt>
496 std::hash<SVF::CxtStmt> csH;
498 return pairH({cts.
getTid(), csH(cts)});
501template <>
struct std::hash<
SVF::CxtProc>
505 std::hash<SVF::CallStrCxt> ch;
NodeID getId() const
Get the memory object id.
bool operator!=(const CxtProc &rhs) const
Overloading operator==.
CxtProc & operator=(const CxtProc &rhs)
Overloading operator=.
void dump() const
Dump CxtProc.
CxtProc(const CxtProc &ctm)
Copy constructor.
CxtProc(const CallStrCxt &c, const FunObjVar *f)
Constructor.
const CallStrCxt & getContext() const
Return current context.
bool operator==(const CxtProc &rhs) const
Overloading operator==.
virtual ~CxtProc()
Destructor.
bool operator<(const CxtProc &rhs) const
std::string cxtToStr() const
Return context in string format.
const FunObjVar * getProc() const
Return current procedure.
CxtStmt(const CallStrCxt &c, const ICFGNode *f)
Constructor.
bool operator!=(const CxtStmt &rhs) const
Overloading operator==.
virtual ~CxtStmt()
Destructor.
void dump() const
Dump CxtStmt.
const CallStrCxt & getContext() const
Return current context.
bool operator<(const CxtStmt &rhs) const
std::string cxtToStr() const
Return context in string format.
CxtStmt & operator=(const CxtStmt &rhs)
Overloading operator=.
const ICFGNode * getStmt() const
Return current statement.
CxtStmt(const CxtStmt &ctm)
Copy constructor.
bool operator==(const CxtStmt &rhs) const
Overloading operator==.
CxtThreadProc(NodeID t, const CallStrCxt &c, const FunObjVar *f)
Constructor.
CxtThreadProc & operator=(const CxtThreadProc &rhs)
Overloading operator=.
bool operator<(const CxtThreadProc &rhs) const
NodeID getTid() const
Return current thread id.
bool operator!=(const CxtThreadProc &rhs) const
Overloading operator==.
virtual ~CxtThreadProc()
Destructor.
CxtThreadProc(const CxtThreadProc &ctm)
Copy constructor.
void dump() const
Dump CxtThreadProc.
bool operator==(const CxtThreadProc &rhs) const
Overloading operator==.
CxtThreadStmt(NodeID t, const CallStrCxt &c, const ICFGNode *f)
Constructor.
NodeID getTid() const
Return current context.
CxtThreadStmt & operator=(const CxtThreadStmt &rhs)
Overloading operator=.
void dump() const
Dump CxtThreadStmt.
CxtThreadStmt(const CxtThreadStmt &ctm)
Copy constructor.
bool operator!=(const CxtThreadStmt &rhs) const
Overloading operator==.
virtual ~CxtThreadStmt()
Destructor.
bool operator==(const CxtThreadStmt &rhs) const
Overloading operator==.
bool operator<(const CxtThreadStmt &rhs) const
CxtThread & operator=(const CxtThread &rhs)
Overloading operator=.
const CallStrCxt & getContext() const
Return context of the thread.
virtual ~CxtThread()
Destructor.
bool operator<(const CxtThread &rhs) const
const ICFGNode * getThread() const
Return forksite.
void dump() const
Dump CxtThread.
const ICFGNode * forksite
CxtThread(const CallStrCxt &c, const ICFGNode *fork)
Constructor.
std::string cxtToStr() const
Return context in string format.
void setInloop(bool in)
inloop, incycle attributes
CxtThread(const CxtThread &ct)
Copy constructor.
bool operator!=(const CxtThread &rhs) const
Overloading operator==.
bool operator==(const CxtThread &rhs) const
Overloading operator==.
NodeID getId() const
Get ID.
std::ostream & outs()
Overwrite llvm::outs().
std::vector< u32_t > CallStrCxt
provide extra hash function for std::pair handling
size_t operator()(const SVF::CxtProc &cp) const
size_t operator()(const SVF::CxtStmt &cs) const
size_t operator()(const SVF::CxtThreadProc &ctp) const
size_t operator()(const SVF::CxtThreadStmt &cts) const
size_t operator()(const SVF::CxtThread &ct) const