MLIR: include/mlir/IR/RegionGraphTraits.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef MLIR_IR_REGIONGRAPHTRAITS_H
16 #define MLIR_IR_REGIONGRAPHTRAITS_H
17
19 #include "llvm/ADT/GraphTraits.h"
20
21 namespace llvm {
22 template <>
23 struct GraphTraits<mlir::Block *> {
27
29
32 }
34 };
35
36 template <>
37 struct GraphTraits<Inverse<mlir::Block *>> {
42 return inverseGraph.Graph;
43 }
46 }
49 }
50 };
51
52 template <>
53 struct GraphTraits<const mlir::Block *> {
57
59
61 return const_cast<mlir::Block *>(node)->succ_begin();
62 }
64 return const_cast<mlir::Block *>(node)->succ_end();
65 }
66 };
67
68 template <>
69 struct GraphTraits<Inverse<const mlir::Block *>> {
73
75 return inverseGraph.Graph;
76 }
77
79 return const_cast<mlir::Block *>(node)->pred_begin();
80 }
82 return const_cast<mlir::Block *>(node)->pred_end();
83 }
84 };
85
86 template <>
87 struct GraphTraits<mlir::Region *> : public GraphTraits<mlir::Block *> {
90
92
93 using nodes_iterator = pointer_iteratormlir::Region::iterator;
96 }
99 }
100 };
101
102 template <>
103 struct GraphTraits<Inverse<mlir::Region *>>
104 : public GraphTraits<Inverse<mlir::Block *>> {
107
109
113 }
116 }
117 };
118
119 }
120
121 #endif
Block represents an ordered list of Operations.
SuccessorRange::iterator succ_iterator
pred_iterator pred_begin()
succ_iterator succ_begin()
PredecessorIterator pred_iterator
Implement a predecessor iterator for blocks.
This class contains a list of basic blocks and a link to the parent operation it is attached to.
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Include the generated interface declarations.
static ChildIteratorType child_begin(NodeRef node)
static NodeRef getEntryNode(Inverse< NodeRef > inverseGraph)
static ChildIteratorType child_end(NodeRef node)
static ChildIteratorType child_end(NodeRef node)
static NodeRef getEntryNode(Inverse< NodeRef > inverseGraph)
static ChildIteratorType child_begin(NodeRef node)
static NodeRef getEntryNode(GraphType fn)
Inverse< mlir::Region * > GraphType
static nodes_iterator nodes_begin(GraphType fn)
static nodes_iterator nodes_end(GraphType fn)
pointer_iterator< mlir::Region::iterator > nodes_iterator
static ChildIteratorType child_begin(NodeRef node)
mlir::Block::succ_iterator ChildIteratorType
static NodeRef getEntryNode(NodeRef node)
static ChildIteratorType child_end(NodeRef node)
static ChildIteratorType child_end(NodeRef node)
mlir::Block::succ_iterator ChildIteratorType
static ChildIteratorType child_begin(NodeRef node)
static NodeRef getEntryNode(NodeRef bb)
static NodeRef getEntryNode(GraphType fn)
static nodes_iterator nodes_begin(GraphType fn)
pointer_iterator< mlir::Region::iterator > nodes_iterator
static nodes_iterator nodes_end(GraphType fn)