Index: src/IceCfgNode.h |
diff --git a/src/IceCfgNode.h b/src/IceCfgNode.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1c3deb01d4a1aed2c157cf93abba7cdd65ca135e |
--- /dev/null |
+++ b/src/IceCfgNode.h |
@@ -0,0 +1,52 @@ |
+//===- subzero/src/IceCfgNode.h - Control flow graph node -------*- C++ -*-===// |
+// |
+// The Subzero Code Generator |
+// |
+// This file is distributed under the University of Illinois Open Source |
+// License. See LICENSE.TXT for details. |
+// |
+//===----------------------------------------------------------------------===// |
+// |
+// This file declares the IceCfgNode class, which represents a single |
+// basic block as its instruction list, in-edge list, and out-edge |
+// list. |
+// |
+//===----------------------------------------------------------------------===// |
+ |
+#ifndef SUBZERO_SRC_ICECFGNODE_H |
+#define SUBZERO_SRC_ICECFGNODE_H |
+ |
+#include "IceDefs.h" |
+ |
+class IceCfgNode { |
+public: |
+ static IceCfgNode *create(IceCfg *Cfg, uint32_t LabelIndex, |
+ IceString Name = "") { |
+ return new (Cfg->allocate<IceCfgNode>()) IceCfgNode(Cfg, LabelIndex, Name); |
+ } |
+ |
+ uint32_t getIndex() const { return Number; } |
+ IceString getName() const; |
+ |
+ const IceNodeList &getInEdges() const { return InEdges; } |
+ const IceNodeList &getOutEdges() const { return OutEdges; } |
+ |
+ IceInstList &getInsts() { return Insts; } |
+ void appendInst(IceInst *Inst); |
+ |
+ void registerEdges(); |
+ |
+ void dump(IceOstream &Str) const; |
+ |
+private: |
+ IceCfgNode(IceCfg *Cfg, uint32_t LabelIndex, IceString Name); |
+ IceCfg *const Cfg; |
+ const uint32_t Number; // label index |
+ IceString Name; // for dumping only |
+ IceNodeList InEdges; // in no particular order |
+ IceNodeList OutEdges; // in no particular order |
+ IcePhiList Phis; // unordered set of phi instructions |
+ IceInstList Insts; // ordered list of non-phi instructions |
+}; |
+ |
+#endif // SUBZERO_SRC_ICECFGNODE_H |