OLD | NEW |
1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===// | 1 //===- subzero/src/IceOperand.cpp - High-level operand 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 // This file implements the Operand class and its target-independent | 10 // This file implements the Operand class and its target-independent |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 } | 286 } |
287 | 287 |
288 for (CfgNode *Node : Func->getNodes()) | 288 for (CfgNode *Node : Func->getNodes()) |
289 addNode(Node); | 289 addNode(Node); |
290 } | 290 } |
291 | 291 |
292 void VariablesMetadata::addNode(CfgNode *Node) { | 292 void VariablesMetadata::addNode(CfgNode *Node) { |
293 if (Func->getNumVariables() >= Metadata.size()) | 293 if (Func->getNumVariables() >= Metadata.size()) |
294 Metadata.resize(Func->getNumVariables()); | 294 Metadata.resize(Func->getNumVariables()); |
295 | 295 |
296 for (InstPhi *I : Node->getPhis()) { | 296 for (auto I = Node->getPhis().begin(), E = Node->getPhis().end(); I != E; |
| 297 ++I) { |
297 if (I->isDeleted()) | 298 if (I->isDeleted()) |
298 continue; | 299 continue; |
299 if (Variable *Dest = I->getDest()) { | 300 if (Variable *Dest = I->getDest()) { |
300 SizeT DestNum = Dest->getIndex(); | 301 SizeT DestNum = Dest->getIndex(); |
301 assert(DestNum < Metadata.size()); | 302 assert(DestNum < Metadata.size()); |
302 Metadata[DestNum].markDef(Kind, I, Node); | 303 Metadata[DestNum].markDef(Kind, I, Node); |
303 } | 304 } |
304 for (SizeT SrcNum = 0; SrcNum < I->getSrcSize(); ++SrcNum) { | 305 for (SizeT SrcNum = 0; SrcNum < I->getSrcSize(); ++SrcNum) { |
305 if (const Variable *Var = llvm::dyn_cast<Variable>(I->getSrc(SrcNum))) { | 306 if (const Variable *Var = llvm::dyn_cast<Variable>(I->getSrc(SrcNum))) { |
306 SizeT VarNum = Var->getIndex(); | 307 SizeT VarNum = Var->getIndex(); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 if (!ALLOW_DUMP) | 490 if (!ALLOW_DUMP) |
490 return Str; | 491 return Str; |
491 if (W.getWeight() == RegWeight::Inf) | 492 if (W.getWeight() == RegWeight::Inf) |
492 Str << "Inf"; | 493 Str << "Inf"; |
493 else | 494 else |
494 Str << W.getWeight(); | 495 Str << W.getWeight(); |
495 return Str; | 496 return Str; |
496 } | 497 } |
497 | 498 |
498 } // end of namespace Ice | 499 } // end of namespace Ice |
OLD | NEW |