/* * MRustC - Rust Compiler * - By John Hodge (Mutabah/thePowersGang) * * mir/mir.cpp * - MIR (Middle Intermediate Representation) definitions */ #include ::MIR::LValue MIR::LValue::clone() const { TU_MATCHA( (*this), (e), (Variable, return LValue(e); ), (Temporary, return LValue(e); ), (Argument, return LValue(e); ), (Static, return LValue(e.clone()); ), (Return, return LValue(e); ), (Field, return LValue::make_Field({ box$( e.val->clone() ), e.field_index }); ), (Deref, return LValue::make_Deref({ box$( e.val->clone() ) }); ), (Index, return LValue::make_Index({ box$( e.val->clone() ), box$( e.idx->clone() ) }); ), (Downcast, return LValue::make_Downcast({ box$( e.val->clone() ), e.variant_index }); ) ) throw ""; }