Index: src/compiler/generic-node-inl.h |
diff --git a/src/compiler/generic-node-inl.h b/src/compiler/generic-node-inl.h |
index afbd1f0ebf2067eb35cb370c16a7b7f5eefe2aa5..13bfa6c24ffa9252146ca90c6bcb90d3155cc14f 100644 |
--- a/src/compiler/generic-node-inl.h |
+++ b/src/compiler/generic-node-inl.h |
@@ -49,6 +49,19 @@ GenericNode<B, S>::Inputs::end() { |
} |
template <class B, class S> |
+inline typename GenericNode<B, S>::InputEdges::iterator |
+GenericNode<B, S>::InputEdges::begin() { |
+ return typename GenericNode<B, S>::InputEdges::iterator(this->node_, 0); |
+} |
+ |
+template <class B, class S> |
+inline typename GenericNode<B, S>::InputEdges::iterator |
+GenericNode<B, S>::InputEdges::end() { |
+ return typename GenericNode<B, S>::InputEdges::iterator( |
+ this->node_, this->node_->InputCount()); |
+} |
+ |
+template <class B, class S> |
inline typename GenericNode<B, S>::Uses::iterator |
GenericNode<B, S>::Uses::begin() { |
return typename GenericNode<B, S>::Uses::iterator(this->node_); |
@@ -61,6 +74,18 @@ GenericNode<B, S>::Uses::end() { |
} |
template <class B, class S> |
+inline typename GenericNode<B, S>::UseEdges::iterator |
+GenericNode<B, S>::UseEdges::begin() { |
+ return typename GenericNode<B, S>::UseEdges::iterator(this->node_); |
+} |
+ |
+template <class B, class S> |
+inline typename GenericNode<B, S>::UseEdges::iterator |
+GenericNode<B, S>::UseEdges::end() { |
+ return typename GenericNode<B, S>::UseEdges::iterator(); |
+} |
+ |
+template <class B, class S> |
void GenericNode<B, S>::ReplaceUses(GenericNode* replace_to) { |
for (Use* use = first_use_; use != NULL; use = use->next) { |
use->from->GetInputRecordPtr(use->input_index)->to = replace_to; |
@@ -98,9 +123,8 @@ void GenericNode<B, S>::ReplaceUsesIf(UnaryPredicate pred, |
template <class B, class S> |
void GenericNode<B, S>::RemoveAllInputs() { |
- for (typename Inputs::iterator iter(inputs().begin()); iter != inputs().end(); |
- ++iter) { |
- iter.GetInput()->Update(NULL); |
+ for (auto edge : input_edges()) { |
+ edge.UpdateTo(NULL); |
} |
} |