Chromium Code Reviews| Index: src/IceCfgNode.h |
| diff --git a/src/IceCfgNode.h b/src/IceCfgNode.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..eb6f044b4fd59314caa5c00064d0bb728dbcf1da |
| --- /dev/null |
| +++ b/src/IceCfgNode.h |
| @@ -0,0 +1,54 @@ |
| +//===- 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(); |
|
JF
2014/04/16 01:27:32
What does this do?
Jim Stichnoth
2014/04/21 20:26:40
Done.
|
| + |
| + void dump(IceCfg *Cfg) const; |
| + |
| +private: |
| + IceCfgNode(IceCfg *Cfg, uint32_t LabelIndex, IceString Name); |
| + IceCfgNode(const IceCfgNode &) LLVM_DELETED_FUNCTION; |
| + IceCfgNode &operator=(const IceCfgNode &) LLVM_DELETED_FUNCTION; |
| + 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 |