Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds compatibility with OCaml 4.14 and Core v0.15 #1488

Merged
merged 3 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion lib/arm/arm_bit.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Or_error

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_bit.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Arm_types

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_branch.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Or_error

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_branch.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Arm_types

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_cond.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_cond.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std
open Arm_types
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_env.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std
open Arm_types
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_env.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Arm_types

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_flags.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std

open Arm_types
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_flags.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Arm_types

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_helpers.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]

let sexpable_of_string t_of_sexp name =
try Some (t_of_sexp @@ Sexp.of_string name)
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_helpers.mli
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
open Core_kernel
open Core_kernel[@@warning "-D"]

val sexpable_of_string : (Sexp.t -> 'a) -> string -> 'a option
2 changes: 1 addition & 1 deletion lib/arm/arm_insn.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std
open Arm_helpers
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_lifter.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap_core_theory
open Or_error
open Bap.Std
Expand Down
6 changes: 3 additions & 3 deletions lib/arm/arm_mem.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std

Expand Down Expand Up @@ -70,7 +70,7 @@ let lift_r ~(dst1 : Var.t) ?(dst2 : Var.t option) ~(base : Var.t)
let mem = Bil.var (Env.mem) in
if [%compare.equal: size] size D then [
Bil.move dst1 (load mem address);
Bil.move (uw dst2) (load mem Bil.(address + four));
Bil.move (Option.value_exn dst2) (load mem Bil.(address + four));
] else [
assn temp (load mem address);
] in
Expand All @@ -94,7 +94,7 @@ let lift_r ~(dst1 : Var.t) ?(dst2 : Var.t option) ~(base : Var.t)
| D -> [
Bil.move m (store v address Bil.(var dst1));
Bil.move m (store v
Bil.(address + four) Bil.(var (uw dst2)));
Bil.(address + four) Bil.(var (Option.value_exn dst2)));
]
| B | H | W -> [
Bil.move m (store v address Bil.(var temp));
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_mem.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Arm_types

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_mem_shift.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std
open Or_error
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_mem_shift.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Arm_types

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_mov.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap_core_theory
open Regular.Std
open Bap.Std
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_mov.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap_core_theory
open Bap.Std
open Arm_types
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_mul.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_mul.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Arm_types

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_op.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_reg.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std
open Arm_helpers
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_shift.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Or_error

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_shift.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Arm_types

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_target.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let package = "bap"

open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap_core_theory
open Bap.Std
open KB.Syntax
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_types.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std

Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_utils.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std

open Arm_types
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_utils.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Arm_types

Expand Down
2 changes: 1 addition & 1 deletion lib/bap/bap.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]

module Std = struct
type 'a printer = Format.formatter -> 'a -> unit
Expand Down
10 changes: 5 additions & 5 deletions lib/bap/bap.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(** BAP Standard Library *)

open Core_kernel
open Core_kernel[@@warning "-D"]
open Monads.Std
open Regular.Std
open Graphlib.Std
Expand Down Expand Up @@ -459,7 +459,7 @@ module Std : sig
The following plugin prints all sections in a file:

