Skip to content

Commit

Permalink
Do not open Batteries when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Jan 22, 2025
1 parent 8999c55 commit fe0608d
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 14 deletions.
1 change: 0 additions & 1 deletion bench/hash.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
open Batteries
open Printf

let n_hash = ref 0
Expand Down
1 change: 0 additions & 1 deletion src/analyses/mutexAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module MustMultiplicity = LockDomain.MustMultiplicity
module LF = LibraryFunctions
open GoblintCil
open Analyses
open Batteries

module VarSet = SetDomain.Make (Basetype.Variables)

Expand Down
1 change: 0 additions & 1 deletion src/analyses/symbLocks.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module VarEq = VarEq.Spec

module PS = SetDomain.ToppedSet (LP) (struct let topname = "All" end)

open Batteries
open GoblintCil
open Pretty
open Analyses
Expand Down
5 changes: 2 additions & 3 deletions src/cdomain/value/util/wideningThresholds.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open GoblintCil
open Batteries
module Thresholds = Set.Make(Z)

(* Collect only constants that are used in comparisons *)
Expand Down Expand Up @@ -61,7 +60,7 @@ class extractThresholdsFromConditionsVisitor(upper_thresholds,lower_thresholds,
end

let default_thresholds = Thresholds.of_list (
let thresh_pos = List.map (Int.pow 2) [0;2;4;8;16;32;48] in
let thresh_pos = List.map (BatInt.pow 2) [0;2;4;8;16;32;48] in
let thresh_neg = List.map (fun x -> -x) thresh_pos in
List.map Z.of_int (thresh_neg @ thresh_pos @ [0])
)
Expand Down Expand Up @@ -108,7 +107,7 @@ let thresholds = ResettableLazy.map fst widening_thresholds

let thresholds_incl_mul2 = ResettableLazy.map snd widening_thresholds

module EH = BatHashtbl.Make (CilType.Exp)
module EH = Hashtbl.Make (CilType.Exp)

class extractInvariantsVisitor (exps) = object
inherit nopCilVisitor
Expand Down
1 change: 0 additions & 1 deletion src/cdomains/apron/gobApron.apron.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
open Batteries
include Apron

module Scalar =
Expand Down
1 change: 0 additions & 1 deletion src/cdomains/apron/sharedFunctions.apron.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(** Relational value domain utilities. *)
open GoblintCil
open Batteries

open GobApron

Expand Down
2 changes: 0 additions & 2 deletions src/common/util/intOps.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
(** Unified interface for integer types. *)

open Batteries

(* IntOps
* Wrapper around integer types providing unified interface for
* arithmetic and logical operations. *)
Expand Down
1 change: 0 additions & 1 deletion src/common/util/messageCategory.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
open Batteries
open GobConfig

type array_oob =
Expand Down
1 change: 0 additions & 1 deletion src/framework/control.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ let spec_module: (module Spec) Lazy.t = lazy (
GobConfig.building_spec := true;
let arg_enabled = get_bool "witness.graphml.enabled" || get_bool "exp.arg.enabled" in
let termination_enabled = List.mem "termination" (get_string_list "ana.activated") in (* check if loop termination analysis is enabled*)
let open Batteries in
(* apply functor F on module X if opt is true *)
let lift opt (module F : S2S) (module X : Spec) = (module (val if opt then (module F (X)) else (module X) : Spec) : Spec) in
let module S1 =
Expand Down
2 changes: 1 addition & 1 deletion src/framework/resultQuery.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct
end


module NH = BatHashtbl.Make (Node)
module NH = Hashtbl.Make (Node)

module type SpecSysSol2 =
sig
Expand Down
2 changes: 1 addition & 1 deletion src/transform/transform.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let run_transformations ?(file_output = true) file names ask =
let active_transformations =
List.filter_map
(fun name ->
match BatHashtbl.find_option h name with
match Hashtbl.find_opt h name with
| Some t -> Some (name, t)
| None -> failwith "Transformation %s does not exist!")
names
Expand Down

0 comments on commit fe0608d

Please sign in to comment.