diff options
author | John Hodge <tpg@mutabah.net> | 2017-01-21 23:22:55 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2017-01-21 23:22:55 +0800 |
commit | e3d8b81e86a6d22f4768f2086a32d99bf34d3c52 (patch) | |
tree | 0eaff84ece803378adb548bb58124176b61b1600 /src/mir/dump.cpp | |
parent | f3fc3bbcd5d184ce899fa2fba64f38cd6e4ba9b9 (diff) | |
download | mrust-e3d8b81e86a6d22f4768f2086a32d99bf34d3c52.tar.gz |
MIR Dump - Include statics
Diffstat (limited to 'src/mir/dump.cpp')
-rw-r--r-- | src/mir/dump.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mir/dump.cpp b/src/mir/dump.cpp index 3e688170..89760ddc 100644 --- a/src/mir/dump.cpp +++ b/src/mir/dump.cpp @@ -133,6 +133,30 @@ namespace { m_os << indent() << " ;\n"; } } + void visit_static(::HIR::ItemPath p, ::HIR::Static& item) override + { + m_os << indent(); + m_os << "static "; + if( m_short_item_name ) + m_os << p.get_name(); + else + m_os << p; + m_os << ": " << item.m_type; + if( item.m_value ) + { + inc_indent(); + m_os << "= {\n"; + inc_indent(); + this->dump_mir(*item.m_value.m_mir); + dec_indent(); + m_os << indent() << "} /* = " << item.m_value_res << "*/;\n"; + dec_indent(); + } + else + { + m_os << ";\n"; + } + } void dump_mir(const ::MIR::Function& fcn) |