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
34#include "Graphs/SCC.h"
36#include "Util/CxtStmt.h"
37#include "Util/SVFUtil.h"
38#include <set>
39#include <vector>
40
41namespace SVF
42{
43
44class TCTNode;
45
46
47/*
48 * Thread creation edge represents a spawning relation between two context sensitive threads
49 */
52{
53public:
54 enum CEDGEK
55 {
57 };
60 GenericTCTEdgeTy(s, d, kind)
61 {
62 }
64 virtual ~TCTEdge()
65 {
66 }
68
69 static inline bool classof(const TCTEdge*)
70 {
71 return true;
72 }
73 static inline bool classof(const GenericTCTEdgeTy *edge)
74 {
75 return edge->getEdgeKind() == TCTEdge::ThreadCreateEdge;
76 }
79
80};
81
82/*
83 * Each node represents a context-sensitive thread
84 */
87{
88
89public:
95
96 void dump()
97 {
98 SVFUtil::outs() << "---\ntid: " << this->getId() << " inloop:" << ctx.isInloop() << " incycle:" << ctx.isIncycle() << " multiforked:"<< isMultiforked();
99 }
100
102 inline const CxtThread& getCxtThread() const
103 {
104 return ctx;
105 }
106
108
109 inline bool isInloop() const
110 {
111 return ctx.isInloop();
112 }
113 inline bool isIncycle() const
114 {
115 return ctx.isIncycle();
116 }
117 inline void setMultiforked(bool value)
118 {
119 multiforked = value;
120 }
121 inline bool isMultiforked() const
122 {
123 return multiforked;
124 }
126
128
129 static inline bool classof(const TCTNode *)
130 {
131 return true;
132 }
133
134 static inline bool classof(const GenericTCTNodeTy *node)
135 {
136 return node->getNodeKind() == TCTNodeKd;
137 }
138 static inline bool classof(const SVFValue*node)
139 {
140 return node->getNodeKind() == TCTNodeKd;
141 }
143
144
145private:
148};
149
155{
156
157public:
160 typedef ThreadCreateEdgeSet::iterator TCTNodeIter;
162 typedef std::vector<const ICFGNode*> InstVec;
173
176 {
177 tcg = SVFUtil::dyn_cast<ThreadCallGraph>(pta->getCallGraph());
178 assert(tcg != nullptr && "TCT::TCT: call graph is not a ThreadCallGraph!");
180 //tcg->updateJoinEdge(pta);
182 tcgSCC->find();
183 build();
184 }
185
187 virtual ~TCT()
188 { }
189
192 {
193 return tcg;
194 }
196 inline PointerAnalysis* getPTA() const
197 {
198 return pta;
199 }
201 inline TCTNode* getTCTNode(NodeID id) const
202 {
203 return getGNode(id);
204 }
206 TCTEdge* hasGraphEdge(TCTNode* src, TCTNode* dst, TCTEdge::CEDGEK kind) const;
209
211
212 inline ThreadCreateEdgeSet::const_iterator getChildrenBegin(const TCTNode* node) const
213 {
214 return node->OutEdgeBegin();
215 }
216 inline ThreadCreateEdgeSet::const_iterator getChildrenEnd(const TCTNode* node) const
217 {
218 return node->OutEdgeEnd();
219 }
220 inline ThreadCreateEdgeSet::const_iterator getParentsBegin(const TCTNode* node) const
221 {
222 return node->InEdgeBegin();
223 }
224 inline ThreadCreateEdgeSet::const_iterator getParentsEnd(const TCTNode* node) const
225 {
226 return node->InEdgeEnd();
227 }
229
231 inline const FunSet& getMakredProcs() const
232 {
233 return candidateFuncSet;
234 }
235
237 inline const FunSet& getEntryProcs() const
238 {
239 return entryFuncSet;
240 }
241
243
244 inline u32_t getTCTNodeNum() const
245 {
246 return TCTNodeNum;
247 }
248 inline u32_t getTCTEdgeNum() const
249 {
250 return TCTEdgeNum;
251 }
252 inline u32_t getMaxCxtSize() const
253 {
254 return MaxCxtSize;
255 }
257
259 inline bool isExtCall(const ICFGNode* inst)
260 {
261 if(const CallICFGNode* call = SVFUtil::dyn_cast<CallICFGNode>(inst))
262 return SVFUtil::isExtCall(call);
263 return false;
264 }
266 inline bool isCallSite(const ICFGNode* inst)
267 {
268 return SVFUtil::isa<CallICFGNode>(inst);
269 }
270
272
273 inline bool hasTCTNode(const CxtThread& ct) const
274 {
275 return ctpToNodeMap.find(ct)!=ctpToNodeMap.end();
276 }
277 inline TCTNode* getTCTNode(const CxtThread& ct) const
278 {
279 CxtThreadToNodeMap::const_iterator it = ctpToNodeMap.find(ct);
280 assert(it!=ctpToNodeMap.end() && "TCT node not found??");
281 return it->second;
282 }
284
287 {
288 for(CallGraph::FunctionSet::const_iterator cit = callees.begin(),
289 ecit = callees.end(); cit!=ecit; cit++)
290 {
291 if(candidateFuncSet.find((*cit))!=candidateFuncSet.end())
292 return true;
293 }
294 return false;
295 }
296 inline bool isCandidateFun(const FunObjVar* fun) const
297 {
298 return candidateFuncSet.find(fun)!=candidateFuncSet.end();
299 }
301 inline bool inSameCallGraphSCC(const CallGraphNode* src,const CallGraphNode* dst)
302 {
303 return (tcgSCC->repNode(src->getId()) == tcgSCC->repNode(dst->getId()));
304 }
305
307
308
309 inline bool hasParentThread(NodeID tid) const
310 {
311 const TCTNode* node = getTCTNode(tid);
312 return node->getInEdges().size()==1;
313 }
316 {
318 const TCTNode* node = getTCTNode(tid);
319 assert(node->getInEdges().size()>=1 && "does not have a parent thread");
320
321 for (const TCTEdge* edge : node->getInEdges())
322 {
323 parentTds.set(edge->getSrcID());
324 }
325 return parentTds;
326 }
329 {
330 NodeBS tds;
331 if(hasParentThread(tid) == false)
332 return tds;
333
334 FIFOWorkList<NodeID> worklist;
336 worklist.push(parentTid);
337
338 while(!worklist.empty())
339 {
340 NodeID t = worklist.pop();
341 if(tds.test_and_set(t))
342 {
343 if(hasParentThread(t))
345 worklist.push(parentTid);
346 }
347 }
348 return tds;
349 }
351 inline const NodeBS getSiblingThread(NodeID tid) const
352 {
353 NodeBS tds;
354 if(hasParentThread(tid) == false)
355 return tds;
357 {
359 for(ThreadCreateEdgeSet::const_iterator it = getChildrenBegin(parentNode),
361 {
362 NodeID child = (*it)->getDstNode()->getId();
363 if(child!=tid)
364 tds.set(child);
365 }
366 }
367 return tds;
368 }
370
373 {
374 CxtThreadToForkCxtSet::const_iterator it = ctToForkCxtsMap.find(ct);
375 assert(it!=ctToForkCxtsMap.end() && "Cxt Thread not found!!");
376 return it->second;
377 }
378
381 {
382 CxtThreadToFun::const_iterator it = ctToRoutineFunMap.find(ct);
383 assert(it!=ctToRoutineFunMap.end() && "Cxt Thread not found!!");
384 return it->second;
385 }
386
389 {
390 assert(tcg->getThreadAPI()->isTDJoin(join) && "not a join site");
391 InstToLoopMap::iterator it = joinSiteToLoopMap.find(join);
392 assert(it!=joinSiteToLoopMap.end() && "loop not found");
393 return it->second;
394 }
395
396 inline bool hasJoinLoop(const CallICFGNode* join) const
397 {
398 assert(tcg->getThreadAPI()->isTDJoin(join) && "not a join site");
399 InstToLoopMap::const_iterator it = joinSiteToLoopMap.find(join);
400 return it!=joinSiteToLoopMap.end();
401 }
402
403 bool hasLoop(const SVFBasicBlock* bb) const
404 {
405 const FunObjVar* fun = bb->getFunction();
406 return fun->hasLoopInfo(bb);
407 }
408 bool hasLoop(const ICFGNode* inst) const
409 {
410 return hasLoop(inst->getBB());
411 }
413 bool isJoinMustExecutedInLoop(const LoopBBs& lp,const ICFGNode* join);
415 const LoopBBs& getLoop(const ICFGNode* inst);
417 const LoopBBs& getLoop(const SVFBasicBlock* bb);
418
420
421
422 void pushCxt(CallStrCxt& cxt, const CallICFGNode* call, const FunObjVar* callee);
424 bool matchAndPopCxt(CallStrCxt& cxt, const CallICFGNode* call, const FunObjVar* callee);
426 bool isContextSuffix(const CallStrCxt& lhs, const CallStrCxt& call);
428
430 inline bool isJoinSiteInRecursion(const CallICFGNode* join) const
431 {
432 assert(tcg->getThreadAPI()->isTDJoin(join) && "not a join site");
433 return inRecurJoinSites.find(join)!=inRecurJoinSites.end();
434 }
436 void dumpCxt(CallStrCxt& cxt);
437
439 void dump(const std::string& filename);
440
442 void print() const;
443
444private:
450
453 {
454 assert(ctpToNodeMap.find(ct)==ctpToNodeMap.end() && "Already has this node!!");
455 NodeID id = TCTNodeNum;
456 TCTNode* node = new TCTNode(id, ct);
457 addGNode(id, node);
458 TCTNodeNum++;
459 ctpToNodeMap[ct] = node;
460 return node;
461 }
463 inline bool addTCTEdge(TCTNode* src, TCTNode* dst)
464 {
466 {
468 dst->addIncomingEdge(edge);
469 src->addOutgoingEdge(edge);
470 TCTEdgeNum++;
471 return true;
472 }
473 return false;
474 }
475
477 void build();
478
480
481 void markRelProcs();
482 void markRelProcs(const FunObjVar* fun);
484
487
491
493
494
499 bool isLoopExitOfJoinLoop(const SVFBasicBlock* bb);
501
503
504
505 bool isInLoopInstruction(const ICFGNode* inst);
507 bool isInRecursion(const ICFGNode* inst) const;
509
512
514
516 {
517 CxtThread ct(cxt,fork);
518 CxtThreadToNodeMap::const_iterator it = ctpToNodeMap.find(ct);
519 if(it!=ctpToNodeMap.end())
520 {
521 return it->second;
522 }
523
524 addCxtOfCxtThread(forkSiteCtp.getTid(), forkSiteCtp.getContext(), ct);
526
528 return addTCTNode(ct);
529 }
531
534 {
536 if(ct.getThread() != nullptr)
537 {
538 const ICFGNode* svfInst = ct.getThread();
539 ct.setInloop(isInLoopInstruction(svfInst));
540 ct.setIncycle(isInRecursion(svfInst));
541 }
543 else
544 {
545 ct.setInloop(false);
546 ct.setIncycle(false);
547 }
548 }
549
552 {
553 ctToForkCxtsMap[ct].insert(std::make_pair(pTid, cxt));
554 }
555
558 {
559 ctToRoutineFunMap[ct] = fun;
560 }
561
563
565 {
566 if(isVisitedCTPs(ctp)==false)
567 {
568 visitedCTPs.insert(ctp);
569 return ctpList.push(ctp);
570 }
571 return false;
572 }
574 {
576 return ctp;
577 }
578 inline bool isVisitedCTPs(const CxtThreadProc& ctp) const
579 {
580 return visitedCTPs.find(ctp)!=visitedCTPs.end();
581 }
583
594};
595
596} // End namespace SVF
597
598namespace SVF
599{
600/* !
601 * GenericGraphTraits specializations for constraint graph so that they can be treated as
602 * graphs by the generic graph algorithms.
603 * Provide graph traits for traversing from a constraint node using standard graph traversals.
604 */
605template<> struct GenericGraphTraits<SVF::TCTNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* >
606{
607};
608
610template<>
611struct GenericGraphTraits<Inverse<SVF::TCTNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* > >
612{
613};
614
615template<> struct GenericGraphTraits<SVF::TCT*> : public GenericGraphTraits<SVF::GenericGraph<SVF::TCTNode,SVF::TCTEdge>* >
616{
618};
619
620} // End namespace llvm
621
622#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:247
bool isInloop() const
Definition CxtStmt.h:264
bool isIncycle() const
Definition CxtStmt.h:272
bool push(const Data &data)
Definition WorkList.h:180
bool empty() const
Definition WorkList.h:161
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:161
GNodeK getNodeKind() const
Get node kind.
Definition SVFValue.h:167
static bool classof(const GenericTCTEdgeTy *edge)
Definition TCT.h:73
@ ThreadCreateEdge
Definition TCT.h:56
GenericNode< TCTNode, TCTEdge >::GEdgeSetTy ThreadCreateEdgeSet
Definition TCT.h:78
TCTEdge(TCTNode *s, TCTNode *d, CEDGEK kind)
Constructor.
Definition TCT.h:59
static bool classof(const TCTEdge *)
Classof.
Definition TCT.h:69
virtual ~TCTEdge()
Destructor.
Definition TCT.h:64
const CxtThread & getCxtThread() const
Get thread creation context, <fork site, call string context>
Definition TCT.h:102
void setMultiforked(bool value)
Definition TCT.h:117
bool multiforked
Thread creation context, <fork site, call string context>
Definition TCT.h:147
bool isIncycle() const
Definition TCT.h:113
bool isInloop() const
inloop, incycle attributes
Definition TCT.h:109
void dump()
Definition TCT.h:96
bool isMultiforked() const
Definition TCT.h:121
const CxtThread ctx
Definition TCT.h:146
static bool classof(const TCTNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition TCT.h:129
static bool classof(const SVFValue *node)
Definition TCT.h:138
static bool classof(const GenericTCTNodeTy *node)
Definition TCT.h:134
TCTNode(NodeID i, const CxtThread &cctx)
Constructor.
Definition TCT.h:91
bool pushToCTPWorkList(const CxtThreadProc &ctp)
WorkList helper functions.
Definition TCT.h:564
const FunSet & getMakredProcs() const
Get marked candidate functions.
Definition TCT.h:231
const NodeBS getAncestorThreads(NodeID tid) const
Get all ancestor threads.
Definition TCT.h:328
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:590
TCTNode * getTCTNode(NodeID id) const
Get TCT node.
Definition TCT.h:201
Set< CxtThreadProc > CxtThreadProcSet
Definition TCT.h:171
CxtThreadToNodeMap ctpToNodeMap
Record all visited ctps.
Definition TCT.h:589
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:296
Set< const ICFGNode * > InstSet
Definition TCT.h:163
void setMultiForkedAttrs(CxtThread &ct)
Set multi-forked thread attributes.
Definition TCT.h:533
FunSet entryFuncSet
Definition TCT.h:584
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:515
bool isJoinSiteInRecursion(const CallICFGNode *join) const
Whether a join site is in recursion.
Definition TCT.h:430
FIFOWorkList< CxtThreadProc > CxtThreadProcVec
Definition TCT.h:170
void collectLoopInfoForJoin()
Handle join site in loop.
Definition TCT.cpp:318
bool isCallSite(const ICFGNode *inst)
Whether it is a callsite.
Definition TCT.h:266
void addCxtOfCxtThread(NodeID pTid, const CallStrCxt &cxt, const CxtThread &ct)
Add context for a thread at its spawning site (fork site)
Definition TCT.h:551
ThreadCallGraphSCC * tcgSCC
Procedures we care about during call graph traversing when creating TCT.
Definition TCT.h:586
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:315
CxtThreadToFun ctToRoutineFunMap
Map a CxtThread to the context at its spawning site (fork site).
Definition TCT.h:591
PointerAnalysis * getPTA() const
Get PTA.
Definition TCT.h:196
CxtThreadProcSet visitedCTPs
CxtThreadProc List.
Definition TCT.h:588
bool hasJoinLoop(const CallICFGNode *join) const
Definition TCT.h:396
u32_t getMaxCxtSize() const
Definition TCT.h:252
Set< const CallGraphNode * > PTACGNodeSet
Definition TCT.h:164
ThreadCreateEdgeSet::const_iterator getChildrenBegin(const TCTNode *node) const
Get children and parent nodes.
Definition TCT.h:212
u32_t TCTNodeNum
Definition TCT.h:447
Map< CxtThread, const FunObjVar * > CxtThreadToFun
Definition TCT.h:168
ThreadCallGraph * getThreadCallGraph() const
Get TCG.
Definition TCT.h:191
bool hasLoop(const ICFGNode *inst) const
Definition TCT.h:408
InstToLoopMap joinSiteToLoopMap
Map a CxtThread to its start routine function.
Definition TCT.h:592
bool hasTCTNode(const CxtThread &ct) const
Find/Get TCT node.
Definition TCT.h:273
ThreadCreateEdgeSet::const_iterator getParentsEnd(const TCTNode *node) const
Definition TCT.h:224
const NodeBS getSiblingThread(NodeID tid) const
Get sibling threads.
Definition TCT.h:351
bool hasParentThread(NodeID tid) const
Get parent and sibling threads.
Definition TCT.h:309
bool isVisitedCTPs(const CxtThreadProc &ctp) const
Definition TCT.h:578
u32_t getTCTEdgeNum() const
Definition TCT.h:248
ThreadCreateEdgeSet::iterator TCTNodeIter
Definition TCT.h:160
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:585
void addStartRoutineOfCxtThread(const FunObjVar *fun, const CxtThread &ct)
Add start routine function of a cxt thread.
Definition TCT.h:557
bool inSameCallGraphSCC(const CallGraphNode *src, const CallGraphNode *dst)
Whether two functions in the same callgraph scc.
Definition TCT.h:301
bool hasLoop(const SVFBasicBlock *bb) const
Definition TCT.h:403
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:159
TCTNode * addTCTNode(const CxtThread &ct)
Add TCT node.
Definition TCT.h:452
bool isCandidateFun(const CallGraph::FunctionSet &callees) const
Whether it is a candidate function for indirect call.
Definition TCT.h:286
CxtThreadProcVec ctpList
Thread call graph SCC.
Definition TCT.h:587
std::vector< const ICFGNode * > InstVec
Definition TCT.h:162
SCCDetection< CallGraph * > ThreadCallGraphSCC
Definition TCT.h:172
u32_t TCTEdgeNum
Definition TCT.h:448
bool matchAndPopCxt(CallStrCxt &cxt, const CallICFGNode *call, const FunObjVar *callee)
Match context.
Definition TCT.cpp:469
Map< CxtThread, CallStrCxtSet > CxtThreadToForkCxtSet
Definition TCT.h:167
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:593
TCT(PointerAnalysis *p)
Constructor.
Definition TCT.h:175
LoopBBs & getJoinLoop(const CallICFGNode *join)
Get loop for join site.
Definition TCT.h:388
PointerAnalysis * pta
Definition TCT.h:446
TCTNode * getTCTNode(const CxtThread &ct) const
Definition TCT.h:277
void dumpCxt(CallStrCxt &cxt)
Dump calling context.
Definition TCT.cpp:517
bool addTCTEdge(TCTNode *src, TCTNode *dst)
Add TCT edge.
Definition TCT.h:463
u32_t MaxCxtSize
Definition TCT.h:449
const FunSet & getEntryProcs() const
Get marked candidate functions.
Definition TCT.h:237
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:445
Map< const ICFGNode *, LoopBBs > InstToLoopMap
Definition TCT.h:169
void collectMultiForkedThreads()
Definition TCT.cpp:207
Set< std::pair< NodeID, CallStrCxt > > CallStrCxtSet
Definition TCT.h:166
Set< const FunObjVar * > FunSet
Definition TCT.h:161
CxtThreadProc popFromCTPWorkList()
Definition TCT.h:573
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:158
bool isExtCall(const ICFGNode *inst)
Whether it is calling an external function.
Definition TCT.h:259
virtual ~TCT()
Destructor.
Definition TCT.h:187
u32_t getTCTNodeNum() const
Get Statistics.
Definition TCT.h:244
const LoopBBs & getLoop(const ICFGNode *inst)
Get loop for an instruction.
ThreadCreateEdgeSet::const_iterator getChildrenEnd(const TCTNode *node) const
Definition TCT.h:216
ThreadCreateEdgeSet::const_iterator getParentsBegin(const TCTNode *node) const
Definition TCT.h:220
void pushCxt(CallStrCxt &cxt, const CallICFGNode *call, const FunObjVar *callee)
Context helper functions.
Definition TCT.cpp:449
Map< CxtThread, TCTNode * > CxtThreadToNodeMap
Definition TCT.h:165
const FunObjVar * getStartRoutineOfCxtThread(const CxtThread &ct) const
get the start routine function of a thread
Definition TCT.h:380
const CallStrCxtSet & getCxtOfCxtThread(const CxtThread &ct) const
get the contexts of a thread at its spawning sites (fork sites)
Definition TCT.h:372
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:441
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:52
for isBitcode
Definition BasicTypes.h:70
GenericEdge< TCTNode > GenericTCTEdgeTy
Definition TCT.h:50
GenericNode< TCTNode, TCTEdge > GenericTCTNodeTy
Definition TCT.h:85
u32_t NodeID
Definition GeneralType.h:56
GenericGraph< TCTNode, TCTEdge > GenericThreadCreateTreeTy
Definition TCT.h:153
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76
std::vector< u32_t > CallStrCxt
unsigned u32_t
Definition GeneralType.h:47