@@ -29,6 +29,7 @@ namespace llvm {
29
29
template <> struct GraphTraits <swift::SILBasicBlock*> {
30
30
typedef swift::SILBasicBlock NodeType;
31
31
typedef NodeType::SuccessorListTy::iterator ChildIteratorType;
32
+ typedef NodeType *NodeRef;
32
33
33
34
static NodeType *getEntryNode (NodeType *BB) { return BB; }
34
35
@@ -43,6 +44,7 @@ template <> struct GraphTraits<swift::SILBasicBlock*> {
43
44
template <> struct GraphTraits <const swift::SILBasicBlock*> {
44
45
typedef const swift::SILBasicBlock NodeType;
45
46
typedef NodeType::ConstSuccessorListTy::iterator ChildIteratorType;
47
+ typedef NodeType *NodeRef;
46
48
47
49
static NodeType *getEntryNode (NodeType *BB) { return BB; }
48
50
@@ -57,6 +59,7 @@ template <> struct GraphTraits<const swift::SILBasicBlock*> {
57
59
template <> struct GraphTraits <Inverse<swift::SILBasicBlock*> > {
58
60
typedef swift::SILBasicBlock NodeType;
59
61
typedef NodeType::pred_iterator ChildIteratorType;
62
+ typedef NodeType *NodeRef;
60
63
61
64
static NodeType *getEntryNode (Inverse<swift::SILBasicBlock *> G) {
62
65
return G.Graph ;
@@ -72,6 +75,8 @@ template <> struct GraphTraits<Inverse<swift::SILBasicBlock*> > {
72
75
template <> struct GraphTraits <Inverse<const swift::SILBasicBlock*> > {
73
76
typedef const swift::SILBasicBlock NodeType;
74
77
typedef NodeType::pred_iterator ChildIteratorType;
78
+ typedef NodeType *NodeRef;
79
+
75
80
static NodeType *getEntryNode (Inverse<const swift::SILBasicBlock *> G) {
76
81
return G.Graph ;
77
82
}
@@ -86,6 +91,7 @@ template <> struct GraphTraits<Inverse<const swift::SILBasicBlock*> > {
86
91
template <> struct GraphTraits <swift::SILFunction*>
87
92
: public GraphTraits<swift::SILBasicBlock*> {
88
93
typedef swift::SILFunction *GraphType;
94
+ typedef NodeType *NodeRef;
89
95
90
96
static NodeType *getEntryNode (GraphType F) { return &F->front (); }
91
97
@@ -94,9 +100,11 @@ template <> struct GraphTraits<swift::SILFunction*>
94
100
static nodes_iterator nodes_end (GraphType F) { return F->end (); }
95
101
static unsigned size (GraphType F) { return F->size (); }
96
102
};
103
+
97
104
template <> struct GraphTraits <Inverse<swift::SILFunction*> >
98
105
: public GraphTraits<Inverse<swift::SILBasicBlock*> > {
99
106
typedef Inverse<swift::SILFunction *> GraphType;
107
+ typedef NodeType *NodeRef;
100
108
101
109
static NodeType *getEntryNode (GraphType F) { return &F.Graph ->front (); }
102
110
0 commit comments