Commit 26c4a9cc authored by cbruni's avatar cbruni Committed by Commit bot

[turbofan] Improve Node printing.

Review-Url: https://codereview.chromium.org/2645673004
Cr-Commit-Position: refs/heads/master@{#42518}
parent 55feaaea
......@@ -300,8 +300,27 @@ bool Node::OwnedBy(Node const* owner1, Node const* owner2) const {
void Node::Print() const {
OFStream os(stdout);
os << *this << std::endl;
for (Node* input : this->inputs()) {
os << " " << *input << std::endl;
}
}
std::ostream& operator<<(std::ostream& os, const Node& n) {
os << n.id() << ": " << *n.op();
if (n.InputCount() > 0) {
os << "(";
for (int i = 0; i < n.InputCount(); ++i) {
if (i != 0) os << ", ";
if (n.InputAt(i)) {
os << n.InputAt(i)->id();
} else {
os << "null";
}
}
os << ")";
}
return os;
}
Node::Node(NodeId id, const Operator* op, int inline_count, int inline_capacity)
: op_(op),
......@@ -378,25 +397,6 @@ void Node::Verify() {
}
#endif
std::ostream& operator<<(std::ostream& os, const Node& n) {
os << n.id() << ": " << *n.op();
if (n.InputCount() > 0) {
os << "(";
for (int i = 0; i < n.InputCount(); ++i) {
if (i != 0) os << ", ";
if (n.InputAt(i)) {
os << n.InputAt(i)->id();
} else {
os << "null";
}
}
os << ")";
}
return os;
}
Node::InputEdges::iterator Node::InputEdges::iterator::operator++(int n) {
iterator result(*this);
++(*this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment