Commit 27dc2a0f authored by Valentin Perrelle's avatar Valentin Perrelle

[Cil] Update comments

parent 0d74359a
...@@ -433,13 +433,14 @@ and fieldinfo = { ...@@ -433,13 +433,14 @@ and fieldinfo = {
expression. *) expression. *)
mutable fsize_in_bits: int option; mutable fsize_in_bits: int option;
(** (Deprecated. Use {!Cil.fieldBitsOffset} or {!Cil.bitsOffset} instead.) (** Similar to [fbitfield] for all types of fields.
Similar to [fbitfield] for all types of fields. Do not read this field directly. Use {!Cil.fieldBitsOffset} or
@deprecated only Jessie uses this *) {!Cil.bitsOffset} instead. *)
mutable foffset_in_bits: int option; mutable foffset_in_bits: int option;
(** Offset at which the field starts in the structure. Do not read directly, (** Offset at which the field starts in the structure.
but use {!Cil.fieldBitsOffset} or {!Cil.bitsOffset} instead. *) Do not read this field directly. Use {!Cil.fieldBitsOffset} or
{!Cil.bitsOffset} instead. *)
mutable fpadding_in_bits: int option; mutable fpadding_in_bits: int option;
(** (Deprecated.) Store the size of the padding that follows the field, if any. (** (Deprecated.) Store the size of the padding that follows the field, if any.
......
...@@ -4421,6 +4421,7 @@ and sizeOf ~loc t = ...@@ -4421,6 +4421,7 @@ and sizeOf ~loc t =
and fieldBitsOffset (f : fieldinfo) : int * int = and fieldBitsOffset (f : fieldinfo) : int * int =
if not f.fcomp.cstruct (* union *) then if not f.fcomp.cstruct (* union *) then
(* All union fields start at offset 0 *)
0, bitsSizeOf f.ftype 0, bitsSizeOf f.ftype
else begin else begin
if f.foffset_in_bits = None then begin if f.foffset_in_bits = None then begin
...@@ -4461,7 +4462,6 @@ and bitsOffset (baset: typ) (off: offset) : int * int = ...@@ -4461,7 +4462,6 @@ and bitsOffset (baset: typ) (off: offset) : int * int =
| TComp (ci, _, _) -> assert (ci == f.fcomp) | TComp (ci, _, _) -> assert (ci == f.fcomp)
| _ -> assert false); | _ -> assert false);
let offsbits, size = fieldBitsOffset f in let offsbits, size = fieldBitsOffset f in
(* All union fields start at offset 0 *)
loopOff f.ftype size (start + offsbits) off loopOff f.ftype size (start + offsbits) off
in in
loopOff baset (bitsSizeOf baset) 0 off loopOff baset (bitsSizeOf baset) 0 off
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment