// Compute the offset multiplier for variable length array indexing
// Rust type: usize
Compute the offset multiplier for variable length array indexing
Rust type: usize
Compute the offset multiplier for variable length array indexing Rust type : usize
pub fn compute_size_of_expr(&self, type_id: CTypeId) -> Option<P<Expr>> {
        match self.ast_context.resolve_type(type_id).kind {
            CTypeKind::VariableArray(elts, Some(counts)) => {
                let opt_esize = self.compute_size_of_expr(elts);
                let csize_name = self.renamer.borrow().get(&CDeclId(counts.0))
                                .expect("Failed to lookup VLA expression");
                let csize = mk().path_expr(vec![csize_name]);
                let val = match opt_esize {
                    None => csize,
                    Some(esize) => mk().binary_expr(BinOpKind::Mul, csize, esize),
                };
                Some(val)
            }
            _ => None,
        }
    }
pub fn compute_size_of_expr ( & self , type_id : CTypeId ) -> Option < P < Expr > > { match self . ast_context . resolve_type ( type_id ) . kind { CTypeKind :: VariableArray ( elts , Some ( counts ) ) => { let opt_esize = self . compute_size_of_expr ( elts ) ; let csize_name = self . renamer . borrow ( ) . get ( & CDeclId ( counts . 0 ) ) . expect ( " " ) ; let csize = mk ( ) . path_expr ( vec ! [ csize_name ] ) ; let val = match opt_esize { None => csize , Some ( esize ) => mk ( ) . binary_expr ( BinOpKind :: Mul , csize , esize ) , } ; Some ( val ) } _ => None , } }
Compute the offset multiplier for variable length array indexing
Rust type: usize
Compute the offset multiplier for variable length array indexing Rust type : usize
&self
type_id
CTypeId