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

Unified Diff: src/compiler/node.cc

Issue 2645673004: [turbofan] Improve Node printing. (Closed)
Patch Set: revert test code Created 3 years, 11 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node.cc
diff --git a/src/compiler/node.cc b/src/compiler/node.cc
index 1410ab436cef5c2ebac7786155b40e85ee0aef4f..758be07d40d6529b6316b1ea31f1a28b4e9b9559 100644
--- a/src/compiler/node.cc
+++ b/src/compiler/node.cc
@@ -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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698