Skip to content

Commit

Permalink
Sync dump.h with dump.cpp (#4896)
Browse files Browse the repository at this point in the history
* Sync dump.h with dump.cpp

Signed-off-by: Bili Dong <[email protected]>

* Re-order function definitions in dump.cpp

To be more aligned with the ordering in dump.h.

Signed-off-by: Bili Dong <[email protected]>

---------

Signed-off-by: Bili Dong <[email protected]>
  • Loading branch information
qobilidop authored Sep 3, 2024
1 parent f7c29aa commit 89dbc77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ir/dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ void dump(const IR::Node *n, unsigned maxdepth) { dump(std::cout, n, maxdepth);
void dump(const IR::Node *n) { dump(n, ~0U); }
void dump(const IR::INode *n, unsigned maxdepth) { dump(std::cout, n->getNode(), maxdepth); }
void dump(const IR::INode *n) { dump(n, ~0U); }
void dump(uintptr_t p, unsigned maxdepth) { dump(reinterpret_cast<const IR::Node *>(p), maxdepth); }
void dump(uintptr_t p) { dump(p, ~0U); }

void dump_notype(const IR::Node *n, unsigned maxdepth) {
n->apply(IRDumper(std::cout, maxdepth, "type"_cs, false));
}
Expand All @@ -92,6 +95,11 @@ void dump_notype(const IR::INode *n, unsigned maxdepth) {
n->getNode()->apply(IRDumper(std::cout, maxdepth, "type"_cs, false));
}
void dump_notype(const IR::INode *n) { dump_notype(n, ~0U); }
void dump_notype(uintptr_t p, unsigned maxdepth) {
dump_notype(reinterpret_cast<const IR::Node *>(p), maxdepth);
}
void dump_notype(uintptr_t p) { dump_notype(p, ~0U); }

void dump_src(const IR::Node *n, unsigned maxdepth) {
n->apply(IRDumper(std::cout, maxdepth, "type"_cs, true));
}
Expand All @@ -101,13 +109,6 @@ void dump_src(const IR::INode *n, unsigned maxdepth) {
}
void dump_src(const IR::INode *n) { dump_src(n, ~0U); }

void dump(uintptr_t p, unsigned maxdepth) { dump(reinterpret_cast<const IR::Node *>(p), maxdepth); }
void dump(uintptr_t p) { dump(p, ~0U); }
void dump_notype(uintptr_t p, unsigned maxdepth) {
dump_notype(reinterpret_cast<const IR::Node *>(p), maxdepth);
}
void dump_notype(uintptr_t p) { dump_notype(p, ~0U); }

void dump(std::ostream &out, const Visitor::Context *ctxt) {
if (!ctxt) return;
dump(ctxt->parent);
Expand Down
4 changes: 4 additions & 0 deletions ir/dump.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ void dump_notype(const IR::INode *n);
void dump_notype(const IR::INode *n, unsigned maxdepth);
void dump_notype(uintptr_t p);
void dump_notype(uintptr_t p, unsigned maxdepth);
void dump_src(const IR::Node *n);
void dump_src(const IR::Node *n, unsigned maxdepth);
void dump_src(const IR::INode *n);
void dump_src(const IR::INode *n, unsigned maxdepth);
void dump(std::ostream &, const Visitor::Context *);
void dump(const Visitor::Context *);

Expand Down

0 comments on commit 89dbc77

Please sign in to comment.