summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-12-29 11:15:43 +0800
committerJohn Hodge <tpg@mutabah.net>2018-12-29 11:15:43 +0800
commit024c97cfe2639d10e3c24343750aac1e37797d54 (patch)
tree326bd51581c0deee30bb4e34e1e7bcdcff4dfa88
parent5238ab2025b099f861bd2d071ed3521e7ee4e842 (diff)
downloadmrust-024c97cfe2639d10e3c24343750aac1e37797d54.tar.gz
HIR Dump - Tweak output for better readability
-rw-r--r--src/hir/dump.cpp38
1 files changed, 13 insertions, 25 deletions
diff --git a/src/hir/dump.cpp b/src/hir/dump.cpp
index e607925e..6d786a90 100644
--- a/src/hir/dump.cpp
+++ b/src/hir/dump.cpp
@@ -331,33 +331,21 @@ namespace {
void visit(::HIR::ExprNode_Block& node) override
{
- if( node.m_nodes.size() == 0 ) {
- m_os << "{";
- if( node.m_value_node )
- {
- m_os << " ";
- this->visit_node_ptr(node.m_value_node);
- }
- m_os << " }";
+ m_os << "{\n";
+ inc_indent();
+ for(auto& sn : node.m_nodes) {
+ m_os << indent();
+ this->visit_node_ptr(sn);
+ m_os << ";\n";
}
- else {
- m_os << "{\n";
- inc_indent();
- for(auto& sn : node.m_nodes) {
- m_os << "\n";
- m_os << indent();
- this->visit_node_ptr(sn);
- m_os << ";\n";
- }
- if( node.m_value_node )
- {
- m_os << indent();
- this->visit_node_ptr(node.m_value_node);
- m_os << "\n";
- }
- dec_indent();
- m_os << indent() << "}";
+ if( node.m_value_node )
+ {
+ m_os << indent();
+ this->visit_node_ptr(node.m_value_node);
+ m_os << "\n";
}
+ dec_indent();
+ m_os << indent() << "}";
}
void visit(::HIR::ExprNode_Asm& node) override