Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: src/IceOperand.cpp

Issue 794923002: Subzero: Use llvm::ilist<> for PhiList and AssignList. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceDefs.h ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/IceDefs.h ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698