Static Value-Flow Analysis
Loading...
Searching...
No Matches
WTO.h
Go to the documentation of this file.
1//===- WTO.h -- Weakest Topological Order Analysis-------------------------//
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 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 General Public License for more details.
17
18// You should have received a copy of the GNU General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21//===----------------------------------------------------------------------===//
22
23/*
24 * WTO.h
25 *
26 * The implementation is based on F. Bourdoncle's paper:
27 * "Efficient chaotic iteration strategies with widenings", Formal
28 * Methods in Programming and Their Applications, 1993, pages 128-141.
29 *
30 * Created on: Jan 22, 2024
31 * Author: Xiao Cheng, Jiawei Wang
32 *
33 */
34#ifndef WTO_H_
35#define WTO_H_
36
37#include "Util/GeneralType.h"
38#include <functional>
39
40namespace SVF
41{
42
43template <typename GraphT> class WTO;
44
45template <typename GraphT> class WTONode;
46
47template <typename GraphT> class WTOCycle;
48
49template <typename GraphT> class WTOComponentVisitor;
50
51// Helper to test for the existence of a sub type
52template <typename T, typename = void> struct has_nodetype : std::false_type
53{
54};
55
56template <typename T>
57struct has_nodetype<T, std::void_t<typename T::NodeType>> : std::true_type
58{
59};
60
61template <typename T, typename = void> struct has_edgetype : std::false_type
62{
63};
64
65template <typename T>
66struct has_edgetype<T, std::void_t<typename T::EdgeType>> : std::true_type
67{
68};
69
100template <typename GraphT> class WTOCycleDepth
101{
102public:
103 static_assert(has_nodetype<GraphT>::value,
104 "GraphT must have a nested type named 'NodeType'");
105 typedef typename GraphT::NodeType NodeT;
106
107private:
108 typedef std::vector<const NodeT*> NodeRefList;
109
110public:
111 typedef typename NodeRefList::const_iterator Iterator;
112
113private:
115
116public:
118 WTOCycleDepth() = default;
119
121 WTOCycleDepth(const WTOCycleDepth&) = default;
122
125
128
131
133 ~WTOCycleDepth() = default;
134
136 void add(const NodeT* head)
137 {
138 _heads.push_back(head);
139 }
140
143 {
144 return _heads.cbegin();
145 }
146
148 Iterator end() const
149 {
150 return _heads.cend();
151 }
152
155 {
156 WTOCycleDepth res;
157 for (auto this_it = begin(), other_it = other.begin();
158 this_it != end() && other_it != other.end(); ++this_it, ++other_it)
159 {
160 if (*this_it == *other_it)
161 {
162 res.add(*this_it);
163 }
164 else
165 {
166 break;
167 }
168 }
169 return res;
170 }
171
172private:
174 int compare(const WTOCycleDepth& other) const
175 {
176 if (this == &other)
177 {
178 return 0; // equals
179 }
180
181 auto this_it = begin();
182 auto other_it = other.begin();
183 while (this_it != end())
184 {
185 if (other_it == other.end())
186 {
187 return 1; // `this` is nested within `other`
188 }
189 else if (*this_it == *other_it)
190 {
191 ++this_it;
192 ++other_it;
193 }
194 else
195 {
196 return 2; // not comparable
197 }
198 }
199 if (other_it == other.end())
200 {
201 return 0; // equals
202 }
203 else
204 {
205 return -1; // `other` is nested within `this`
206 }
207 }
208
209public:
210 bool operator<(const WTOCycleDepth& other) const
211 {
212 return compare(other) == -1;
213 }
214
215 bool operator<=(const WTOCycleDepth& other) const
216 {
217 return compare(other) <= 0;
218 }
219
220 bool operator==(const WTOCycleDepth& other) const
221 {
222 return compare(other) == 0;
223 }
224
225 bool operator>=(const WTOCycleDepth& other) const
226 {
227 return operator<=(other, *this);
228 }
229
230 bool operator>(const WTOCycleDepth& other) const
231 {
232 return compare(other) == 1;
233 }
234
236 [[nodiscard]] std::string toString() const
237 {
238 std::string str;
239 std::stringstream rawstr(str);
240 rawstr << "[";
241 for (auto it = begin(), et = end(); it != et;)
242 {
243 rawstr << (*it)->toString();
244 ++it;
245 if (it != et)
246 {
247 rawstr << ", ";
248 }
249 }
250 rawstr << "]";
251 return rawstr.str();
252 }
253
255
256 friend std::ostream& operator<<(std::ostream& o,
258 {
259 o << wto.toString();
260 return o;
261 }
263
264}; // end class WTOCycleDepth
265
271template <typename GraphT> class WTOComponent
272{
273public:
274 enum WTOCT
275 {
277 Cycle
278 };
279
281 explicit WTOComponent(WTOCT k) : _type(k) {};
282
284 WTOComponent(const WTOComponent&) noexcept = default;
285
288
291
294
297
300
302 {
303 return _type;
304 }
305
306 [[nodiscard]] virtual std::string toString() const = 0;
307
309
310 friend std::ostream& operator<<(std::ostream& o,
312 {
313 o << wto.toString();
314 return o;
315 }
317
319
320}; // end class WTOComponent
321
325template <typename GraphT> class WTONode final : public WTOComponent<GraphT>
326{
327public:
328 static_assert(has_nodetype<GraphT>::value,
329 "GraphT must have a nested type named 'NodeType'");
330 typedef typename GraphT::NodeType NodeT;
331
332private:
333 const NodeT* _node;
334
335public:
337 explicit WTONode(const NodeT* node)
339 {
340 }
341
343 const NodeT* getICFGNode() const
344 {
345 return _node;
346 }
347
350 {
351 v.visit(*this);
352 }
353
355 [[nodiscard]] std::string toString() const override
356 {
357 // return _node->toString();
358 return std::to_string(_node->getId());
359 }
360
362
363 static inline bool classof(const WTONode<GraphT>*)
364 {
365 return true;
366 }
367
368 static inline bool classof(const WTOComponent<GraphT>* c)
369 {
370 return c->getKind() == WTOComponent<GraphT>::Node;
371 }
373
374}; // end class WTONode
375
379template <typename GraphT> class WTOCycle final : public WTOComponent<GraphT>
380{
381public:
382 static_assert(has_nodetype<GraphT>::value,
383 "GraphT must have a nested type named 'NodeType'");
384 typedef typename GraphT::NodeType NodeT;
386
387private:
389 typedef std::list<WTOComponentPtr> WTOComponentRefList;
390
391public:
393 typedef typename WTOComponentRefList::const_iterator Iterator;
394
395private:
398
401
402public:
409
411 const WTONode<GraphT>* head() const
412 {
413 return _head;
414 }
415
418 {
419 return _components;
420 }
421
424 {
425 return _components.cbegin();
426 }
427
429 Iterator end() const
430 {
431 return _components.cend();
432 }
433
436 {
437 v.visit(*this);
438 }
439
441
442 static inline bool classof(const WTOCycle<GraphT>*)
443 {
444 return true;
445 }
446
447 static inline bool classof(const WTOComponent<GraphT>* c)
448 {
449 return c->getKind() == WTOComponent<GraphT>::Cycle;
450 }
452
454 [[nodiscard]] std::string toString() const override
455 {
456 std::string str;
457 std::stringstream rawstr(str);
458 rawstr << "(";
459 rawstr << _head->getICFGNode()->getId() << ", ";
460 for (auto it = begin(), et = end(); it != et;)
461 {
462 rawstr << (*it)->toString();
463 ++it;
464 if (it != et)
465 {
466 rawstr << ", ";
467 }
468 }
469 rawstr << ")";
470 return rawstr.str();
471 }
472
473}; // end class WTOCycle
474
511
516{
517
518public:
519 static_assert(has_nodetype<GraphT>::value,
520 "GraphT must have a nested type named 'NodeType'");
521 static_assert(has_edgetype<GraphT>::value,
522 "GraphT must have a nested type named 'EdgeType'");
523 typedef typename GraphT::NodeType NodeT;
524 typedef typename GraphT::EdgeType EdgeT;
530
531protected:
533 typedef std::list<WTOComponentPtr> WTOComponentRefList;
537
540 typedef std::vector<const NodeT*> Stack;
541 typedef std::shared_ptr<GraphTWTOCycleDepth> WTOCycleDepthPtr;
543
544public:
546 typedef typename WTOComponentRefList::const_iterator Iterator;
547
548protected:
556 const NodeT* _entry;
557
558public:
559
561 explicit WTO(const NodeT* entry) : _num(0), _entry(entry)
562 {
563 }
564
566 WTO(const WTO& other) = default;
567
569 WTO(WTO&& other) = default;
570
572 WTO& operator=(const WTO& other) = default;
573
575 WTO& operator=(WTO&& other) = default;
576
579 {
580 for (const auto& component : _allComponents)
581 {
582 delete component;
583 }
584 }
585
588 {
589 return _components;
590 }
591
594 {
595 return _components.cbegin();
596 }
597
599 Iterator end() const
600 {
601 return _components.cend();
602 }
603
604 bool isHead(const NodeT* node) const
605 {
606 return headRefToCycle.find(node) != headRefToCycle.end();
607 }
608
609 typename NodeRefToWTOCycleMap::const_iterator headBegin() const
610 {
611 return headRefToCycle.cbegin();
612 }
613
615 typename NodeRefToWTOCycleMap::const_iterator headEnd() const
616 {
617 return headRefToCycle.cend();
618 }
619
622 {
623 auto it = _nodeToDepth.find(n);
624 assert(it != _nodeToDepth.end() && "node not found");
625 return *(it->second);
626 }
627
629 inline bool in_cycleDepth_table(const NodeT* n) const
630 {
631 auto it = _nodeToDepth.find(n);
632 return it != _nodeToDepth.end();
633 }
634
637 {
638 for (const auto& c : _components)
639 {
640 c->accept(v);
641 }
642 }
643
645 [[nodiscard]] std::string toString() const
646 {
647 std::string str;
648 std::stringstream rawstr(str);
649 rawstr << "[";
650 for (auto it = begin(), et = end(); it != et;)
651 {
652 rawstr << (*it)->toString();
653 ++it;
654 if (it != et)
655 {
656 rawstr << ", ";
657 }
658 }
659 rawstr << "]";
660 return rawstr.str();
661 }
662
664
665 friend std::ostream& operator<<(std::ostream& o, const WTO<GraphT>& wto)
666 {
667 o << wto.toString();
668 return o;
669 }
671
672 void init()
673 {
674 visit(_entry, _components);
675 _nodeToCDN.clear();
676 _stack.clear();
677 buildNodeToDepth();
678 }
679
680protected:
681
684 {
685 private:
688
689 public:
692 : _wtoCycleDepth(std::make_shared<GraphTWTOCycleDepth>()),
693 _nodeToWTOCycleDepth(nodeToWTOCycleDepth)
694 {
695 }
696
697 void visit(const WTOCycleT& cycle) override
698 {
699 const NodeT* head = cycle.head()->getICFGNode();
700 WTOCycleDepthPtr previous_cycleDepth = _wtoCycleDepth;
701 _nodeToWTOCycleDepth.insert(std::make_pair(head, _wtoCycleDepth));
702 _wtoCycleDepth =
703 std::make_shared<GraphTWTOCycleDepth>(*_wtoCycleDepth);
704 _wtoCycleDepth->add(head);
705 for (auto it = cycle.begin(), et = cycle.end(); it != et; ++it)
706 {
707 (*it)->accept(*this);
708 }
709 _wtoCycleDepth = previous_cycleDepth;
710 }
711
712 void visit(const WTONodeT& node) override
713 {
714 _nodeToWTOCycleDepth.insert(
715 std::make_pair(node.getICFGNode(), _wtoCycleDepth));
716 }
717
718 }; // end class WTOCycleDepthBuilder
719
720protected:
722 inline virtual std::vector<const NodeT *> getSuccessors(const NodeT* node)
723 {
724 std::vector<const NodeT *> succssors;
725 for (const auto& e : node->getOutEdges())
726 {
727 succssors.push_back(e->getDstNode());
728 }
729 return succssors;
730 }
731
732protected:
735 {
736 auto it = _nodeToCDN.find(n);
737 if (it != _nodeToCDN.end())
738 {
739 return it->second;
740 }
741 else
742 {
743 return 0;
744 }
745 }
746
748 void setCDN(const NodeT* n, const CycleDepthNumber& dfn)
749 {
750 auto res = _nodeToCDN.insert(std::make_pair(n, dfn));
751 if (!res.second)
752 {
753 (res.first)->second = dfn;
754 }
755 }
756
758 const NodeT* pop()
759 {
760 assert(!_stack.empty() && "empty stack");
761 const NodeT* top = _stack.back();
762 _stack.pop_back();
763 return top;
764 }
765
767 void push(const NodeT* n)
768 {
769 _stack.push_back(n);
770 }
771
772 const WTONodeT* newNode(const NodeT* node)
773 {
774 const WTONodeT* ptr = new WTONodeT(node);
775 _allComponents.insert(ptr);
776 return ptr;
777 }
778
779 const WTOCycleT* newCycle(const WTONodeT* node,
781 {
782 const WTOCycleT* ptr = new WTOCycleT(node, std::move(partition));
783 _allComponents.insert(ptr);
784 return ptr;
785 }
786
788 virtual const WTOCycleT* component(const NodeT* node)
789 {
791
792 for (auto succ: getSuccessors(node))
793 {
794 if (getCDN(succ) == 0)
795 {
797 }
798 }
799 const WTONodeT* head = newNode(node);
800 const WTOCycleT* ptr = newCycle(head, partition);
801 headRefToCycle.emplace(node, ptr);
802 return ptr;
803 }
804
808 virtual CycleDepthNumber visit(const NodeT* node,
810 {
811 CycleDepthNumber head(0);
812 CycleDepthNumber min(0);
813 bool loop;
814
815 push(node);
816 _num += CycleDepthNumber(1);
817 head = _num;
818 setCDN(node, head);
819 loop = false;
820
821 for (auto succ: getSuccessors(node))
822 {
824 if (succ_dfn == CycleDepthNumber(0))
825 {
826 min = visit(succ, partition);
827 }
828 else
829 {
830 min = succ_dfn;
831 }
832 if (min <= head)
833 {
834 head = min;
835 loop = true;
836 }
837 }
838
839 if (head == getCDN(node))
840 {
841 setCDN(node, UINT_MAX);
842 const NodeT* element = pop();
843 if (loop)
844 {
845 while (element != node)
846 {
847 setCDN(element, 0);
848 element = pop();
849 }
850 partition.push_front(component(node));
851 }
852 else
853 {
854 partition.push_front(newNode(node));
855 }
856 }
857 return head;
858 }
859
862 {
863 WTOCycleDepthBuilder builder(_nodeToDepth);
864 for (auto it = begin(), et = end(); it != et; ++it)
865 {
866 (*it)->accept(builder);
867 }
868 }
869
870}; // end class WTO
871
872} // namespace SVF
873
874#endif /* WTO_H_ */
cJSON * n
Definition cJSON.cpp:2558
virtual void visit(const WTONodeT &)=0
Visit the given node.
WTOComponentVisitor(WTOComponentVisitor &&) noexcept=default
Move constructor.
WTOComponentVisitor(const WTOComponentVisitor &) noexcept=default
Copy constructor.
WTOComponentVisitor()=default
Default constructor.
WTONode< GraphT > WTONodeT
Definition WTO.h:481
WTOCycle< GraphT > WTOCycleT
Definition WTO.h:482
virtual std::string toString() const =0
WTOCT _type
Definition WTO.h:318
friend std::ostream & operator<<(std::ostream &o, const WTOComponent< GraphT > &wto)
Overloading operator << for dumping ICFG node ID.
Definition WTO.h:310
virtual void accept(WTOComponentVisitor< GraphT > &) const =0
Accept the given visitor.
WTOComponent(WTOCT k)
Default constructor.
Definition WTO.h:281
WTOComponent(const WTOComponent &) noexcept=default
Copy constructor.
WTOCT getKind() const
Definition WTO.h:301
WTOComponent(WTOComponent &&) noexcept=default
Move constructor.
Iterator begin() const
Begin iterator over the head of cycles.
Definition WTO.h:142
bool operator>=(const WTOCycleDepth &other) const
Definition WTO.h:225
~WTOCycleDepth()=default
Destructor.
Iterator end() const
End iterator over the head of cycles.
Definition WTO.h:148
WTOCycleDepth & operator=(WTOCycleDepth &&)=default
Move assignment operator.
std::string toString() const
Dump the cycleDepth, for debugging purpose.
Definition WTO.h:236
bool operator<=(const WTOCycleDepth &other) const
Definition WTO.h:215
NodeRefList::const_iterator Iterator
Definition WTO.h:111
bool operator<(const WTOCycleDepth &other) const
Definition WTO.h:210
bool operator==(const WTOCycleDepth &other) const
Definition WTO.h:220
WTOCycleDepth(WTOCycleDepth &&)=default
Move constructor.
NodeRefList _heads
Definition WTO.h:114
WTOCycleDepth(const WTOCycleDepth &)=default
Copy constructor.
bool operator>(const WTOCycleDepth &other) const
Definition WTO.h:230
void add(const NodeT *head)
Add a cycle head in the cycleDepth.
Definition WTO.h:136
WTOCycleDepth()=default
Constructor.
WTOCycleDepth & operator=(const WTOCycleDepth &)=default
Copy assignment operator.
GraphT::NodeType NodeT
Definition WTO.h:105
friend std::ostream & operator<<(std::ostream &o, const WTOCycleDepth< GraphT > &wto)
Overloading operator << for dumping ICFG node ID.
Definition WTO.h:256
WTOCycleDepth operator^(const WTOCycleDepth &other) const
Return the common prefix of the given cycle depths.
Definition WTO.h:154
std::vector< const NodeT * > NodeRefList
Definition WTO.h:108
int compare(const WTOCycleDepth &other) const
Compare the given cycle depths.
Definition WTO.h:174
static bool classof(const WTOComponent< GraphT > *c)
Definition WTO.h:447
Iterator end() const
End iterator over the components.
Definition WTO.h:429
std::list< WTOComponentPtr > WTOComponentRefList
Definition WTO.h:389
GraphT::NodeType NodeT
Definition WTO.h:384
const WTOComponentRefList & getWTOComponents() const
Get all wto components in WTO cycle.
Definition WTO.h:417
const WTOComponentT * WTOComponentPtr
Definition WTO.h:388
std::string toString() const override
Dump the cycle, for debugging purpose.
Definition WTO.h:454
const WTONode< GraphT > * _head
Head of the cycle.
Definition WTO.h:397
Iterator begin() const
Begin iterator over the components.
Definition WTO.h:423
WTOComponentRefList _components
List of components.
Definition WTO.h:400
void accept(WTOComponentVisitor< GraphT > &v) const override
Accept the given visitor.
Definition WTO.h:435
WTOComponentRefList::const_iterator Iterator
Iterator over the components.
Definition WTO.h:393
const WTONode< GraphT > * head() const
Return the head of the cycle.
Definition WTO.h:411
WTOComponent< GraphT > WTOComponentT
Definition WTO.h:385
static bool classof(const WTOCycle< GraphT > *)
ClassOf.
Definition WTO.h:442
WTOCycle(const WTONode< GraphT > *head, WTOComponentRefList components)
Constructor.
Definition WTO.h:404
void accept(WTOComponentVisitor< GraphT > &v) const override
Accept the given visitor.
Definition WTO.h:349
static bool classof(const WTONode< GraphT > *)
ClassOf.
Definition WTO.h:363
GraphT::NodeType NodeT
Definition WTO.h:330
const NodeT * getICFGNode() const
Return the graph node.
Definition WTO.h:343
std::string toString() const override
Dump the node, for debugging purpose.
Definition WTO.h:355
const NodeT * _node
Definition WTO.h:333
WTONode(const NodeT *node)
Constructor.
Definition WTO.h:337
static bool classof(const WTOComponent< GraphT > *c)
Definition WTO.h:368
Visitor to build the cycle depths of each node.
Definition WTO.h:684
void visit(const WTONodeT &node) override
Visit the given node.
Definition WTO.h:712
WTOCycleDepthBuilder(NodeRefToWTOCycleDepthPtr &nodeToWTOCycleDepth)
Definition WTO.h:690
NodeRefToWTOCycleDepthPtr & _nodeToWTOCycleDepth
Definition WTO.h:687
void visit(const WTOCycleT &cycle) override
Visit the given cycle.
Definition WTO.h:697
WTOCycleDepthPtr _wtoCycleDepth
Definition WTO.h:686
WTO & operator=(WTO &&other)=default
Move assignment operator.
WTO(WTO &&other)=default
Move constructor.
void init()
Definition WTO.h:672
Iterator begin() const
Begin iterator over the components.
Definition WTO.h:593
const NodeT * pop()
Pop a node from the stack.
Definition WTO.h:758
bool in_cycleDepth_table(const NodeT *n) const
Return the cycleDepth of the given node.
Definition WTO.h:629
std::string toString() const
Dump the order, for debugging purpose.
Definition WTO.h:645
Iterator end() const
End iterator over the components.
Definition WTO.h:599
Stack _stack
Definition WTO.h:555
WTOComponent< GraphT > WTOComponentT
Definition WTO.h:526
WTOComponentRefList::const_iterator Iterator
Iterator over the components.
Definition WTO.h:546
Map< const NodeT *, WTOCycleDepthPtr > NodeRefToWTOCycleDepthPtr
Definition WTO.h:542
u32_t CycleDepthNumber
Definition WTO.h:538
NodeRefToCycleDepthNumber _nodeToCDN
Definition WTO.h:553
const GraphTWTOCycleDepth & cycleDepth(const NodeT *n) const
Return the cycleDepth of the given node.
Definition WTO.h:621
virtual CycleDepthNumber visit(const NodeT *node, WTOComponentRefList &partition)
Definition WTO.h:808
NodeRefToWTOCycleMap headRefToCycle
Definition WTO.h:551
const NodeT * _entry
Definition WTO.h:556
bool isHead(const NodeT *node) const
Definition WTO.h:604
GraphT::EdgeType EdgeT
Definition WTO.h:524
const WTOCycleT * newCycle(const WTONodeT *node, const WTOComponentRefList &partition)
Definition WTO.h:779
NodeRefToWTOCycleMap::const_iterator headBegin() const
Definition WTO.h:609
WTOComponentRefSet _allComponents
Definition WTO.h:550
WTOCycle< GraphT > WTOCycleT
Definition WTO.h:528
~WTO()
Destructor.
Definition WTO.h:578
GraphT::NodeType NodeT
Definition WTO.h:523
Set< const NodeT * > NodeRefList
Definition WTO.h:529
void setCDN(const NodeT *n, const CycleDepthNumber &dfn)
Set the depth-first number of the given node.
Definition WTO.h:748
std::shared_ptr< GraphTWTOCycleDepth > WTOCycleDepthPtr
Definition WTO.h:541
WTO(const WTO &other)=default
No copy constructor.
Map< const NodeT *, const WTOCycleT * > NodeRefToWTOCycleMap
Definition WTO.h:535
CycleDepthNumber getCDN(const NodeT *n) const
Return the depth-first number of the given node.
Definition WTO.h:734
WTO & operator=(const WTO &other)=default
No copy assignment operator.
Set< WTOComponentPtr > WTOComponentRefSet
Definition WTO.h:534
Map< const NodeT *, CycleDepthNumber > NodeRefToCycleDepthNumber
Definition WTO.h:539
virtual std::vector< const NodeT * > getSuccessors(const NodeT *node)
Return the successors of node.
Definition WTO.h:722
WTONode< GraphT > WTONodeT
Definition WTO.h:527
void push(const NodeT *n)
Push a node on the stack.
Definition WTO.h:767
virtual const WTOCycleT * component(const NodeT *node)
Create the cycle component for the given node.
Definition WTO.h:788
std::vector< const NodeT * > Stack
Definition WTO.h:540
NodeRefToWTOCycleDepthPtr _nodeToDepth
Definition WTO.h:552
const WTOComponentT * WTOComponentPtr
Definition WTO.h:532
void buildNodeToDepth()
Build the node to WTO cycle depth table.
Definition WTO.h:861
std::list< WTOComponentPtr > WTOComponentRefList
Definition WTO.h:533
WTOComponentRefList _components
Definition WTO.h:549
NodeRefToWTOCycleMap::const_iterator headEnd() const
End iterator over the components.
Definition WTO.h:615
const WTONodeT * newNode(const NodeT *node)
Definition WTO.h:772
WTOCycleDepth< GraphT > GraphTWTOCycleDepth
Definition WTO.h:525
Map< const NodeT *, NodeRefList > NodeRefTONodeRefListMap
Definition WTO.h:536
const WTOComponentRefList & getWTOComponents() const
Get all wto components in WTO.
Definition WTO.h:587
void accept(WTOComponentVisitor< GraphT > &v)
Accept the given visitor.
Definition WTO.h:636
friend std::ostream & operator<<(std::ostream &o, const WTO< GraphT > &wto)
Overloading operator << for dumping ICFG node ID.
Definition WTO.h:665
CycleDepthNumber _num
Definition WTO.h:554
WTO(const NodeT *entry)
Compute the weak topological order of the given graph.
Definition WTO.h:561
for isBitcode
Definition BasicTypes.h:70
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76
unsigned u32_t
Definition GeneralType.h:67