Skip to content

Commit 71f3f7a

Browse files
committed
Remove unnecessary suppress_ovwarn arguments in SOverflow
There's no need for the argument: the caller can just ignore the return value.
1 parent 3a0dad4 commit 71f3f7a

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

src/cdomain/value/cdomains/int/bitfieldDomain.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ module BitfieldFunctor (Ints_t : IntOps.IntOps): Bitfield_SOverflow with type in
316316

317317
type bit_status = Zero | One | Top
318318

319-
let of_interval ?(suppress_ovwarn=false) ik (x,y) =
319+
let of_interval ik (x,y) =
320320
let (min_ik, max_ik) = Size.range ik in
321321
let startv = Ints_t.max x (Ints_t.of_bigint min_ik) in
322322
let endv= Ints_t.min y (Ints_t.of_bigint max_ik) in
@@ -619,13 +619,13 @@ module BitfieldFunctor (Ints_t : IntOps.IntOps): Bitfield_SOverflow with type in
619619
let exp1 = Invariant.of_exp (BinOp (Eq, (BinOp (BAnd, e, def1, TInt(ik,[]))), def1, intType)) in
620620
Invariant.meet exp0 exp1
621621

622-
let starting ?(suppress_ovwarn=false) ik n =
622+
let starting ik n =
623623
let (min_ik, max_ik) = Size.range ik in
624-
of_interval ~suppress_ovwarn ik (n, Ints_t.of_bigint max_ik)
624+
of_interval ik (n, Ints_t.of_bigint max_ik)
625625

626-
let ending ?(suppress_ovwarn=false) ik n =
626+
let ending ik n =
627627
let (min_ik, max_ik) = Size.range ik in
628-
of_interval ~suppress_ovwarn ik (Ints_t.of_bigint min_ik, n)
628+
of_interval ik (Ints_t.of_bigint min_ik, n)
629629

630630
(* Refinements *)
631631

src/cdomain/value/cdomains/int/intDomTuple.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ module IntDomTupleImpl = struct
120120
let of_bool ik = create { fi = fun (type a) (module I:SOverflow with type t = a) -> I.of_bool ik }
121121
let of_excl_list ik = create2 { fi2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_excl_list ik}
122122
let of_int ik = create2_ovc ik { fi2_ovc = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_int ik }
123-
let starting ?(suppress_ovwarn=false) ik = create2_ovc ~suppress_ovwarn ik { fi2_ovc = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.starting ~suppress_ovwarn ik }
124-
let ending ?(suppress_ovwarn=false) ik = create2_ovc ~suppress_ovwarn ik { fi2_ovc = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.ending ~suppress_ovwarn ik }
125-
let of_interval ?(suppress_ovwarn=false) ik = create2_ovc ~suppress_ovwarn ik { fi2_ovc = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_interval ~suppress_ovwarn ik }
123+
let starting ?(suppress_ovwarn=false) ik = create2_ovc ~suppress_ovwarn ik { fi2_ovc = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.starting ik }
124+
let ending ?(suppress_ovwarn=false) ik = create2_ovc ~suppress_ovwarn ik { fi2_ovc = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.ending ik }
125+
let of_interval ?(suppress_ovwarn=false) ik = create2_ovc ~suppress_ovwarn ik { fi2_ovc = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_interval ik }
126126
let of_congruence ik = create2 { fi2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_congruence ik }
127127
let of_bitfield ik = create2 { fi2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.of_bitfield ik }
128128

src/cdomain/value/cdomains/int/intervalDomain.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct
7676

7777
(* TODO: change to_int signature so it returns a big_int *)
7878
let to_int x = Option.bind x (IArith.to_int)
79-
let of_interval ?(suppress_ovwarn=false) ik (x,y) = norm ik @@ Some (x,y)
79+
let of_interval ik (x,y) = norm ik @@ Some (x,y)
8080

8181
let of_bitfield ik x =
8282
let min ik (z,o) =
@@ -117,10 +117,10 @@ struct
117117
| Some (l, u) when Ints_t.compare l Ints_t.zero = 0 && Ints_t.compare u Ints_t.zero = 0 -> Some false
118118
| x -> if leq zero x then None else Some true
119119

