summaryrefslogtreecommitdiff
path: root/src/mir/cleanup.cpp
diff options
context:
space:
mode:
authorJohn Hodge (bugs) <tpg@mutabah.net>2017-07-06 17:41:10 +0800
committerJohn Hodge (bugs) <tpg@mutabah.net>2017-07-06 17:41:10 +0800
commit48e2c4973d5401c9f7d0ee2bac22ac6015744961 (patch)
treeb93fb21b85343633e2d0c00c42ea7a388bb6f883 /src/mir/cleanup.cpp
parentce3d36a90b9efd11c94f9084b5e727d65b6509a7 (diff)
parentc4e88b3c49736e71534c918a83956885c052beb8 (diff)
downloadmrust-48e2c4973d5401c9f7d0ee2bac22ac6015744961.tar.gz
Merge branch 'master' of https://github.com/thepowersgang/mrustc
# Conflicts: # src/trans/codegen_c.cpp
Diffstat (limited to 'src/mir/cleanup.cpp')
-rw-r--r--src/mir/cleanup.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mir/cleanup.cpp b/src/mir/cleanup.cpp
index 17dca948..f26f2bdd 100644
--- a/src/mir/cleanup.cpp
+++ b/src/mir/cleanup.cpp
@@ -32,8 +32,8 @@ struct MirMutator
::MIR::LValue new_temporary(::HIR::TypeRef ty)
{
- auto rv = ::MIR::LValue::make_Temporary({ static_cast<unsigned int>(m_fcn.temporaries.size()) });
- m_fcn.temporaries.push_back( mv$(ty) );
+ auto rv = ::MIR::LValue::make_Local( static_cast<unsigned int>(m_fcn.locals.size()) );
+ m_fcn.locals.push_back( mv$(ty) );
return rv;
}
@@ -831,15 +831,13 @@ bool MIR_Cleanup_Unsize_GetMetadata(const ::MIR::TypeResolve& state, MirMutator&
void MIR_Cleanup_LValue(const ::MIR::TypeResolve& state, MirMutator& mutator, ::MIR::LValue& lval)
{
TU_MATCHA( (lval), (le),
- (Variable,
- ),
- (Temporary,
+ (Return,
),
(Argument,
),
- (Static,
+ (Local,
),
- (Return,
+ (Static,
),
(Field,
MIR_Cleanup_LValue(state, mutator, *le.val);
@@ -1105,6 +1103,9 @@ void MIR_Cleanup(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path,
(Switch,
MIR_Cleanup_LValue(state, mutator, e.val);
),
+ (SwitchValue,
+ MIR_Cleanup_LValue(state, mutator, e.val);
+ ),
(Call,
MIR_Cleanup_LValue(state, mutator, e.ret_val);
if( e.fcn.is_Value() ) {