Module Bit_utils

module Bit_utils: sig .. end
Some bit manipulations.

val sizeofchar : unit -> Integer.t
sizeof(char) in bits
val sizeofpointer : unit -> int
sizeof(char* ) in bits
val sizeof : Cil_types.typ -> Int_Base.t
sizeof ty is the size of ty in bits. This function may return Int_Base.top.
val osizeof : Cil_types.typ -> Int_Base.t
osizeof ty is the size of ty in bytes. This function may return Int_Base.top.
exception Neither_Int_Nor_Enum_Nor_Pointer
val is_signed_int_enum_pointer : Cil_types.typ -> bool
true means that the type is signed.
Raises Neither_Int_Nor_Enum_Nor_Pointer if the sign of the type is not meaningful.
val signof_typeof_lval : Cil_types.lval -> bool
Returns the sign of type of the lval. true means that the type is signed.
val sizeof_vid : Cil_types.varinfo -> Int_Base.t
Returns the size of the type of the variable in bits.
val sizeof_lval : Cil_types.lval -> Int_Base.t
Returns the size of the type of the left value in bits.
val sizeof_pointed : Cil_types.typ -> Int_Base.t
Returns the size of the type pointed by a pointer or array type in bits. Never call it on a non pointer or non array type .
val osizeof_pointed : Cil_types.typ -> Int_Base.t
Returns the size of the type pointed by a pointer or array type in bytes. Never call it on a non pointer or array type.
val sizeof_pointed_lval : Cil_types.lval -> Int_Base.t
Returns the size of the type pointed by a pointer type of the lval in bits. Never call it on a non pointer type lval.
val max_bit_address : unit -> Abstract_interp.Int.t
Returns the maximal possible offset in bits of a memory base.
val max_bit_size : unit -> Abstract_interp.Int.t
Returns the maximal possible size in bits of a memory base.

Pretty printing


val pretty_bits : Cil_types.typ ->
use_align:bool ->
align:Abstract_interp.Rel.t ->
rh_size:Integer.t ->
start:Integer.t ->
stop:Integer.t -> Format.formatter -> bool * Cil_types.typ option
Pretty prints a range of bits in a type for the user. Tries to find field names and array indexes, whenever possible.
val pretty_offset : Cil_types.typ -> Integer.t -> Format.formatter -> unit