120-
let starting ?(suppress_ovwarn=false) ik n =
120+
let starting ik n =
121121
norm ik @@ Some (n, snd (range ik))
122122

123-
let ending ?(suppress_ovwarn=false) ik n =
123+
let ending ik n =
124124
norm ik @@ Some (fst (range ik), n)
125125

126126
(* TODO: change signature of maximal, minimal to return big_int*)

src/cdomain/value/cdomains/int/intervalSetDomain.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ struct
232232

233233
let of_bool _ = function true -> one | false -> zero
234234

235-
let of_interval ?(suppress_ovwarn=false) ik (x,y) = norm_interval ~cast:false ik (x,y)
235+
let of_interval ik (x,y) = norm_interval ~cast:false ik (x,y)
236236

237237
let of_bitfield ik x =
238238
match Interval.of_bitfield ik x with
@@ -471,9 +471,9 @@ struct
471471
in
472472
interval_sets_to_partitions ik xs ys |> merge_list ik |> widen_left |> widen_right |> List.map snd
473473

474-
let starting ?(suppress_ovwarn=false) ik n = norm_interval ik (n, snd (range ik))
474+
let starting ik n = norm_interval ik (n, snd (range ik))
475475

476-
let ending ?(suppress_ovwarn=false) ik n = norm_interval ik (fst (range ik), n)
476+
let ending ik n = norm_interval ik (fst (range ik), n)
477477

478478
let invariant_ikind e ik xs =
479479
List.map (fun x -> Interval.invariant_ikind e ik (Some x)) xs |>

src/cdomain/value/cdomains/intDomain0.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,11 @@ module SOverflowUnlifter (D : SOverflow) : S with type int_t = D.int_t and type
482482

483483
let of_int ik x = fst @@ D.of_int ik x
484484

485-
let of_interval ?suppress_ovwarn ik x = fst @@ D.of_interval ?suppress_ovwarn ik x
485+
let of_interval ?suppress_ovwarn ik x = fst @@ D.of_interval ik x
486486

487-
let starting ?suppress_ovwarn ik x = fst @@ D.starting ?suppress_ovwarn ik x
487+
let starting ?suppress_ovwarn ik x = fst @@ D.starting ik x
488488

489-
let ending ?suppress_ovwarn ik x = fst @@ D.ending ?suppress_ovwarn ik x
489+
let ending ?suppress_ovwarn ik x = fst @@ D.ending ik x
490490

491491
let shift_left ik x y = fst @@ D.shift_left ik x y
492492

@@ -734,11 +734,11 @@ module SOverflowLifter (D : S) : SOverflow with type int_t = D.int_t and type t
734734

735735
let of_int ik x = lift @@ D.of_int ik x
736736

737-
let of_interval ?suppress_ovwarn ik x = lift @@ D.of_interval ?suppress_ovwarn ik x
737+
let of_interval ik x = lift @@ D.of_interval ik x
738738

739-
let starting ?suppress_ovwarn ik x = lift @@ D.starting ?suppress_ovwarn ik x
739+
let starting ik x = lift @@ D.starting ik x
740740

741-
let ending ?suppress_ovwarn ik x = lift @@ D.ending ?suppress_ovwarn ik x
741+
let ending ik x = lift @@ D.ending ik x
742742

743743
let shift_left ik x y = lift @@ D.shift_left ik x y
744744

src/cdomain/value/cdomains/intDomain_intf.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ sig
294294

295295
val of_int : Cil.ikind -> int_t -> t * overflow_info
296296

297-
val of_interval: ?suppress_ovwarn:bool -> Cil.ikind -> int_t * int_t -> t * overflow_info
297+
val of_interval: Cil.ikind -> int_t * int_t -> t * overflow_info
298298

299-
val starting : ?suppress_ovwarn:bool -> Cil.ikind -> int_t -> t * overflow_info
300-
val ending : ?suppress_ovwarn:bool -> Cil.ikind -> int_t -> t * overflow_info
299+
val starting : Cil.ikind -> int_t -> t * overflow_info
300+
val ending : Cil.ikind -> int_t -> t * overflow_info
301301

302302
val shift_left : Cil.ikind -> t -> t -> t * overflow_info
303303

0 commit comments

Comments
 (0)