summaryrefslogtreecommitdiff
path: root/src/mir/dump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir/dump.cpp')
-rw-r--r--src/mir/dump.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/mir/dump.cpp b/src/mir/dump.cpp
index b4177295..4e53cf5b 100644
--- a/src/mir/dump.cpp
+++ b/src/mir/dump.cpp
@@ -25,13 +25,9 @@ namespace {
void dump_mir(const ::MIR::Function& fcn)
{
- for(unsigned int i = 0; i < fcn.named_variables.size(); i ++)
+ for(size_t i = 0; i < fcn.locals.size(); i ++)
{
- m_os << indent() << "let _#" << i << ": " << fcn.named_variables[i] << ";\n";
- }
- for(unsigned int i = 0; i < fcn.temporaries.size(); i ++)
- {
- m_os << indent() << "let tmp$" << i << ": " << fcn.temporaries[i] << ";\n";
+ m_os << indent() << "let _$" << i << ": " << fcn.locals[i] << ";\n";
}
for(unsigned int i = 0; i < fcn.drop_flags.size(); i ++)
{
@@ -102,10 +98,8 @@ namespace {
),
(ScopeEnd,
m_os << "// Scope End: ";
- for(auto idx : e.vars)
- m_os << "var$" << idx << ",";
- for(auto idx : e.tmps)
- m_os << "tmp$" << idx << ",";
+ for(auto idx : e.slots)
+ m_os << "_$" << idx << ",";
m_os << "\n";
)
)
@@ -165,21 +159,18 @@ namespace {
}
void fmt_val(::std::ostream& os, const ::MIR::LValue& lval) {
TU_MATCHA( (lval), (e),
- (Variable,
- os << "_#" << e;
- ),
- (Temporary,
- os << "tmp$" << e.idx;
+ (Return,
+ os << "RETURN";
),
(Argument,
os << "arg$" << e.idx;
),
+ (Local,
+ os << "_$" << e;
+ ),
(Static,
os << e;
),
- (Return,
- os << "RETURN";
- ),
(Field,
os << "(";
fmt_val(os, *e.val);