pub fn sequential_layout(tys: &Vec<P<MuType>>, vm: &VM) -> (ByteSize, ByteSize, Vec<ByteSize>) {
        let mut offsets: Vec<ByteSize> = vec![];
        let mut cur: ByteSize = 0;
        let mut struct_align: ByteSize = 1;

        for ty in tys.iter() {
            let ty_info = vm.get_backend_type_info(ty.id());
            trace!("examining field: {}, {:?}", ty, ty_info);

            let align = ty_info.alignment;
            struct_align = lcm(struct_align, align);
            cur = align_up(cur, align);
            offsets.push(cur);
            trace!("aligned to {}", cur);

            cur += ty_info.size;
        }

        // if we need padding at the end
        let size = align_up(cur, struct_align);

        (size, struct_align, offsets)
    }
/// sequentially layout a few Mu types as if they are fields in a struct.
/// Returns a triple of (size, alignment, offsets of each type)
/// (when dealing with call convention, we use this function to layout stack arguments)
sequentially layout a few Mu types as if they are fields in a struct.
Returns a triple of (size, alignment, offsets of each type)
(when dealing with call convention, we use this function to layout stack arguments)
sequentially layout a few Mu types as if they are fields in a struct . Returns a triple of ( size alignment offsets of each type ) ( when dealing with call convention we use this function to layout stack arguments )
pub fn sequential_layout(tys: &Vec<P<MuType>>, vm: &VM) -> (ByteSize, ByteSize, Vec<ByteSize>) {
        let mut offsets: Vec<ByteSize> = vec![];
        let mut cur: ByteSize = 0;
        let mut struct_align: ByteSize = 1;
        for ty in tys.iter() {
            let ty_info = vm.get_backend_type_info(ty.id());
            trace!("examining field: {}, {:?}", ty, ty_info);
            let align = ty_info.alignment;
            struct_align = lcm(struct_align, align);
            cur = align_up(cur, align);
            offsets.push(cur);
            trace!("aligned to {}", cur);
            cur += ty_info.size;
        }
        // if we need padding at the end
        let size = align_up(cur, struct_align);
        (size, struct_align, offsets)
    }
pub fn sequential_layout ( tys : & Vec < P < MuType > > , vm : & VM ) -> ( ByteSize , ByteSize , Vec < ByteSize > ) { let mut offsets : Vec < ByteSize > = vec ! [ ] ; let mut cur : ByteSize = 0 ; let mut struct_align : ByteSize = 1 ; for ty in tys . iter ( ) { let ty_info = vm . get_backend_type_info ( ty . id ( ) ) ; trace ! ( " " ty ty_info ) ; let align = ty_info . alignment ; struct_align = lcm ( struct_align , align ) ; cur = align_up ( cur , align ) ; offsets . push ( cur ) ; trace ! ( " " cur ) ; cur += ty_info . size ; } // if we need padding at the end let size = align_up ( cur , struct_align ) ; ( size , struct_align , offsets ) }
sequentially layout a few Mu types as if they are fields in a struct.
sequentially layout a few Mu types as if they are fields in a struct .
tys
&Vec<P<MuType>>
vm
&VM
tys
&Vec<P<MuType>>
vm
&VM