diff options
Diffstat (limited to 'src/mir/optimise.cpp')
-rw-r--r-- | src/mir/optimise.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mir/optimise.cpp b/src/mir/optimise.cpp index 0be5f88a..66260782 100644 --- a/src/mir/optimise.cpp +++ b/src/mir/optimise.cpp @@ -395,6 +395,8 @@ void MIR_Optimise(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path change_happened = true; } + // TODO: Convert `&mut *mut_foo` into `mut_foo` if the source is movable and not used afterwards + // >> Propagate/remove dead assignments while( MIR_Optimise_PropagateSingleAssignments(state, fcn) ) change_happened = true; @@ -2138,6 +2140,11 @@ bool MIR_Optimise_GarbageCollect(::MIR::TypeResolve& state, ::MIR::Function& fcn if( e->flag_idx != ~0u ) used_dfs.at(e->flag_idx) = true; } + else if( const auto* e = stmt.opt_Asm() ) + { + for(const auto& val : e->outputs) + assigned_lval(val.second); + } else if( const auto* e = stmt.opt_SetDropFlag() ) { if( e->other != ~0u ) |