Static Value-Flow Analysis
Loading...
Searching...
No Matches
TCT.h
Go to the documentation of this file.
1//===- TCT.h -- Thread creation tree-------------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-> <Yulei Sui>
6//
7
8// This program is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Affero General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU Affero General Public License for more details.
17
18// You should have received a copy of the GNU Affero General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21//===----------------------------------------------------------------------===//
22
23/*
24 * TCT.h
25 *
26 * Created on: Jun 24, 2015
27 * Author: Yulei Sui, Peng Di
28 */
29
30#ifndef TCTNodeDetector_H_
31#define TCTNodeDetector_H_
32
33#include "Graphs/SCC.h"
35#include "Util/CxtStmt.h"
36#include "Util/SVFUtil.h"
37#include <set>
38#include <vector>
39
40namespace SVF
41{
42
43class TCTNode;
44
45
46/*
47 * Thread creation edge represents a spawning relation between two context sensitive threads
48 */
51{
52public:
53 enum CEDGEK
54 {
56 };
59 GenericTCTEdgeTy(s, d, kind)
60 {
61 }
63 virtual ~TCTEdge()
64 {
65 }
67
68 static inline bool classof(const TCTEdge*)
69 {
70 return true;
71 }
72 static inline bool classof(const GenericTCTEdgeTy *edge)
73 {
74 return edge->getEdgeKind() == TCTEdge::ThreadCreateEdge;
75 }
78
79};
80
81/*
82 * Each node represents a context-sensitive thread
83 */
86{
87
88public:
94
95 void dump()
96 {
97 SVFUtil::outs() << "---\ntid: " << this->getId() << " inloop:" << ctx.isInloop() << " incycle:" << ctx.isIncycle() << " multiforked:"<< isMultiforked();
98 }
99
101 inline const CxtThread& getCxtThread() const
102 {
103 return ctx;
104 }
105
107
108 inline bool isInloop() const
109 {
110 return ctx.isInloop();
111 }
112 inline bool isIncycle() const
113 {
114 return ctx.isIncycle();
115 }
116 inline void setMultiforked(bool value)
117 {
118 multiforked = value;
119 }
120 inline bool isMultiforked() const
121 {
122 return multiforked;
123 }
125
127
128 static inline bool classof(const TCTNode *)
129 {
130 return true;
131 }
132
133 static inline bool classof(const GenericTCTNodeTy *node)
134 {
135 return node->getNodeKind() == TCTNodeKd;
136 }
137 static inline bool classof(const SVFValue*node)
138 {
139 return node->getNodeKind() == TCTNodeKd;
140 }
142
143
144private:
147};
148
154{
155
156public:
159 typedef ThreadCreateEdgeSet::iterator TCTNodeIter;
161 typedef std::vector<const ICFGNode*> InstVec;
172
175 {
176 tcg = SVFUtil::dyn_cast<ThreadCallGraph>(pta->getCallGraph());
177 assert(tcg != nullptr && "TCT::TCT: call graph is not a ThreadCallGraph!");
179 //tcg->updateJoinEdge(pta);
181 tcgSCC->find();
182 build();
183 }
184
186 virtual ~TCT()
187 { }
188
191 {
192 return tcg;
193 }
195 inline PointerAnalysis* getPTA() const
196 {
197 return pta;
198 }
200 inline TCTNode* getTCTNode(NodeID id) const
201 {
202 return getGNode(id);
203 }
205 TCTEdge* hasGraphEdge(TCTNode* src, TCTNode* dst, TCTEdge::CEDGEK kind) const;
208
210
211 inline ThreadCreateEdgeSet::const_iterator getChildrenBegin(const TCTNode* node) const
212 {
213 return node->OutEdgeBegin();
214 }
215 inline ThreadCreateEdgeSet::const_iterator getChildrenEnd(const TCTNode* node) const
216 {
217 return node->OutEdgeEnd();
218 }
219 inline ThreadCreateEdgeSet::const_iterator getParentsBegin(const TCTNode* node) const
220 {
221 return node->InEdgeBegin();
222 }
223 inline ThreadCreateEdgeSet::const_iterator getParentsEnd(const TCTNode* node) const
224 {
225 return node->InEdgeEnd();
226 }
228
230 inline const FunSet& getMakredProcs() const
231 {
232 return candidateFuncSet;
233 }
234
236 inline const FunSet& getEntryProcs() const
237 {
238 return entryFuncSet;
239 }
240
242
243 inline u32_t getTCTNodeNum() const
244 {
245 return TCTNodeNum;
246 }
247 inline u32_t getTCTEdgeNum() const
248 {
249 return TCTEdgeNum;
250 }
251 inline u32_t getMaxCxtSize() const
252 {
253 return MaxCxtSize;
254 }
256
258 inline bool isExtCall(const ICFGNode* inst)
259 {
260 if(const CallICFGNode* call = SVFUtil::dyn_cast<CallICFGNode>(inst))
261 return SVFUtil::isExtCall(call);
262 return false;
263 }
265 inline bool isCallSite(const ICFGNode* inst)
266 {
267 return SVFUtil::isa<CallICFGNode>(inst);
268 }
269
271
272 inline bool hasTCTNode(const CxtThread& ct) const
273 {
274 return ctpToNodeMap.find(ct)!=ctpToNodeMap.end();
275 }
276 inline TCTNode* getTCTNode(const CxtThread& ct) const
277 {
278 CxtThreadToNodeMap::const_iterator it = ctpToNodeMap.find(ct);
279 assert(it!=ctpToNodeMap.end() && "TCT node not found??");
280 return it->second;
281 }
283
286 {
287 for(CallGraph::FunctionSet::const_iterator cit = callees.begin(),
288 ecit = callees.end(); cit!=ecit; cit++)
289 {
290 if(candidateFuncSet.find((*cit))!=candidateFuncSet.end())
291 return true;
292 }
293 return false;
294 }
295 inline bool isCandidateFun(const FunObjVar* fun) const
296 {
297 return candidateFuncSet.find(fun)!=candidateFuncSet.end();
298 }
300 inline bool inSameCallGraphSCC(const CallGraphNode* src,const CallGraphNode* dst)
301 {
302 return (tcgSCC->repNode(src->getId()) == tcgSCC->repNode(dst->getId()));
303 }
304
306
307
308 inline bool hasParentThread(NodeID tid) const
309 {
310 const TCTNode* node = getTCTNode(tid);
311 return node->getInEdges().size()==1;
312 }
315 {
317 const TCTNode* node = getTCTNode(tid);
318 assert(node->getInEdges().size()>=1 && "does not have a parent thread");
319
320 for (const TCTEdge* edge : node->getInEdges())
321 {
322 parentTds.set(edge->getSrcID());
323 }
324 return parentTds;
325 }
328 {
329 NodeBS tds;
330 if(hasParentThread(tid) == false)
331 return tds;
332
333 FIFOWorkList<NodeID> worklist;
335 worklist.push(parentTid);
336
337 while(!worklist.empty())
338 {
339 NodeID t = worklist.pop();
340 if(tds.test_and_set(t))
341 {
342 if(hasParentThread(t))
344 worklist.push(parentTid);
345 }
346 }
347 return tds;
348 }
350 inline const NodeBS getSiblingThread(NodeID tid) const
351 {
352 NodeBS tds;
353 if(hasParentThread(tid) == false)
354 return tds;
356 {
358 for(ThreadCreateEdgeSet::const_iterator it = getChildrenBegin(parentNode),
360 {
361 NodeID child = (*it)->getDstNode()->getId();
362 if(child!=tid)
363 tds.set(child);
364 }
365 }
366 return tds;
367 }
369
372 {
373 CxtThreadToForkCxtSet::const_iterator it = ctToForkCxtsMap.find(ct);
374 assert(it!=ctToForkCxtsMap.end() && "Cxt Thread not found!!");
375 return it->second;
376 }
377
380 {
381 CxtThreadToFun::const_iterator it = ctToRoutineFunMap.find(ct);
382 assert(it!=ctToRoutineFunMap.end() && "Cxt Thread not found!!");
383 return it->second;
384 }
385
388 {
389 assert(tcg->getThreadAPI()->isTDJoin(join) && "not a join site");
390 InstToLoopMap::iterator it = joinSiteToLoopMap.find(join);
391 assert(it!=joinSiteToLoopMap.end() && "loop not found");
392 return it->second;
393 }
394
395 inline bool hasJoinLoop(const CallICFGNode* join) const
396 {
397 assert(tcg->getThreadAPI()->isTDJoin(join) && "not a join site");
398 InstToLoopMap::const_iterator it = joinSiteToLoopMap.find(join);
399 return it!=joinSiteToLoopMap.end();
400 }
401
402 bool hasLoop(const SVFBasicBlock* bb) const
403 {
404 const FunObjVar* fun = bb->getFunction();
405 return fun->hasLoopInfo(bb);
406 }
407 bool hasLoop(const ICFGNode* inst) const
408 {
409 return hasLoop(inst->getBB());
410 }
412 bool isJoinMustExecutedInLoop(const LoopBBs& lp,const ICFGNode* join);
414 const LoopBBs& getLoop(const ICFGNode* inst);
416 const LoopBBs& getLoop(const SVFBasicBlock* bb);
417
419
420
421 void pushCxt(CallStrCxt& cxt, const CallICFGNode* call, const FunObjVar* callee);
423 bool matchAndPopCxt(CallStrCxt& cxt, const CallICFGNode* call, const FunObjVar* callee);
425 bool isContextSuffix(const CallStrCxt& lhs, const CallStrCxt& call);
427
429 inline bool isJoinSiteInRecursion(const CallICFGNode* join) const
430 {
431 assert(tcg->getThreadAPI()->isTDJoin(join) && "not a join site");
432 return inRecurJoinSites.find(join)!=inRecurJoinSites.end();
433 }
435 void dumpCxt(CallStrCxt& cxt);
436
438 void dump(const std::string& filename);
439
441 void print() const;
442
443private:
449
452 {
453 assert(ctpToNodeMap.find(ct)==ctpToNodeMap.end() && "Already has this node!!");
454 NodeID id = TCTNodeNum;
455 TCTNode* node = new TCTNode(id, ct);
456 addGNode(id, node);
457 TCTNodeNum++;
458 ctpToNodeMap[ct] = node;
459 return node;
460 }
462 inline bool addTCTEdge(TCTNode* src, TCTNode* dst)
463 {
465 {
467 dst->addIncomingEdge(edge);
468 src->addOutgoingEdge(edge);
469 TCTEdgeNum++;
470 return true;
471 }
472 return false;
473 }
474
476 void build();
477
479
480 void markRelProcs();
481 void markRelProcs(const FunObjVar* fun);
483
486
490
492
493
498 bool isLoopExitOfJoinLoop(const SVFBasicBlock* bb);
500
502
503
504 bool isInLoopInstruction(const ICFGNode* inst);
506 bool isInRecursion(const ICFGNode* inst) const;
508
511
513
515 {
516 CxtThread ct(cxt,fork);
517 CxtThreadToNodeMap::const_iterator it = ctpToNodeMap.find(ct);
518 if(it!=ctpToNodeMap.end())
519 {
520 return it->second;
521 }
522
523 addCxtOfCxtThread(forkSiteCtp.getTid(), forkSiteCtp.getContext(), ct);
525
527 return addTCTNode(ct);
528 }
530
533 {
535 if(ct.getThread() != nullptr)
536 {
537 const ICFGNode* svfInst = ct.getThread();
538 ct.setInloop(isInLoopInstruction(svfInst));
539 ct.setIncycle(isInRecursion(svfInst));
540 }
542 else
543 {
544 ct.setInloop(false);
545 ct.setIncycle(false);
546 }
547 }
548
551 {
552 ctToForkCxtsMap[ct].insert(std::make_pair(pTid, cxt));
553 }
554
557 {
558 ctToRoutineFunMap[ct] = fun;
559 }
560
562
564 {
565 if(isVisitedCTPs(ctp)==false)
566 {
567 visitedCTPs.insert(ctp);
568 return ctpList.push(ctp);
569 }
570 return false;
571 }
573 {
575 return ctp;
576 }
577 inline bool isVisitedCTPs(const CxtThreadProc& ctp) const
578 {
579 return visitedCTPs.find(ctp)!=visitedCTPs.end();
580 }
582
593};
594
595} // End namespace SVF
596
597namespace SVF
598{
599/* !
600 * GenericGraphTraits specializations for constraint graph so that they can be treated as
601 * graphs by the generic graph algorithms.
602 * Provide graph traits for traversing from a constraint node using standard graph traversals.
603 */
604template<> struct GenericGraphTraits<SVF::TCTNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* >
605{
606};
607
609template<>
610struct GenericGraphTraits<Inverse<SVF::TCTNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* > >
611{
612};
613
614template<> struct GenericGraphTraits<SVF::TCT*> : public GenericGraphTraits<SVF::GenericGraph<SVF::TCTNode,SVF::TCTEdge>* >
615{
617};
618
619} // End namespace llvm
620
621#endif /* TCTNodeDetector_H_ */
cJSON * p
Definition cJSON.cpp:2559
#define false
Definition cJSON.cpp:70
cJSON * child
Definition cJSON.cpp:2723
Set< const FunObjVar * > FunctionSet
Definition CallGraph.h:244
bool isInloop() const
Definition CxtStmt.h:264
bool isIncycle() const
Definition CxtStmt.h:272
bool push(const Data &data)
Definition WorkList.h:165
bool empty() const
Definition WorkList.h:146
bool hasLoopInfo(const SVFBasicBlock *bb) const
void addGNode(NodeID id, NodeType *node)
Add a Node.
NodeType * getGNode(NodeID id) const
Get a node.
OrderedSet< EdgeType *, typename EdgeType::equalGEdge > GEdgeSetTy
Edge kind.
iterator OutEdgeEnd()
const GEdgeSetTy & getInEdges() const
bool addIncomingEdge(EdgeType *inEdge)
Add incoming and outgoing edges.
iterator OutEdgeBegin()
iterators
iterator InEdgeBegin()
bool addOutgoingEdge(EdgeType *outEdge)
iterator InEdgeEnd()
virtual const SVFBasicBlock * getBB() const
Return the basic block of this ICFGNode.
Definition ICFGNode.h:80
CallGraph * getCallGraph() const
Return call graph.
CallGraphSCC * getCallGraphSCC() const
Return call graph SCC.
const FunObjVar * getFunction() const
NodeID getId() const
Get ID.
Definition SVFValue.h:160
GNodeK getNodeKind() const
Get node kind.
Definition SVFValue.h:166
static bool classof(const GenericTCTEdgeTy *edge)
Definition TCT.h:72
@ ThreadCreateEdge
Definition TCT.h:55
GenericNode< TCTNode, TCTEdge >::GEdgeSetTy ThreadCreateEdgeSet
Definition TCT.h:77
TCTEdge(TCTNode *s, TCTNode *d, CEDGEK kind)
Constructor.
Definition TCT.h:58
static bool classof(const TCTEdge *)
Classof.
Definition TCT.h:68
virtual ~TCTEdge()
Destructor.
Definition TCT.h:63
const CxtThread & getCxtThread() const
Get thread creation context, <fork site, call string context>
Definition TCT.h:101
void setMultiforked(bool value)
Definition TCT.h:116
bool multiforked
Thread creation context, <fork site, call string context>
Definition TCT.h:146
bool isIncycle() const
Definition TCT.h:112
bool isInloop() const
inloop, incycle attributes
Definition TCT.h:108
void dump()
Definition TCT.h:95
bool isMultiforked() const
Definition TCT.h:120
const CxtThread ctx
Definition TCT.h:145
static bool classof(const TCTNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition TCT.h:128
static bool classof(const SVFValue *node)
Definition TCT.h:137
static bool classof(const GenericTCTNodeTy *node)
Definition TCT.h:133
TCTNode(NodeID i, const CxtThread &cctx)
Constructor.
Definition TCT.h:90
bool pushToCTPWorkList(const CxtThreadProc &ctp)
WorkList helper functions.
Definition TCT.h:563
const FunSet & getMakredProcs() const
Get marked candidate functions.
Definition TCT.h:230
const NodeBS getAncestorThreads(NodeID tid) const
Get all ancestor threads.
Definition TCT.h:327
bool isInRecursion(const ICFGNode *inst) const
Whether an instruction is in a recursion.
Definition TCT.cpp:91
CxtThreadToForkCxtSet ctToForkCxtsMap
Map a ctp to its graph node.
Definition TCT.h:589
TCTNode * getTCTNode(NodeID id) const
Get TCT node.
Definition TCT.h:200
Set< CxtThreadProc > CxtThreadProcSet
Definition TCT.h:170
CxtThreadToNodeMap ctpToNodeMap
Record all visited ctps.
Definition TCT.h:588
bool isContextSuffix(const CallStrCxt &lhs, const CallStrCxt &call)
If lhs is a suffix of rhs, including equal.
Definition TCT.cpp:497
bool isCandidateFun(const FunObjVar *fun) const
Definition TCT.h:295
Set< const ICFGNode * > InstSet
Definition TCT.h:162
void setMultiForkedAttrs(CxtThread &ct)
Set multi-forked thread attributes.
Definition TCT.h:532
FunSet entryFuncSet
Definition TCT.h:583
TCTNode * getOrCreateTCTNode(const CallStrCxt &cxt, const ICFGNode *fork, const CxtThreadProc &forkSiteCtp, const FunObjVar *routine)
Get or create a tct node based on CxtThread.
Definition TCT.h:514
bool isJoinSiteInRecursion(const CallICFGNode *join) const
Whether a join site is in recursion.
Definition TCT.h:429
FIFOWorkList< CxtThreadProc > CxtThreadProcVec
Definition TCT.h:169
void collectLoopInfoForJoin()
Handle join site in loop.
Definition TCT.cpp:318
bool isCallSite(const ICFGNode *inst)
Whether it is a callsite.
Definition TCT.h:265
void addCxtOfCxtThread(NodeID pTid, const CallStrCxt &cxt, const CxtThread &ct)
Add context for a thread at its spawning site (fork site)
Definition TCT.h:550
ThreadCallGraphSCC * tcgSCC
Procedures we care about during call graph traversing when creating TCT.
Definition TCT.h:585
void collectEntryFunInCallGraph()
Get entry functions that are neither called by other functions nor extern functions.
Definition TCT.cpp:187
NodeBS getParentThreads(NodeID tid) const
Get parent threads.
Definition TCT.h:314
CxtThreadToFun ctToRoutineFunMap
Map a CxtThread to the context at its spawning site (fork site).
Definition TCT.h:590
PointerAnalysis * getPTA() const
Get PTA.
Definition TCT.h:195
CxtThreadProcSet visitedCTPs
CxtThreadProc List.
Definition TCT.h:587
bool hasJoinLoop(const CallICFGNode *join) const
Definition TCT.h:395
u32_t getMaxCxtSize() const
Definition TCT.h:251
Set< const CallGraphNode * > PTACGNodeSet
Definition TCT.h:163
ThreadCreateEdgeSet::const_iterator getChildrenBegin(const TCTNode *node) const
Get children and parent nodes.
Definition TCT.h:211
u32_t TCTNodeNum
Definition TCT.h:446
Map< CxtThread, const FunObjVar * > CxtThreadToFun
Definition TCT.h:167
ThreadCallGraph * getThreadCallGraph() const
Get TCG.
Definition TCT.h:190
bool hasLoop(const ICFGNode *inst) const
Definition TCT.h:407
InstToLoopMap joinSiteToLoopMap
Map a CxtThread to its start routine function.
Definition TCT.h:591
bool hasTCTNode(const CxtThread &ct) const
Find/Get TCT node.
Definition TCT.h:272
ThreadCreateEdgeSet::const_iterator getParentsEnd(const TCTNode *node) const
Definition TCT.h:223
const NodeBS getSiblingThread(NodeID tid) const
Get sibling threads.
Definition TCT.h:350
bool hasParentThread(NodeID tid) const
Get parent and sibling threads.
Definition TCT.h:308
bool isVisitedCTPs(const CxtThreadProc &ctp) const
Definition TCT.h:577
u32_t getTCTEdgeNum() const
Definition TCT.h:247
ThreadCreateEdgeSet::iterator TCTNodeIter
Definition TCT.h:159
void dump(const std::string &filename)
Dump the graph.
Definition TCT.cpp:535
FunSet candidateFuncSet
Procedures that are neither called by other functions nor extern functions.
Definition TCT.h:584
void addStartRoutineOfCxtThread(const FunObjVar *fun, const CxtThread &ct)
Add start routine function of a cxt thread.
Definition TCT.h:556
bool inSameCallGraphSCC(const CallGraphNode *src, const CallGraphNode *dst)
Whether two functions in the same callgraph scc.
Definition TCT.h:300
bool hasLoop(const SVFBasicBlock *bb) const
Definition TCT.h:402
TCTEdge * getGraphEdge(TCTNode *src, TCTNode *dst, TCTEdge::CEDGEK kind)
Get call graph edge via nodes.
Definition TCT.cpp:572
TCTEdge::ThreadCreateEdgeSet ThreadCreateEdgeSet
Definition TCT.h:158
TCTNode * addTCTNode(const CxtThread &ct)
Add TCT node.
Definition TCT.h:451
bool isCandidateFun(const CallGraph::FunctionSet &callees) const
Whether it is a candidate function for indirect call.
Definition TCT.h:285
CxtThreadProcVec ctpList
Thread call graph SCC.
Definition TCT.h:586
std::vector< const ICFGNode * > InstVec
Definition TCT.h:161
SCCDetection< CallGraph * > ThreadCallGraphSCC
Definition TCT.h:171
u32_t TCTEdgeNum
Definition TCT.h:447
bool matchAndPopCxt(CallStrCxt &cxt, const CallICFGNode *call, const FunObjVar *callee)
Match context.
Definition TCT.cpp:469
Map< CxtThread, CallStrCxtSet > CxtThreadToForkCxtSet
Definition TCT.h:166
bool isInLoopInstruction(const ICFGNode *inst)
Multi-forked threads.
Definition TCT.cpp:46
bool isJoinMustExecutedInLoop(const LoopBBs &lp, const ICFGNode *join)
Return true if a join instruction must be executed inside a loop.
Definition TCT.cpp:294
void markRelProcs()
Mark relevant procedures that are backward reachable from any fork/join site.
Definition TCT.cpp:133
Set< const ICFGNode * > inRecurJoinSites
Fork or Join sites in recursions.
Definition TCT.h:592
TCT(PointerAnalysis *p)
Constructor.
Definition TCT.h:174
LoopBBs & getJoinLoop(const CallICFGNode *join)
Get loop for join site.
Definition TCT.h:387
PointerAnalysis * pta
Definition TCT.h:445
TCTNode * getTCTNode(const CxtThread &ct) const
Definition TCT.h:276
void dumpCxt(CallStrCxt &cxt)
Dump calling context.
Definition TCT.cpp:517
bool addTCTEdge(TCTNode *src, TCTNode *dst)
Add TCT edge.
Definition TCT.h:462
u32_t MaxCxtSize
Definition TCT.h:448
const FunSet & getEntryProcs() const
Get marked candidate functions.
Definition TCT.h:236
bool isLoopHeaderOfJoinLoop(const SVFBasicBlock *bb)
Whether a given bb is a loop head of a inloop join site.
Definition TCT.cpp:343
void build()
Build TCT.
Definition TCT.cpp:387
void print() const
Print TCT information.
Definition TCT.cpp:543
void handleCallRelation(CxtThreadProc &ctp, const CallGraphEdge *cgEdge, const CallICFGNode *call)
Handle call relations.
Definition TCT.cpp:245
ThreadCallGraph * tcg
Definition TCT.h:444
Map< const ICFGNode *, LoopBBs > InstToLoopMap
Definition TCT.h:168
void collectMultiForkedThreads()
Definition TCT.cpp:207
Set< std::pair< NodeID, CallStrCxt > > CallStrCxtSet
Definition TCT.h:165
Set< const FunObjVar * > FunSet
Definition TCT.h:160
CxtThreadProc popFromCTPWorkList()
Definition TCT.h:572
TCTEdge * hasGraphEdge(TCTNode *src, TCTNode *dst, TCTEdge::CEDGEK kind) const
Whether we have already created this call graph edge.
Definition TCT.cpp:555
bool isLoopExitOfJoinLoop(const SVFBasicBlock *bb)
Whether a given bb is an exit of a inloop join site.
Definition TCT.cpp:357
SVFLoopAndDomInfo::LoopBBs LoopBBs
Definition TCT.h:157
bool isExtCall(const ICFGNode *inst)
Whether it is calling an external function.
Definition TCT.h:258
virtual ~TCT()
Destructor.
Definition TCT.h:186
u32_t getTCTNodeNum() const
Get Statistics.
Definition TCT.h:243
const LoopBBs & getLoop(const ICFGNode *inst)
Get loop for an instruction.
ThreadCreateEdgeSet::const_iterator getChildrenEnd(const TCTNode *node) const
Definition TCT.h:215
ThreadCreateEdgeSet::const_iterator getParentsBegin(const TCTNode *node) const
Definition TCT.h:219
void pushCxt(CallStrCxt &cxt, const CallICFGNode *call, const FunObjVar *callee)
Context helper functions.
Definition TCT.cpp:449
Map< CxtThread, TCTNode * > CxtThreadToNodeMap
Definition TCT.h:164
const FunObjVar * getStartRoutineOfCxtThread(const CxtThread &ct) const
get the start routine function of a thread
Definition TCT.h:379
const CallStrCxtSet & getCxtOfCxtThread(const CxtThread &ct) const
get the contexts of a thread at its spawning sites (fork sites)
Definition TCT.h:371
bool isTDJoin(const CallICFGNode *inst) const
Return true if this call wait for a worker thread.
ThreadAPI * getThreadAPI() const
Thread API.
void updateCallGraph(PointerAnalysis *pta)
Update call graph using pointer results.
bool isExtCall(const FunObjVar *fun)
Definition SVFUtil.cpp:437
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:52
for isBitcode
Definition BasicTypes.h:68
GenericEdge< TCTNode > GenericTCTEdgeTy
Definition TCT.h:49
GenericNode< TCTNode, TCTEdge > GenericTCTNodeTy
Definition TCT.h:84
u32_t NodeID
Definition GeneralType.h:56
GenericGraph< TCTNode, TCTEdge > GenericThreadCreateTreeTy
Definition TCT.h:152
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
std::vector< u32_t > CallStrCxt
unsigned u32_t
Definition GeneralType.h:47