[sledge] Build: Promote `import` subdirectory to a toplevel `nonstdlib` library

Reviewed By: jvillard

Differential Revision: D21720977

fbshipit-source-id: 0b9001eea
master
Josh Berdine 5 years ago committed by Facebook GitHub Bot
parent 529f6c9ded
commit df3e6ded1d

@ -33,25 +33,14 @@
ppx_sexp_conv ppx_sexp_value) ppx_sexp_conv ppx_sexp_value)
(preprocess no_preprocessing)) (preprocess no_preprocessing))
(subdir
src/import
(library
(name import)
(public_name sledge.import)
(libraries core core_kernel.fheap zarith trace)
(flags (:standard))
(preprocess
(pps ppx_sledge ppx_trace))
(inline_tests)))
(subdir (subdir
src src
(library (library
(name sledge) (name sledge)
(public_name sledge) (public_name sledge)
(libraries import) (libraries nonstdlib)
(flags (flags
(:standard -open Import)) (:standard -open NS))
(preprocess (preprocess
(pps ppx_sledge ppx_trace)) (pps ppx_sledge ppx_trace))
(inline_tests))) (inline_tests)))
@ -85,9 +74,9 @@
(package sledge) (package sledge)
(libraries apron apron.boxMPQ ctypes ctypes.foreign dune-build-info llvm (libraries apron apron.boxMPQ ctypes ctypes.foreign dune-build-info llvm
llvm.irreader llvm.analysis llvm.scalar_opts llvm.target llvm.ipo llvm.irreader llvm.analysis llvm.scalar_opts llvm.target llvm.ipo
llvm.linker shexp.process yojson trace import sledge model) llvm.linker shexp.process yojson trace nonstdlib sledge model)
(flags (flags
(:standard -w -58 -open Import -open Sledge -open Model)) (:standard -w -58 -open NS -open Sledge -open Model))
(preprocess (preprocess
(pps ppx_sledge ppx_trace)))) (pps ppx_sledge ppx_trace))))

@ -1,5 +1,8 @@
(lang dune 2.5) (lang dune 2.5)
(package
(name nonstdlib))
(package (package
(name ppx_trace)) (name ppx_trace))

@ -5,9 +5,9 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
(** Global namespace opened in each source file by the build system *) (** Global namespace intended to be opened in each source file *)
include Import0 include NS0
(** Failures *) (** Failures *)

@ -5,9 +5,9 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
(** Global namespace opened in each source file by the build system *) (** Global namespace intended to be opened in each source file *)
include module type of Import0 include module type of NS0
(** Function combinators *) (** Function combinators *)

@ -0,0 +1,13 @@
; Copyright (c) Facebook, Inc. and its affiliates.
;
; This source code is licensed under the MIT license found in the
; LICENSE file in the root directory of this source tree.
(library
(name NS)
(public_name nonstdlib)
(libraries core core_kernel.fheap zarith trace)
(flags (:standard))
(preprocess
(pps ppx_sledge ppx_trace))
(inline_tests))

