OLD | NEW |
---|---|
(Empty) | |
1 //===- subzero/src/IceCfgNode.h - Control flow graph node -------*- C++ -*-===// | |
2 // | |
3 // The Subzero Code Generator | |
4 // | |
5 // This file is distributed under the University of Illinois Open Source | |
6 // License. See LICENSE.TXT for details. | |
7 // | |
8 //===----------------------------------------------------------------------===// | |
9 // | |
10 // This file declares the IceCfgNode class, which represents a single | |
11 // basic block as its instruction list, in-edge list, and out-edge | |
12 // list. | |
13 // | |
14 //===----------------------------------------------------------------------===// | |
15 | |
16 #ifndef SUBZERO_SRC_ICECFGNODE_H | |
17 #define SUBZERO_SRC_ICECFGNODE_H | |
18 | |
19 #include "IceDefs.h" | |
20 | |
21 class IceCfgNode { | |
22 public: | |
23 static IceCfgNode *create(IceCfg *Cfg, uint32_t LabelIndex, | |
24 IceString Name = "") { | |
25 return new IceCfgNode(Cfg, LabelIndex, Name); | |
jvoung (off chromium)
2014/03/28 23:21:53
should this new() use the cfg allocator too?
Jim Stichnoth
2014/03/29 14:23:22
Done, also in IceVariable. I'm leaving the IceCon
| |
26 } | |
27 | |
28 uint32_t getIndex() const { return Number; } | |
29 IceString getName() const; | |
30 | |
31 const IceNodeList &getInEdges() const { return InEdges; } | |
32 const IceNodeList &getOutEdges() const { return OutEdges; } | |
33 | |
34 IceInstList &getInsts() { return Insts; } | |
35 void appendInst(IceInst *Inst); | |
36 | |
37 void registerEdges(); | |
38 | |
39 void dump(IceOstream &Str) const; | |
40 | |
41 private: | |
42 IceCfgNode(IceCfg *Cfg, uint32_t LabelIndex, IceString Name); | |
43 IceCfg *const Cfg; | |
44 const uint32_t Number; // label index | |
45 IceString Name; // for dumping only | |
46 IceNodeList InEdges; // in no particular order | |
47 IceNodeList OutEdges; // in no particular order | |
48 IcePhiList Phis; // unordered set of phi instructions | |
49 IceInstList Insts; // ordered list of non-phi instructions | |
50 }; | |
51 | |
52 #endif // SUBZERO_SRC_ICECFGNODE_H | |
OLD | NEW |