未验证 提交 485c515d 编写于 作者: X xingmingyyj 提交者: GitHub

fix_ir_printer (#54927)

* fix_ir_printer

* Update ir_printer.cc
上级 e2009545
...@@ -78,7 +78,7 @@ void BasicIrPrinter::PrintType(Type type) { ...@@ -78,7 +78,7 @@ void BasicIrPrinter::PrintType(Type type) {
} }
} }
void BasicIrPrinter::PrintAttribute(const Attribute& attr) { void BasicIrPrinter::PrintAttribute(Attribute attr) {
if (!attr) { if (!attr) {
os << "<#AttrNull>"; os << "<#AttrNull>";
return; return;
...@@ -119,15 +119,7 @@ void IrPrinter::PrintProgram(Program* program) { ...@@ -119,15 +119,7 @@ void IrPrinter::PrintProgram(Program* program) {
auto top_level_op = program->module_op(); auto top_level_op = program->module_op();
for (size_t i = 0; i < top_level_op->num_regions(); ++i) { for (size_t i = 0; i < top_level_op->num_regions(); ++i) {
auto& region = top_level_op->region(i); auto& region = top_level_op->region(i);
for (auto it = region.begin(); it != region.end(); ++it) { PrintRegion(region);
auto* block = *it;
os << "{\n";
for (auto it = block->begin(); it != block->end(); ++it) {
PrintOperation(*it);
os << newline;
}
os << "}\n";
}
} }
} }
......
...@@ -34,7 +34,7 @@ class BasicIrPrinter { ...@@ -34,7 +34,7 @@ class BasicIrPrinter {
void PrintType(Type type); void PrintType(Type type);
void PrintAttribute(const Attribute& attr); void PrintAttribute(Attribute attr);
public: public:
std::ostream& os; std::ostream& os;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册