@ -7,7 +7,7 @@
(** IArray - Immutable view of an array *) (** IArray - Immutable view of an array *)
open Import0 open NS0
include ( include (
Array.Permissioned : Array.Permissioned :

@ -13,7 +13,7 @@
structure, it only attempts to make it inconvenient to unintentionally structure, it only attempts to make it inconvenient to unintentionally
mutate. *) mutate. *)
open Import0 open NS0
include include
module type of Array.Permissioned module type of Array.Permissioned

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
open Import0 open NS0
include Core.List include Core.List
let rec pp ?pre ?suf sep pp_elt fs = function let rec pp ?pre ?suf sep pp_elt fs = function

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
open Import0 open NS0
include module type of Core.List include module type of Core.List
val pp : val pp :

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
open Import0 open NS0
include Map_intf include Map_intf
module Make (Key : sig module Make (Key : sig

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
open Import0 open NS0
module type S = sig module type S = sig
type key type key

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
open! Import0 open! NS0
include Core.Option include Core.Option
let pp fmt pp_elt fs = function let pp fmt pp_elt fs = function

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
open! Import0 open! NS0
include module type of Core.Option include module type of Core.Option
val pp : ('a_pp -> 'a -> unit, unit) fmt -> 'a_pp -> 'a option pp val pp : ('a_pp -> 'a -> unit, unit) fmt -> 'a_pp -> 'a option pp

@ -7,7 +7,7 @@
(** Qset - Set with (signed) rational multiplicity for each element *) (** Qset - Set with (signed) rational multiplicity for each element *)
open Import0 open NS0
include Qset_intf include Qset_intf
module Make (Elt : sig module Make (Elt : sig

@ -7,7 +7,7 @@
(** Qset - Set with (signed) rational multiplicity for each element *) (** Qset - Set with (signed) rational multiplicity for each element *)
open Import0 open NS0
module type S = sig module type S = sig
type elt type elt

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
open Import0 open NS0
include Set_intf include Set_intf
module Make (Elt : sig module Make (Elt : sig

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*) *)
open Import0 open NS0
module type S = sig module type S = sig
type elt type elt

@ -38,13 +38,13 @@ type op3 = Conditional | Extract [@@deriving compare, equal, hash, sexp]
type opN = Concat | Record [@@deriving compare, equal, hash, sexp] type opN = Concat | Record [@@deriving compare, equal, hash, sexp]
module rec Set : sig module rec Set : sig
include Import.Set.S with type elt := T.t include NS.Set.S with type elt := T.t
val hash : t -> int val hash : t -> int
val hash_fold_t : t Hash.folder val hash_fold_t : t Hash.folder
val t_of_sexp : Sexp.t -> t val t_of_sexp : Sexp.t -> t
end = struct end = struct
include Import.Set.Make (T) include NS.Set.Make (T)
let hash_fold_t = hash_fold_t T.hash_fold_t let hash_fold_t = hash_fold_t T.hash_fold_t
let hash = Hash.of_fold hash_fold_t let hash = Hash.of_fold hash_fold_t
@ -53,13 +53,13 @@ end = struct
end end
and Qset : sig and Qset : sig
include Import.Qset.S with type elt := T.t include NS.Qset.S with type elt := T.t
val hash : t -> int val hash : t -> int
val hash_fold_t : t Hash.folder val hash_fold_t : t Hash.folder
val t_of_sexp : Sexp.t -> t val t_of_sexp : Sexp.t -> t
end = struct end = struct
include Import.Qset.Make (T) include NS.Qset.Make (T)
let hash_fold_t = hash_fold_t T.hash_fold_t let hash_fold_t = hash_fold_t T.hash_fold_t
let hash = Hash.of_fold hash_fold_t let hash = Hash.of_fold hash_fold_t

@ -58,14 +58,14 @@ type opN =
[@@deriving compare, equal, hash, sexp] [@@deriving compare, equal, hash, sexp]
module rec Set : sig module rec Set : sig
include Import.Set.S with type elt := T.t include NS.Set.S with type elt := T.t
val hash_fold_t : t Hash.folder val hash_fold_t : t Hash.folder
val t_of_sexp : Sexp.t -> t val t_of_sexp : Sexp.t -> t
end end
and Qset : sig and Qset : sig
include Import.Qset.S with type elt := T.t include NS.Qset.S with type elt := T.t
val hash_fold_t : t Hash.folder val hash_fold_t : t Hash.folder
val t_of_sexp : Sexp.t -> t val t_of_sexp : Sexp.t -> t
@ -110,7 +110,7 @@ module Var : sig
module Map : Map.S with type key := t module Map : Map.S with type key := t
module Set : sig module Set : sig
include Import.Set.S with type elt := t include NS.Set.S with type elt := t
val hash_fold_t : t Hash.folder val hash_fold_t : t Hash.folder
val sexp_of_t : t -> Sexp.t val sexp_of_t : t -> Sexp.t

Loading…
Cancel
Save