Index: src/IceCfgNode.h |
diff --git a/src/IceCfgNode.h b/src/IceCfgNode.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dc7828fb3c56a470b2b927886eef74dd30e94ee3 |
--- /dev/null |
+++ b/src/IceCfgNode.h |
@@ -0,0 +1,63 @@ |
+//===- 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 CfgNode 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" |
+ |
+namespace Ice { |
+ |
+class CfgNode { |
+public: |
+ static CfgNode *create(IceCfg *Cfg, IceSize_t LabelIndex, |
+ IceString Name = "") { |
+ return new (Cfg->allocate<CfgNode>()) CfgNode(Cfg, LabelIndex, Name); |
+ } |
+ |
+ // Access the label number and name for this node. |
+ IceSize_t getIndex() const { return Number; } |
+ IceString getName() const; |
+ |
+ // Access predecessor and successor edge lists. |
+ const NodeList &getInEdges() const { return InEdges; } |
+ const NodeList &getOutEdges() const { return OutEdges; } |
+ |
+ // Manage the instruction list. |
+ InstList &getInsts() { return Insts; } |
+ void appendInst(Inst *Inst); |
+ |
+ // Add a predecessor edge to the InEdges list for each of this |
+ // node's successors. |
+ void computePredecessors(); |
+ |
+ void dump(IceCfg *Cfg) const; |
+ |
+private: |
+ CfgNode(IceCfg *Cfg, IceSize_t LabelIndex, IceString Name); |
+ CfgNode(const CfgNode &) LLVM_DELETED_FUNCTION; |
+ CfgNode &operator=(const CfgNode &) LLVM_DELETED_FUNCTION; |
+ IceCfg *const Cfg; |
+ const IceSize_t Number; // label index |
+ IceString Name; // for dumping only |
+ NodeList InEdges; // in no particular order |
+ NodeList OutEdges; // in no particular order |
+ PhiList Phis; // unordered set of phi instructions |
+ InstList Insts; // ordered list of non-phi instructions |
+}; |
+ |
+} // end of namespace Ice |
+ |
+#endif // SUBZERO_SRC_ICECFGNODE_H |