pub fn local_index(&self, lvalue: &Lvalue<'tcx>) -> Option<Local> {
        let idx = match *lvalue {
            Lvalue::Arg(arg) => arg.index(),
            Lvalue::Var(var) => {
                self.arg_decls.len() +
                var.index()
            }
            Lvalue::Temp(temp) => {
                self.arg_decls.len() +
                self.var_decls.len() +
                temp.index()
            }
            Lvalue::ReturnPointer => {
                self.arg_decls.len() +
                self.var_decls.len() +
                self.temp_decls.len()
            }
            Lvalue::Static(_) |
            Lvalue::Projection(_) => return None
        };
        Some(Local::new(idx))
    }
/// Maps locals (Arg's, Var's, Temp's and ReturnPointer, in that order)
/// to their index in the whole list of locals. This is useful if you
/// want to treat all locals the same instead of repeating yourself.
Maps locals (Arg's, Var's, Temp's and ReturnPointer, in that order)
to their index in the whole list of locals. This is useful if you
want to treat all locals the same instead of repeating yourself.
Maps locals ( Arg ' s Var ' s Temp ' s and ReturnPointer in that order ) to their index in the whole list of locals . This is useful if you want to treat all locals the same instead of repeating yourself .
pub fn local_index(&self, lvalue: &Lvalue<'tcx>) -> Option<Local> {
        let idx = match *lvalue {
            Lvalue::Arg(arg) => arg.index(),
            Lvalue::Var(var) => {
                self.arg_decls.len() +
                var.index()
            }
            Lvalue::Temp(temp) => {
                self.arg_decls.len() +
                self.var_decls.len() +
                temp.index()
            }
            Lvalue::ReturnPointer => {
                self.arg_decls.len() +
                self.var_decls.len() +
                self.temp_decls.len()
            }
            Lvalue::Static(_) |
            Lvalue::Projection(_) => return None
        };
        Some(Local::new(idx))
    }
pub fn local_index ( & self , lvalue : & Lvalue < ' tcx > ) -> Option < Local > { let idx = match * lvalue { Lvalue :: Arg ( arg ) => arg . index ( ) , Lvalue :: Var ( var ) => { self . arg_decls . len ( ) + var . index ( ) } Lvalue :: Temp ( temp ) => { self . arg_decls . len ( ) + self . var_decls . len ( ) + temp . index ( ) } Lvalue :: ReturnPointer => { self . arg_decls . len ( ) + self . var_decls . len ( ) + self . temp_decls . len ( ) } Lvalue :: Static ( _ ) | Lvalue :: Projection ( _ ) => return None } ; Some ( Local :: new ( idx ) ) }
Maps locals (Arg's, Var's, Temp's and ReturnPointer, in that order)
to their index in the whole list of locals.
Maps locals ( Arg ' s Var ' s Temp ' s and ReturnPointer in that order ) to their index in the whole list of locals .
&self
lvalue
&Lvalue<'tcx>
&self
lvalue
&Lvalue<'tcx>