{[
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std
open Format

Expand Down Expand Up @@ -628,7 +628,7 @@ module Std : sig
**)
module Legacy : sig
module Monad : sig
open Core_kernel
open Core_kernel[@@warning "-D"]
module type Basic = Monad.Basic
module type Basic2 = Monad.Basic2
module type Infix = Monad.Infix
Expand Down Expand Up @@ -6636,7 +6636,7 @@ module Std : sig

@param return a function that lifts user data type ['s] to type
['r]. It is useful when you need to perform disassembly in some
monad, like [Or_error], or [Lwt]. Otherwise, just use [ident]
monad, like [Or_error], or [Lwt]. Otherwise, just use [Fn.id]
function and assume that ['s == 'r].

The disassembler will invoke user provided callbacks. To each
Expand Down Expand Up @@ -10560,7 +10560,7 @@ module Std : sig
the file, and [data] spans the data. An optional [finish]
function can be used to propagate to the project any
additional information that is available to the loader. It
defaults to [ident].
defaults to [Fn.id].
@deprecated use either [Input.custom] or [Input.from_string]
and [Input.from_bigstring].
*)
Expand Down
3 changes: 2 additions & 1 deletion lib/bap/bap_init_toplevel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ let install_printer printer =
let install_printers () =
Core_kernel.Pretty_printer.all () |>
List.iter install_printer
[@@warning "-D"]

let main () =
let module Bap_std_is_required = Bap.Std in
let module Core_kernel_is_required = Core_kernel in
let module Core_kernel_is_required = Core_kernel[@warning "-D"] in
let loader = Topdirs.dir_load Format.err_formatter in
setup_dynamic_loader loader;
install_printers ();
Expand Down
8 changes: 4 additions & 4 deletions lib/bap/bap_project.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap_core_theory
open Graphlib.Std
Expand Down Expand Up @@ -193,7 +193,7 @@ module Input = struct


let custom
?(finish=ident)
?(finish=Fn.id)
?(filename="")
?(code=Memmap.empty)
?(data=Memmap.empty) target () = {
Expand All @@ -204,7 +204,7 @@ module Input = struct
}

let create
?(finish=ident) arch file ~code ~data () =
?(finish=Fn.id) arch file ~code ~data () =
let spec = match arch with
| #Arch.unknown -> Ogre.Doc.empty
| arch -> Image.Spec.from_arch arch in {
Expand Down Expand Up @@ -295,7 +295,7 @@ module Input = struct
arch;
code;
data;
file = filename; finish = ident; spec;
file = filename; finish = Fn.id; spec;
target;
memory = code
}
Expand Down
2 changes: 1 addition & 1 deletion lib/bap/bap_project.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
open Bap_knowledge
open Bap_core_theory
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap_future.Std
open Bap_types.Std
Expand Down
2 changes: 1 addition & 1 deletion lib/bap/bap_self.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap_bundle.Std
open Bap_future.Std
open Bap_plugins.Std
Expand Down
2 changes: 1 addition & 1 deletion lib/bap/bap_self.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open Format
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap_future.Std
open Bap_main.Extension

Expand Down
2 changes: 1 addition & 1 deletion lib/bap_abi/bap_abi.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std


Expand Down
2 changes: 1 addition & 1 deletion lib/bap_api/bap_api.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std

type filename = string
Expand Down
2 changes: 1 addition & 1 deletion lib/bap_api/bap_api.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

*)

open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std

type filename = string
Expand Down
2 changes: 1 addition & 1 deletion lib/bap_api/bap_api_abi.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std
open Bap_api
Expand Down
2 changes: 1 addition & 1 deletion lib/bap_api/bap_api_abi.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std
open Bap_api
Expand Down
8 changes: 4 additions & 4 deletions lib/bap_bml/bap_bml.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std

[@@@warning "-D"]
Expand Down Expand Up @@ -74,7 +74,7 @@ let (-) pref tag = pref ^ "-" ^ Value.Tag.name tag
let (+) pref suf = if String.is_empty suf then pref else pref^"-"^suf

let unit suf set is tag =
Mappers.Nullary.register (set-tag+suf) (marker ident tag ());
Mappers.Nullary.register (set-tag+suf) (marker Fn.id tag ());
Predicates.Nullary.register (is-tag+suf) (has tag)

module Markers = struct
Expand Down Expand Up @@ -173,13 +173,13 @@ end
module Comment = struct
let () =
Mappers.Unary.register "comment" @@
marker ident comment;
marker Fn.id comment;
end

module Python = struct
let () =
Mappers.Unary.register "python" @@
marker ident python;
marker Fn.id python;
end

module Taint = struct
Expand Down
2 changes: 1 addition & 1 deletion lib/bap_bml/bap_bml.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]
open Bap.Std

(** BML - Bap Mapping Language.
Expand Down
2 changes: 1 addition & 1 deletion lib/bap_bundle/bap_bundle.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]

module Filename = Caml.Filename
module Sys = Caml.Sys
Expand Down
2 changes: 1 addition & 1 deletion lib/bap_bundle/bap_bundle.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Core_kernel
open Core_kernel[@@warning "-D"]

module Std : sig

Expand Down
Loading