|
Static Value-Flow Analysis
|
#include <ThreadAPI.h>
Classes | |
| struct | ForkJoinAliasCache |
| If fork join the same thread. More... | |
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 |
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 49 of file ThreadAPI.h.
| typedef Map<std::string, TD_TYPE> SVF::ThreadAPI::TDAPIMap |
Definition at line 76 of file ThreadAPI.h.
Definition at line 53 of file ThreadAPI.h.
|
inlineprivate |
Constructor.
Definition at line 83 of file ThreadAPI.h.
|
inlinestatic |
Definition at line 108 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 234 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 226 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 220 of file ThreadAPI.cpp.
Return the formal parm of forked function (the first arg in pthread)
Definition at line 240 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 263 of file ThreadAPI.cpp.
Return lock value.
First argument of pthread_mutex_lock/pthread_mutex_unlock
Definition at line 255 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 249 of file ThreadAPI.cpp.
|
private |
Get the function type if it is a threadAPI function.
Definition at line 178 of file ThreadAPI.cpp.
|
private |
Initialize the map.
initialize the map
Definition at line 147 of file ThreadAPI.cpp.
| bool ThreadAPI::isAliasedForkJoin | ( | PointerAnalysis * | pta, |
| const SVFVar * | forkArg, | ||
| const SVFVar * | joinArg | ||
| ) | const |
If fork join the same thread
Definition at line 276 of file ThreadAPI.cpp.
| bool ThreadAPI::isAliasedForkJoin | ( | PointerAnalysis * | pta, |
| const SVFVar * | forkArg, | ||
| const SVFVar * | joinArg, | ||
| ForkJoinAliasCache & | cache | ||
| ) | const |
Definition at line 282 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDAcquire | ( | const CallICFGNode * | inst | ) | const |
Return true if this call acquire a lock.
Definition at line 204 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDBarWait | ( | const CallICFGNode * | inst | ) | const |
Return true if this call waits for a barrier.
Definition at line 214 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDExit | ( | const CallICFGNode * | inst | ) | const |
Return true if this call exits/terminate a thread.
Definition at line 199 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDFork | ( | const CallICFGNode * | inst | ) | const |
Return true if this call create a new thread.
Definition at line 189 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDJoin | ( | const CallICFGNode * | inst | ) | const |
Return true if this call wait for a worker thread.
Definition at line 194 of file ThreadAPI.cpp.
| bool ThreadAPI::isTDRelease | ( | const CallICFGNode * | inst | ) | const |
Return true if this call release a lock.
Definition at line 209 of file ThreadAPI.cpp.
| void ThreadAPI::performAPIStat | ( | ) |
Definition at line 351 of file ThreadAPI.cpp.
Definition at line 311 of file ThreadAPI.cpp.
Static reference.
Definition at line 92 of file ThreadAPI.h.
|
private |
API map, from a string to threadAPI type.
Definition at line 80 of file ThreadAPI.h.