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

[Cil] Update comments

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