summaryrefslogtreecommitdiff
path: root/src/mir/from_hir.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-24 11:31:57 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-24 11:31:57 +0800
commit280af9e9346bfd78a0c6f2fdd817f808a74363f2 (patch)
tree0d02073e540731e977fdd17df0a6d8ea4a9e0400 /src/mir/from_hir.cpp
parent62a2bde2e87b4ac0789848b5b9ec54e91de15238 (diff)
downloadmrust-280af9e9346bfd78a0c6f2fdd817f808a74363f2.tar.gz
MIR Gen - Move variable states to function state (instead of scope)
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r--src/mir/from_hir.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp
index 481c1294..33104822 100644
--- a/src/mir/from_hir.cpp
+++ b/src/mir/from_hir.cpp
@@ -235,8 +235,7 @@ namespace {
if( node.m_nodes.size() > 0 )
{
bool res_valid;
- //::MIR::RValue res;
- auto res = m_builder.new_temporary( node.m_res_type );
+ ::MIR::RValue res;
auto scope = m_builder.new_scope_var(node.span());
@@ -267,8 +266,8 @@ namespace {
auto stmt_scope = m_builder.new_scope_temp(sp);
this->visit_node_ptr(subnode);
if( m_builder.has_result() || m_builder.block_active() ) {
- //res = m_builder.get_result(sp);
- m_builder.push_stmt_assign( sp, res.clone(), m_builder.get_result(sp) );
+ // PROBLEM:
+ res = m_builder.get_result(sp);
m_builder.terminate_scope(sp, mv$(stmt_scope));
res_valid = true;
}