summaryrefslogtreecommitdiff
path: root/src/mir/mir_builder.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-12-25 17:19:06 +1100
committerJohn Hodge <tpg@mutabah.net>2016-12-25 17:19:06 +1100
commit27b0292ca6828eed7e782a57ad4d641f0ebf7357 (patch)
treed453c1936058b6a4be061a3b418abe0fc80cecbb /src/mir/mir_builder.cpp
parent9c7978323aaf7b1c9f9840b7665f43b59f4de282 (diff)
downloadmrust-27b0292ca6828eed7e782a57ad4d641f0ebf7357.tar.gz
MIR Gen - Misc fixes for drop order quirks
Diffstat (limited to 'src/mir/mir_builder.cpp')
-rw-r--r--src/mir/mir_builder.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mir/mir_builder.cpp b/src/mir/mir_builder.cpp
index 2300a207..43a36060 100644
--- a/src/mir/mir_builder.cpp
+++ b/src/mir/mir_builder.cpp
@@ -263,6 +263,7 @@ void MirBuilder::push_stmt_drop(const Span& sp, ::MIR::LValue val)
return ;
}
+ DEBUG("DROP " << val);
m_output.blocks.at(m_current_block).statements.push_back( ::MIR::Statement::make_Drop({ ::MIR::eDropKind::DEEP, mv$(val) }) );
}
void MirBuilder::push_stmt_drop_shallow(const Span& sp, ::MIR::LValue val)
@@ -276,6 +277,7 @@ void MirBuilder::push_stmt_drop_shallow(const Span& sp, ::MIR::LValue val)
// return ;
//}
+ DEBUG("DROP shallow " << val);
m_output.blocks.at(m_current_block).statements.push_back( ::MIR::Statement::make_Drop({ ::MIR::eDropKind::SHALLOW, mv$(val) }) );
}
@@ -349,6 +351,9 @@ void MirBuilder::raise_variables(const Span& sp, const ::MIR::LValue& val)
(Field,
raise_variables(sp, *e.val);
),
+ (Downcast,
+ raise_variables(sp, *e.val);
+ ),
// Actual value types
(Variable,
auto idx = e;
@@ -824,6 +829,7 @@ void MirBuilder::complete_scope(ScopeDef& sd)
DEBUG(i << " (_,"<<new_state<<")");
m_changed[i] = true;
m_new_states[i] = new_state;
+ // TODO: Store the original state for comparison?
}
else
{