diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-06-16 10:35:30 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-06-16 10:35:30 +0800 |
commit | bbb7023bee036f87b45ba0555e60ce33837460b0 (patch) | |
tree | a1e1210bee4a1da459a3be90fb67dc586e400bb5 /src/mir/cleanup.cpp | |
parent | 94015a6835ae0d050a83dee1622e1d1b6851f556 (diff) | |
download | mrust-bbb7023bee036f87b45ba0555e60ce33837460b0.tar.gz |
MIR - Unify temporaries and variables
Diffstat (limited to 'src/mir/cleanup.cpp')
-rw-r--r-- | src/mir/cleanup.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mir/cleanup.cpp b/src/mir/cleanup.cpp index 17dca948..3dda81dc 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); |