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

Unified Diff: src/compiler/change-lowering.cc

Issue 765983002: Clean up node iteration (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix windows build 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/control-reducer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/change-lowering.cc
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc
index a4e081a58d6481d39aa0f082353bd856eb5cdbdd..c5cdc27feaa1852116ce2355132d7e12d26908b5 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -199,9 +199,9 @@ namespace {
bool CanCover(Node* value, IrOpcode::Value opcode) {
if (value->opcode() != opcode) return false;
bool first = true;
- for (auto i = value->uses().begin(); i != value->uses().end(); ++i) {
- if (NodeProperties::IsEffectEdge(i.edge())) continue;
- DCHECK(NodeProperties::IsValueEdge(i.edge()));
+ for (Edge const edge : value->use_edges()) {
+ if (NodeProperties::IsEffectEdge(edge)) continue;
+ DCHECK(NodeProperties::IsValueEdge(edge));
if (!first) return false;
first = false;
}
@@ -236,11 +236,9 @@ Reduction ChangeLowering::ChangeTaggedToFloat64(Node* value, Node* control) {
Node* phi1 = d1.Phi(kMachFloat64, phi2, ChangeSmiToFloat64(object));
Node* ephi1 = d1.EffectPhi(number, effect);
- for (auto i = value->uses().begin(); i != value->uses().end();) {
- if (NodeProperties::IsEffectEdge(i.edge())) {
- i.UpdateToAndIncrement(ephi1);
- } else {
- ++i;
+ for (Edge edge : value->use_edges()) {
+ if (NodeProperties::IsEffectEdge(edge)) {
+ edge.UpdateTo(ephi1);
}
}
return Replace(phi1);
« no previous file with comments | « no previous file | src/compiler/control-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698