| 1097 | } |
| 1098 | |
| 1099 | void program::print_graph(std::ostream& os, bool brief) const |
| 1100 | { |
| 1101 | const auto* mm = this->get_main_module(); |
| 1102 | |
| 1103 | os << "digraph {\n\tperipheries=0;\n"; |
| 1104 | |
| 1105 | mm->print([&](auto ins, auto ins_names) { |
| 1106 | const auto& ins_name = graphviz::enclose_name(ins_names.at(ins)); |
| 1107 | |
| 1108 | os << "\t" << ins_name << "["; |
| 1109 | |
| 1110 | if(brief) |
| 1111 | { |
| 1112 | |
| 1113 | os << "label=" << graphviz::enclose_name(ins->name()) << "]"; |
| 1114 | os << ";" << std::endl; |
| 1115 | } |
| 1116 | else |
| 1117 | { |
| 1118 | graphviz::graphviz_node_content content = graphviz::get_node_content(ins); |
| 1119 | os << "label=" << graphviz::build_html_label(content) << " "; |
| 1120 | os << graphviz::build_node_style(content.node_style); |
| 1121 | os << "];\n"; |
| 1122 | } |
| 1123 | |
| 1124 | if(not ins->inputs().empty()) |
| 1125 | { |
| 1126 | for(auto&& arg : ins->inputs()) |
| 1127 | { |
| 1128 | os << "\t" << graphviz::enclose_name(ins_names.at(arg)) << " -> " |
| 1129 | << graphviz::enclose_name(ins_names.at(ins)); |
| 1130 | if(not brief) |
| 1131 | os << "[label=" |
| 1132 | << graphviz::enclose_name(graphviz::format_shape_name(ins->get_shape())) |
| 1133 | << "]"; |
| 1134 | os << ";\n"; |
| 1135 | } |
| 1136 | } |
| 1137 | }); |
| 1138 | |
| 1139 | os << "}" << std::endl; |
| 1140 | } |
| 1141 | |
| 1142 | void program::print_py(std::ostream& os) const |
| 1143 | { |
nothing calls this directly
no test coverage detected