|
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 FunObjVar *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 () |
| 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 FunObjVar *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 107 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 190 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 182 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 176 of file ThreadAPI.cpp.
Return the formal parm of forked function (the first arg in pthread)
Definition at line 196 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 219 of file ThreadAPI.cpp.
Return lock value.
First argument of pthread_mutex_lock/pthread_mutex_unlock
Definition at line 211 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 205 of file ThreadAPI.cpp.
|
private |
Get the function type if it is a threadAPI function.
Definition at line 134 of file ThreadAPI.cpp.
|
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 160 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDBarWait | ( | const CallICFGNode * | inst | ) | const |
Return true if this call waits for a barrier.
Definition at line 170 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDExit | ( | const CallICFGNode * | inst | ) | const |
Return true if this call exits/terminate a thread.
Definition at line 155 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDFork | ( | const CallICFGNode * | inst | ) | const |
Return true if this call create a new thread.
Definition at line 145 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDJoin | ( | const CallICFGNode * | inst | ) | const |
Return true if this call wait for a worker thread.
Definition at line 150 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDRelease | ( | const CallICFGNode * | inst | ) | const |
Return true if this call release a lock.
Definition at line 165 of file ThreadAPI.cpp.
| void ThreadAPI::performAPIStat | ( | ) |
Definition at line 278 of file ThreadAPI.cpp.
Definition at line 238 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.