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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 return Node; | 68 return Node; |
69 } | 69 } |
70 | 70 |
71 void Cfg::swapNodes(NodeList &NewNodes) { | 71 void Cfg::swapNodes(NodeList &NewNodes) { |
72 assert(Nodes.size() == NewNodes.size()); | 72 assert(Nodes.size() == NewNodes.size()); |
73 Nodes.swap(NewNodes); | 73 Nodes.swap(NewNodes); |
74 for (SizeT I = 0, NumNodes = getNumNodes(); I < NumNodes; ++I) | 74 for (SizeT I = 0, NumNodes = getNumNodes(); I < NumNodes; ++I) |
75 Nodes[I]->resetIndex(I); | 75 Nodes[I]->resetIndex(I); |
76 } | 76 } |
77 | 77 |
78 template <> | 78 template <> Variable *Cfg::makeVariable<Variable>(Type Ty) { |
79 Variable *Cfg::makeVariable<Variable>(Type Ty) { | |
80 SizeT Index = Variables.size(); | 79 SizeT Index = Variables.size(); |
81 Variable *Var = Target->shouldSplitToVariable64On32(Ty) | 80 Variable *Var = Target->shouldSplitToVariable64On32(Ty) |
82 ? Variable64On32::create(this, Ty, Index) | 81 ? Variable64On32::create(this, Ty, Index) |
83 : Variable::create(this, Ty, Index); | 82 : Variable::create(this, Ty, Index); |
84 Variables.push_back(Var); | 83 Variables.push_back(Var); |
85 return Var; | 84 return Var; |
86 } | 85 } |
87 | 86 |
88 void Cfg::addArg(Variable *Arg) { | 87 void Cfg::addArg(Variable *Arg) { |
89 Arg->setIsArg(); | 88 Arg->setIsArg(); |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 } | 787 } |
789 } | 788 } |
790 // Print each basic block | 789 // Print each basic block |
791 for (CfgNode *Node : Nodes) | 790 for (CfgNode *Node : Nodes) |
792 Node->dump(this); | 791 Node->dump(this); |
793 if (isVerbose(IceV_Instructions)) | 792 if (isVerbose(IceV_Instructions)) |
794 Str << "}\n"; | 793 Str << "}\n"; |
795 } | 794 } |
796 | 795 |
797 } // end of namespace Ice | 796 } // end of namespace Ice |
OLD | NEW |