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 /// \file | 10 /// \file |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 /// @} | 83 /// @} |
84 | 84 |
85 /// \name Manage nodes (a.k.a. basic blocks, CfgNodes). | 85 /// \name Manage nodes (a.k.a. basic blocks, CfgNodes). |
86 /// @{ | 86 /// @{ |
87 void setEntryNode(CfgNode *EntryNode) { Entry = EntryNode; } | 87 void setEntryNode(CfgNode *EntryNode) { Entry = EntryNode; } |
88 CfgNode *getEntryNode() const { return Entry; } | 88 CfgNode *getEntryNode() const { return Entry; } |
89 /// Create a node and append it to the end of the linearized list. | 89 /// Create a node and append it to the end of the linearized list. |
90 CfgNode *makeNode(); | 90 CfgNode *makeNode(); |
91 SizeT getNumNodes() const { return Nodes.size(); } | 91 SizeT getNumNodes() const { return Nodes.size(); } |
92 const NodeList &getNodes() const { return Nodes; } | 92 const NodeList &getNodes() const { return Nodes; } |
| 93 /// Swap nodes of Cfg with given list of nodes. |
| 94 void swapNodes(NodeList &NewNodes); |
93 /// @} | 95 /// @} |
94 | 96 |
95 typedef int32_t IdentifierIndexType; | 97 typedef int32_t IdentifierIndexType; |
96 /// Adds a name to the list and returns its index, suitable for the | 98 /// Adds a name to the list and returns its index, suitable for the |
97 /// argument to getIdentifierName(). No checking for duplicates is | 99 /// argument to getIdentifierName(). No checking for duplicates is |
98 /// done. This is generally used for node names and variable names | 100 /// done. This is generally used for node names and variable names |
99 /// to avoid embedding a std::string inside an arena-allocated | 101 /// to avoid embedding a std::string inside an arena-allocated |
100 /// object. | 102 /// object. |
101 IdentifierIndexType addIdentifierName(const IceString &Name) { | 103 IdentifierIndexType addIdentifierName(const IceString &Name) { |
102 IdentifierIndexType Index = IdentifierNames.size(); | 104 IdentifierIndexType Index = IdentifierNames.size(); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 /// other uses are possible. | 283 /// other uses are possible. |
282 ICE_TLS_DECLARE_FIELD(const Cfg *, CurrentCfg); | 284 ICE_TLS_DECLARE_FIELD(const Cfg *, CurrentCfg); |
283 | 285 |
284 public: | 286 public: |
285 static void TlsInit() { ICE_TLS_INIT_FIELD(CurrentCfg); } | 287 static void TlsInit() { ICE_TLS_INIT_FIELD(CurrentCfg); } |
286 }; | 288 }; |
287 | 289 |
288 } // end of namespace Ice | 290 } // end of namespace Ice |
289 | 291 |
290 #endif // SUBZERO_SRC_ICECFG_H | 292 #endif // SUBZERO_SRC_ICECFG_H |
OLD | NEW |