| OLD | NEW |
| 1 //===- subzero/src/IceCfg.h - Control flow graph ----------------*- C++ -*-===// | 1 //===- subzero/src/IceCfg.h - Control flow graph ----------------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file declares the Cfg class, which represents the control flow | 10 // This file declares the Cfg class, which represents the control flow |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Manage nodes (a.k.a. basic blocks, CfgNodes). | 55 // Manage nodes (a.k.a. basic blocks, CfgNodes). |
| 56 void setEntryNode(CfgNode *EntryNode) { Entry = EntryNode; } | 56 void setEntryNode(CfgNode *EntryNode) { Entry = EntryNode; } |
| 57 CfgNode *getEntryNode() const { return Entry; } | 57 CfgNode *getEntryNode() const { return Entry; } |
| 58 // Create a node and append it to the end of the linearized list. | 58 // Create a node and append it to the end of the linearized list. |
| 59 CfgNode *makeNode(const IceString &Name = ""); | 59 CfgNode *makeNode(const IceString &Name = ""); |
| 60 SizeT getNumNodes() const { return Nodes.size(); } | 60 SizeT getNumNodes() const { return Nodes.size(); } |
| 61 const NodeList &getNodes() const { return Nodes; } | 61 const NodeList &getNodes() const { return Nodes; } |
| 62 | 62 |
| 63 // Manage instruction numbering. | 63 // Manage instruction numbering. |
| 64 InstNumberT newInstNumber() { return NextInstNumber++; } | 64 InstNumberT newInstNumber() { return NextInstNumber++; } |
| 65 InstNumberT getNextInstNumber() const { return NextInstNumber; } |
| 65 | 66 |
| 66 // Manage Variables. | 67 // Manage Variables. |
| 67 // Create a new Variable with a particular type and an optional | 68 // Create a new Variable with a particular type and an optional |
| 68 // name. The Node argument is the node where the variable is defined. | 69 // name. The Node argument is the node where the variable is defined. |
| 69 template <typename T> T *makeVariable(Type Ty, const IceString &Name = "") { | 70 template <typename T> T *makeVariable(Type Ty, const IceString &Name = "") { |
| 70 SizeT Index = Variables.size(); | 71 SizeT Index = Variables.size(); |
| 71 T *Var = T::create(this, Ty, Index, Name); | 72 T *Var = T::create(this, Ty, Index, Name); |
| 72 Variables.push_back(Var); | 73 Variables.push_back(Var); |
| 73 return Var; | 74 return Var; |
| 74 } | 75 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // spurious validation failures. | 188 // spurious validation failures. |
| 188 const CfgNode *CurrentNode; | 189 const CfgNode *CurrentNode; |
| 189 | 190 |
| 190 Cfg(const Cfg &) = delete; | 191 Cfg(const Cfg &) = delete; |
| 191 Cfg &operator=(const Cfg &) = delete; | 192 Cfg &operator=(const Cfg &) = delete; |
| 192 }; | 193 }; |
| 193 | 194 |
| 194 } // end of namespace Ice | 195 } // end of namespace Ice |
| 195 | 196 |
| 196 #endif // SUBZERO_SRC_ICECFG_H | 197 #endif // SUBZERO_SRC_ICECFG_H |
| OLD | NEW |