Static Value-Flow Analysis
|
#include <ThreadAPI.h>
Public Types | |
enum | TD_TYPE { TD_DUMMY = 0 , TD_FORK , TD_JOIN , TD_DETACH , TD_ACQUIRE , TD_TRY_ACQUIRE , TD_RELEASE , TD_EXIT , TD_CANCEL , TD_COND_WAIT , TD_COND_SIGNAL , TD_COND_BROADCAST , TD_MUTEX_INI , TD_MUTEX_DESTROY , TD_CONDVAR_INI , TD_CONDVAR_DESTROY , TD_BAR_INIT , TD_BAR_WAIT , HARE_PAR_FOR } |
typedef Map< std::string, TD_TYPE > | TDAPIMap |
Public Member Functions | |
const ValVar * | getForkedThread (const CallICFGNode *inst) const |
Return arguments/attributes of pthread_create / hare_parallel_for. | |
const ValVar * | getForkedFun (const CallICFGNode *inst) const |
const ValVar * | getActualParmAtForkSite (const CallICFGNode *inst) const |
const SVFVar * | getFormalParmOfForkedFun (const SVFFunction *F) const |
Return the formal parm of forked function (the first arg in pthread) | |
bool | isTDFork (const CallICFGNode *inst) const |
Return true if this call create a new thread. | |
bool | isTDJoin (const CallICFGNode *inst) const |
Return true if this call wait for a worker thread. | |
const SVFVar * | getJoinedThread (const CallICFGNode *inst) const |
Return arguments/attributes of pthread_join. | |
const SVFVar * | getRetParmAtJoinedSite (const CallICFGNode *inst) const |
bool | isTDExit (const CallICFGNode *inst) const |
Return true if this call exits/terminate a thread. | |
bool | isTDAcquire (const CallICFGNode *inst) const |
Return true if this call acquire a lock. | |
bool | isTDRelease (const CallICFGNode *inst) const |
Return true if this call release a lock. | |
const SVFVar * | getLockVal (const ICFGNode *inst) const |
Return lock value. | |
bool | isTDBarWait (const CallICFGNode *inst) const |
Return true if this call waits for a barrier. | |
void | performAPIStat (SVFModule *m) |
void | statInit (Map< std::string, u32_t > &tdAPIStatMap) |
Static Public Member Functions | |
static ThreadAPI * | getThreadAPI () |
Return a static reference. | |
static void | destroy () |
Private Member Functions | |
ThreadAPI () | |
Constructor. | |
void | init () |
Initialize the map. | |
TD_TYPE | getType (const SVFFunction *F) const |
Get the function type if it is a threadAPI function. | |
Private Attributes | |
TDAPIMap | tdAPIMap |
API map, from a string to threadAPI type. | |
Static Private Attributes | |
static ThreadAPI * | tdAPI = nullptr |
Static reference. | |
Definition at line 48 of file ThreadAPI.h.
typedef Map<std::string, TD_TYPE> SVF::ThreadAPI::TDAPIMap |
Definition at line 75 of file ThreadAPI.h.
Definition at line 52 of file ThreadAPI.h.
|
inlineprivate |
Constructor.
Definition at line 82 of file ThreadAPI.h.
|
inlinestatic |
Definition at line 116 of file ThreadAPI.h.
const ValVar * ThreadAPI::getActualParmAtForkSite | ( | const CallICFGNode * | inst | ) | const |
Return the forth argument of the call, Note that, it is the sole argument of start routine ( a void* pointer )
Definition at line 178 of file ThreadAPI.cpp.
const ValVar * ThreadAPI::getForkedFun | ( | const CallICFGNode * | inst | ) | const |
Return the third argument of the call, Note that, it could be function type or a void* pointer
Definition at line 170 of file ThreadAPI.cpp.
const ValVar * ThreadAPI::getForkedThread | ( | const CallICFGNode * | inst | ) | const |
Return arguments/attributes of pthread_create / hare_parallel_for.
Return the first argument of the call, Note that, it is the pthread_t pointer
Definition at line 164 of file ThreadAPI.cpp.
const SVFVar * ThreadAPI::getFormalParmOfForkedFun | ( | const SVFFunction * | F | ) | const |
Return the formal parm of forked function (the first arg in pthread)
Definition at line 184 of file ThreadAPI.cpp.
const SVFVar * ThreadAPI::getJoinedThread | ( | const CallICFGNode * | inst | ) | const |
Return arguments/attributes of pthread_join.
Return the first argument of the call, Note that, it is the pthread_t pointer
Definition at line 207 of file ThreadAPI.cpp.
Return lock value.
First argument of pthread_mutex_lock/pthread_mutex_unlock
Definition at line 199 of file ThreadAPI.cpp.
const SVFVar * ThreadAPI::getRetParmAtJoinedSite | ( | const CallICFGNode * | inst | ) | const |
Return the send argument of the call, Note that, it is the pthread_t pointer
Definition at line 193 of file ThreadAPI.cpp.
|
inlineprivate |
Get the function type if it is a threadAPI function.
Definition at line 94 of file ThreadAPI.h.
|
private |
Initialize the map.
initialize the map
Definition at line 103 of file ThreadAPI.cpp.
bool ThreadAPI::isTDAcquire | ( | const CallICFGNode * | inst | ) | const |
Return true if this call acquire a lock.
Definition at line 148 of file ThreadAPI.cpp.
bool ThreadAPI::isTDBarWait | ( | const CallICFGNode * | inst | ) | const |
Return true if this call waits for a barrier.
Definition at line 158 of file ThreadAPI.cpp.
bool ThreadAPI::isTDExit | ( | const CallICFGNode * | inst | ) | const |
Return true if this call exits/terminate a thread.
Definition at line 143 of file ThreadAPI.cpp.
bool ThreadAPI::isTDFork | ( | const CallICFGNode * | inst | ) | const |
Return true if this call create a new thread.
Definition at line 133 of file ThreadAPI.cpp.
bool ThreadAPI::isTDJoin | ( | const CallICFGNode * | inst | ) | const |
Return true if this call wait for a worker thread.
Definition at line 138 of file ThreadAPI.cpp.
bool ThreadAPI::isTDRelease | ( | const CallICFGNode * | inst | ) | const |
Return true if this call release a lock.
Definition at line 153 of file ThreadAPI.cpp.
void ThreadAPI::performAPIStat | ( | SVFModule * | m | ) |
Definition at line 266 of file ThreadAPI.cpp.
Definition at line 226 of file ThreadAPI.cpp.
Static reference.
Definition at line 91 of file ThreadAPI.h.
|
private |
API map, from a string to threadAPI type.
Definition at line 79 of file ThreadAPI.h.