17 const rvsdg::Region * region,
19 std::unordered_map<const Output *, std::string> &);
24 return std::string(depth * 2,
' ');
30 std::unordered_map<const Output *, std::string> & map)
41 std::unordered_map<const Output *, std::string> & map)
43 std::string s(
indent(depth));
44 for (
size_t n = 0; n < node->
noutputs(); n++)
47 map[node->
output(n)] = name;
53 for (
size_t n = 0; n < node->
ninputs(); n++)
63 for (
size_t n = 0; n < snode->nsubregions(); n++)
73 std::string header(
"[");
74 for (
size_t n = 0; n < region->
narguments(); n++)
78 map[argument] = pname;
81 if (argument->input())
84 if (n < region->narguments() - 1)
96 std::unordered_map<const Output *, std::string> & map)
110 std::string footer(
"}[");
111 for (
size_t n = 0; n < region->
nresults(); n++)
113 auto result = region->
result(n);
114 auto pname = map[result->origin()];
116 if (result->output())
117 footer += map[result->output()] +
" <= ";
120 if (n < region->nresults() - 1)
132 std::unordered_map<const Output *, std::string> & map)
144 std::unordered_map<const Output *, std::string> map;
145 return view(region, map);
157 fputs(
view(region).c_str(), out);
virtual std::string DebugString() const =0
NodeInput * input(size_t index) const noexcept
NodeOutput * output(size_t index) const noexcept
size_t ninputs() const noexcept
size_t noutputs() const noexcept
Represents the argument of a region.
Represent acyclic RVSDG subgraphs.
RegionResult * result(size_t index) const noexcept
size_t nresults() const noexcept
RegionArgument * argument(size_t index) const noexcept
size_t narguments() const noexcept
static std::string region_header(const rvsdg::Region *region, std::unordered_map< const Output *, std::string > &map)
static std::string indent(size_t depth)
static std::string node_to_string(const Node *node, size_t depth, std::unordered_map< const Output *, std::string > &map)
static std::string region_footer(const rvsdg::Region *region, std::unordered_map< const Output *, std::string > &map)
static std::string region_to_string(const rvsdg::Region *region, size_t depth, std::unordered_map< const Output *, std::string > &)
detail::TopDownTraverserGeneric< true > TopDownConstTraverser
Traverser for visiting every node in a const region in a top down order.
std::string view(const rvsdg::Region *region)
static std::string region_body(const Region *region, const size_t depth, std::unordered_map< const Output *, std::string > &map)
size_t ninputs(const rvsdg::Region *region) noexcept
static std::string create_port_name(const jlm::rvsdg::Output *port, std::unordered_map< const Output *, std::string > &map)
static std::string strfmt(Args... args)