Index: src/compiler/node.cc |
diff --git a/src/compiler/node.cc b/src/compiler/node.cc |
index 670c3afbdf364dc144750080396fb4e37bac5ef5..f38f19595c742785b6d9767e4eda01f91ed0accb 100644 |
--- a/src/compiler/node.cc |
+++ b/src/compiler/node.cc |
@@ -23,6 +23,17 @@ void Node::CollectProjections(int projection_count, Node** projections) { |
} |
+Node* Node::FindProjection(int32_t projection_index) { |
+ for (UseIter i = uses().begin(); i != uses().end(); ++i) { |
+ if ((*i)->opcode() == IrOpcode::kProjection && |
+ OpParameter<int32_t>(*i) == projection_index) { |
+ return *i; |
+ } |
+ } |
+ return NULL; |
+} |
+ |
+ |
OStream& operator<<(OStream& os, const Operator& op) { return op.PrintTo(os); } |