| OLD | NEW |
| 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// | 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// |
| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } | 304 } |
| 305 Target->regAlloc(RAK_Phi); | 305 Target->regAlloc(RAK_Phi); |
| 306 } | 306 } |
| 307 | 307 |
| 308 // Find a reasonable placement for nodes that have not yet been | 308 // Find a reasonable placement for nodes that have not yet been |
| 309 // placed, while maintaining the same relative ordering among already | 309 // placed, while maintaining the same relative ordering among already |
| 310 // placed nodes. | 310 // placed nodes. |
| 311 void Cfg::reorderNodes() { | 311 void Cfg::reorderNodes() { |
| 312 // TODO(ascull): it would be nice if the switch tests were always followed | 312 // TODO(ascull): it would be nice if the switch tests were always followed |
| 313 // by the default case to allow for fall through. | 313 // by the default case to allow for fall through. |
| 314 typedef std::list<CfgNode *> PlacedList; | 314 using PlacedList = std::list<CfgNode *>; |
| 315 PlacedList Placed; // Nodes with relative placement locked down | 315 PlacedList Placed; // Nodes with relative placement locked down |
| 316 PlacedList Unreachable; // Unreachable nodes | 316 PlacedList Unreachable; // Unreachable nodes |
| 317 PlacedList::iterator NoPlace = Placed.end(); | 317 PlacedList::iterator NoPlace = Placed.end(); |
| 318 // Keep track of where each node has been tentatively placed so that | 318 // Keep track of where each node has been tentatively placed so that |
| 319 // we can manage insertions into the middle. | 319 // we can manage insertions into the middle. |
| 320 std::vector<PlacedList::iterator> PlaceIndex(Nodes.size(), NoPlace); | 320 std::vector<PlacedList::iterator> PlaceIndex(Nodes.size(), NoPlace); |
| 321 for (CfgNode *Node : Nodes) { | 321 for (CfgNode *Node : Nodes) { |
| 322 // The "do ... while(0);" construct is to factor out the | 322 // The "do ... while(0);" construct is to factor out the |
| 323 // --PlaceIndex and assert() statements before moving to the next | 323 // --PlaceIndex and assert() statements before moving to the next |
| 324 // node. | 324 // node. |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 } | 773 } |
| 774 } | 774 } |
| 775 // Print each basic block | 775 // Print each basic block |
| 776 for (CfgNode *Node : Nodes) | 776 for (CfgNode *Node : Nodes) |
| 777 Node->dump(this); | 777 Node->dump(this); |
| 778 if (isVerbose(IceV_Instructions)) | 778 if (isVerbose(IceV_Instructions)) |
| 779 Str << "}\n"; | 779 Str << "}\n"; |
| 780 } | 780 } |
| 781 | 781 |
| 782 } // end of namespace Ice | 782 } // end of namespace Ice |
| OLD | NEW |