aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/aux_file.ml2
-rw-r--r--lib/aux_file.mli2
-rw-r--r--lib/bigint.ml2
-rw-r--r--lib/bigint.mli2
-rw-r--r--lib/cEphemeron.ml2
-rw-r--r--lib/cEphemeron.mli2
-rw-r--r--lib/cErrors.ml6
-rw-r--r--lib/cErrors.mli28
-rw-r--r--lib/cMap.ml2
-rw-r--r--lib/cMap.mli2
-rw-r--r--lib/cSet.ml2
-rw-r--r--lib/cSet.mli2
-rw-r--r--lib/cString.ml2
-rw-r--r--lib/cString.mli2
-rw-r--r--lib/cThread.ml2
-rw-r--r--lib/cThread.mli2
-rw-r--r--lib/cUnix.ml2
-rw-r--r--lib/cUnix.mli2
-rw-r--r--lib/cWarnings.ml59
-rw-r--r--lib/cWarnings.mli4
-rw-r--r--lib/canary.ml2
-rw-r--r--lib/canary.mli2
-rw-r--r--lib/control.ml8
-rw-r--r--lib/control.mli2
-rw-r--r--lib/coqProject_file.ml416
-rw-r--r--lib/coqProject_file.mli2
-rw-r--r--lib/deque.ml2
-rw-r--r--lib/deque.mli2
-rw-r--r--lib/dyn.ml2
-rw-r--r--lib/dyn.mli2
-rw-r--r--lib/envars.ml2
-rw-r--r--lib/envars.mli2
-rw-r--r--lib/explore.ml4
-rw-r--r--lib/explore.mli4
-rw-r--r--lib/feedback.ml4
-rw-r--r--lib/feedback.mli14
-rw-r--r--lib/flags.ml14
-rw-r--r--lib/flags.mli10
-rw-r--r--lib/future.ml2
-rw-r--r--lib/future.mli8
-rw-r--r--lib/genarg.ml4
-rw-r--r--lib/genarg.mli4
-rw-r--r--lib/hMap.ml2
-rw-r--r--lib/hMap.mli2
-rw-r--r--lib/hashcons.ml2
-rw-r--r--lib/hashcons.mli2
-rw-r--r--lib/hashset.ml4
-rw-r--r--lib/hashset.mli2
-rw-r--r--lib/heap.ml2
-rw-r--r--lib/heap.mli2
-rw-r--r--lib/hook.ml2
-rw-r--r--lib/hook.mli2
-rw-r--r--lib/iStream.ml2
-rw-r--r--lib/iStream.mli2
-rw-r--r--lib/int.ml2
-rw-r--r--lib/int.mli2
-rw-r--r--lib/loc.ml2
-rw-r--r--lib/loc.mli2
-rw-r--r--lib/minisys.ml8
-rw-r--r--lib/option.ml2
-rw-r--r--lib/option.mli2
-rw-r--r--lib/pp.ml44
-rw-r--r--lib/pp.mli107
-rw-r--r--lib/profile.ml31
-rw-r--r--lib/profile.mli2
-rw-r--r--lib/remoteCounter.ml2
-rw-r--r--lib/remoteCounter.mli2
-rw-r--r--lib/rtree.ml2
-rw-r--r--lib/rtree.mli4
-rw-r--r--lib/spawn.ml2
-rw-r--r--lib/spawn.mli2
-rw-r--r--lib/system.ml2
-rw-r--r--lib/system.mli4
-rw-r--r--lib/terminal.ml14
-rw-r--r--lib/terminal.mli7
-rw-r--r--lib/trie.ml2
-rw-r--r--lib/trie.mli2
-rw-r--r--lib/unicode.mli2
-rw-r--r--lib/unionfind.ml2
-rw-r--r--lib/unionfind.mli2
-rw-r--r--lib/util.mli2
-rw-r--r--lib/xml_datatype.mli2
82 files changed, 278 insertions, 248 deletions
diff --git a/lib/aux_file.ml b/lib/aux_file.ml
index 09a254e9d9..b16e60da58 100644
--- a/lib/aux_file.ml
+++ b/lib/aux_file.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/aux_file.mli b/lib/aux_file.mli
index a7960fa169..1ee51312df 100644
--- a/lib/aux_file.mli
+++ b/lib/aux_file.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/bigint.ml b/lib/bigint.ml
index 1ecc2ce2cc..4f8b95d592 100644
--- a/lib/bigint.ml
+++ b/lib/bigint.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/bigint.mli b/lib/bigint.mli
index a1dc660771..2a5a5f122d 100644
--- a/lib/bigint.mli
+++ b/lib/bigint.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cEphemeron.ml b/lib/cEphemeron.ml
index 890e02dc4e..8b253a7901 100644
--- a/lib/cEphemeron.ml
+++ b/lib/cEphemeron.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cEphemeron.mli b/lib/cEphemeron.mli
index 76cd7a5a8a..d8a1f27573 100644
--- a/lib/cEphemeron.mli
+++ b/lib/cEphemeron.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cErrors.ml b/lib/cErrors.ml
index 8ef11a2cdd..3f4e8aa12f 100644
--- a/lib/cErrors.ml
+++ b/lib/cErrors.ml
@@ -14,7 +14,7 @@ let push = Backtrace.add_backtrace
(* Errors *)
-exception Anomaly of string option * std_ppcmds (* System errors *)
+exception Anomaly of string option * Pp.t (* System errors *)
let _ =
let pr = function
@@ -33,7 +33,7 @@ let is_anomaly = function
| Anomaly _ -> true
| _ -> false
-exception UserError of string option * std_ppcmds (* User errors *)
+exception UserError of string option * Pp.t (* User errors *)
let todo s = prerr_string ("TODO: "^s^"\n")
@@ -41,7 +41,7 @@ let user_err ?loc ?hdr strm = Loc.raise ?loc (UserError (hdr, strm))
let invalid_arg ?loc s = Loc.raise ?loc (Invalid_argument s)
-exception AlreadyDeclared of std_ppcmds (* for already declared Schemes *)
+exception AlreadyDeclared of Pp.t (* for already declared Schemes *)
let alreadydeclared pps = raise (AlreadyDeclared(pps))
exception Timeout
diff --git a/lib/cErrors.mli b/lib/cErrors.mli
index ca0838575e..f3253979f2 100644
--- a/lib/cErrors.mli
+++ b/lib/cErrors.mli
@@ -6,8 +6,6 @@
(* * GNU Lesser General Public License Version 2.1 *)
(***********************************************************************)
-open Pp
-
(** This modules implements basic manipulations of errors for use
throughout Coq's code. *)
@@ -21,10 +19,10 @@ val push : exn -> Exninfo.iexn
[Anomaly] is used for system errors and [UserError] for the
user's ones. *)
-val make_anomaly : ?label:string -> std_ppcmds -> exn
+val make_anomaly : ?label:string -> Pp.t -> exn
(** Create an anomaly. *)
-val anomaly : ?loc:Loc.t -> ?label:string -> std_ppcmds -> 'a
+val anomaly : ?loc:Loc.t -> ?label:string -> Pp.t -> 'a
(** Raise an anomaly, with an optional location and an optional
label identifying the anomaly. *)
@@ -33,16 +31,16 @@ val is_anomaly : exn -> bool
This is mostly provided for compatibility. Please avoid doing specific
tricks with anomalies thanks to it. See rather [noncritical] below. *)
-exception UserError of string option * std_ppcmds
+exception UserError of string option * Pp.t
(** Main error signaling exception. It carries a header plus a pretty printing
doc *)
-val user_err : ?loc:Loc.t -> ?hdr:string -> std_ppcmds -> 'a
+val user_err : ?loc:Loc.t -> ?hdr:string -> Pp.t -> 'a
(** Main error raising primitive. [user_err ?loc ?hdr pp] signals an
error [pp] with optional header and location [hdr] [loc] *)
-exception AlreadyDeclared of std_ppcmds
-val alreadydeclared : std_ppcmds -> 'a
+exception AlreadyDeclared of Pp.t
+val alreadydeclared : Pp.t -> 'a
val invalid_arg : ?loc:Loc.t -> string -> 'a
@@ -74,16 +72,16 @@ exception Quit
exception Unhandled
-val register_handler : (exn -> Pp.std_ppcmds) -> unit
+val register_handler : (exn -> Pp.t) -> unit
(** The standard exception printer *)
-val print : ?info:Exninfo.info -> exn -> Pp.std_ppcmds
-val iprint : Exninfo.iexn -> Pp.std_ppcmds
+val print : ?info:Exninfo.info -> exn -> Pp.t
+val iprint : Exninfo.iexn -> Pp.t
(** Same as [print], except that the "Please report" part of an anomaly
isn't printed (used in Ltac debugging). *)
-val print_no_report : exn -> Pp.std_ppcmds
-val iprint_no_report : Exninfo.iexn -> Pp.std_ppcmds
+val print_no_report : exn -> Pp.t
+val iprint_no_report : Exninfo.iexn -> Pp.t
(** Critical exceptions should not be caught and ignored by mistake
by inner functions during a [vernacinterp]. They should be handled
@@ -100,9 +98,9 @@ val handled : exn -> bool
val error : string -> 'a
[@@ocaml.deprecated "use [user_err] instead"]
-val errorlabstrm : string -> std_ppcmds -> 'a
+val errorlabstrm : string -> Pp.t -> 'a
[@@ocaml.deprecated "use [user_err ~hdr] instead"]
-val user_err_loc : Loc.t * string * std_ppcmds -> 'a
+val user_err_loc : Loc.t * string * Pp.t -> 'a
[@@ocaml.deprecated "use [user_err ~loc] instead"]
diff --git a/lib/cMap.ml b/lib/cMap.ml
index ba0873ffa7..0ecb40209c 100644
--- a/lib/cMap.ml
+++ b/lib/cMap.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cMap.mli b/lib/cMap.mli
index 2838b374ec..f65036139b 100644
--- a/lib/cMap.mli
+++ b/lib/cMap.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cSet.ml b/lib/cSet.ml
index 037cdc3568..ed65edf16e 100644
--- a/lib/cSet.ml
+++ b/lib/cSet.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cSet.mli b/lib/cSet.mli
index 2452bb60e5..2eb9bce869 100644
--- a/lib/cSet.mli
+++ b/lib/cSet.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cString.ml b/lib/cString.ml
index 7048dbb81b..f2242460e8 100644
--- a/lib/cString.ml
+++ b/lib/cString.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cString.mli b/lib/cString.mli
index b30f26abe7..29d3a44995 100644
--- a/lib/cString.mli
+++ b/lib/cString.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cThread.ml b/lib/cThread.ml
index 9f642b3cec..0221e690e8 100644
--- a/lib/cThread.ml
+++ b/lib/cThread.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cThread.mli b/lib/cThread.mli
index 36477a1160..66f039bb52 100644
--- a/lib/cThread.mli
+++ b/lib/cThread.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cUnix.ml b/lib/cUnix.ml
index 2542b9751b..867f86a746 100644
--- a/lib/cUnix.ml
+++ b/lib/cUnix.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cUnix.mli b/lib/cUnix.mli
index c6bcf63475..a394814041 100644
--- a/lib/cUnix.mli
+++ b/lib/cUnix.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/cWarnings.ml b/lib/cWarnings.ml
index d004fd6711..ff71452672 100644
--- a/lib/cWarnings.ml
+++ b/lib/cWarnings.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -35,28 +35,6 @@ let add_warning_in_category ~name ~category =
in
Hashtbl.replace categories category (name::ws)
-let create ~name ~category ?(default=Enabled) pp =
- Hashtbl.add warnings name { default; category; status = default };
- add_warning_in_category ~name ~category;
- if default <> Disabled then
- add_warning_in_category ~name ~category:"default";
- fun ?loc x ->
- let w = Hashtbl.find warnings name in
- let loc = Option.append loc !current_loc in
- match w.status with
- | Disabled -> ()
- | AsError -> CErrors.user_err ?loc (pp x)
- | Enabled ->
- let msg =
- pp x ++ spc () ++ str "[" ++ str name ++ str "," ++
- str category ++ str "]"
- in
- Feedback.msg_warning ?loc msg
-
-let warn_unknown_warning =
- create ~name:"unknown-warning" ~category:"toplevel"
- (fun name -> strbrk "Unknown warning name: " ++ str name)
-
let set_warning_status ~name status =
try
let w = Hashtbl.find warnings name in
@@ -111,12 +89,6 @@ let set_status ~name status =
let split_flags s =
let reg = Str.regexp "[ ,]+" in Str.split reg s
-let check_warning ~silent (_status,name) =
- is_all_keyword name ||
- Hashtbl.mem categories name ||
- Hashtbl.mem warnings name ||
- (if not silent then warn_unknown_warning name; false)
-
(** [cut_before_all_rev] removes all flags subsumed by a later occurrence of the
"all" flag, and reverses the list. *)
let rec cut_before_all_rev acc = function
@@ -143,10 +115,9 @@ let uniquize_flags_rev flags =
| [] -> acc
in aux [] CString.Set.empty flags
-(** [normalize_flags] removes unknown or redundant warnings. If [silent] is
- true, it emits a warning when an unknown warning is met. *)
+(** [normalize_flags] removes redundant warnings. Unknown warnings are kept
+ because they may be declared in a plugin that will be linked later. *)
let normalize_flags ~silent warnings =
- let warnings = List.filter (check_warning ~silent) warnings in
let warnings = cut_before_all_rev warnings in
uniquize_flags_rev warnings
@@ -179,3 +150,27 @@ let parse_flags s =
let set_flags s =
reset_default_warnings (); let s = parse_flags s in flags := s
+
+(* Adds a warning to the [warnings] and [category] tables. We then reparse the
+ warning flags string, because the warning being created might have been set
+ already. *)
+let create ~name ~category ?(default=Enabled) pp =
+ Hashtbl.replace warnings name { default; category; status = default };
+ add_warning_in_category ~name ~category;
+ if default <> Disabled then
+ add_warning_in_category ~name ~category:"default";
+ (* We re-parse and also re-normalize the flags, because the category of the
+ new warning is now known. *)
+ set_flags !flags;
+ fun ?loc x ->
+ let w = Hashtbl.find warnings name in
+ let loc = Option.append loc !current_loc in
+ match w.status with
+ | Disabled -> ()
+ | AsError -> CErrors.user_err ?loc (pp x)
+ | Enabled ->
+ let msg =
+ pp x ++ spc () ++ str "[" ++ str name ++ str "," ++
+ str category ++ str "]"
+ in
+ Feedback.msg_warning ?loc msg
diff --git a/lib/cWarnings.mli b/lib/cWarnings.mli
index c1fb5d6042..ba152a19b6 100644
--- a/lib/cWarnings.mli
+++ b/lib/cWarnings.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -11,7 +11,7 @@ type status = Disabled | Enabled | AsError
val set_current_loc : Loc.t option -> unit
val create : name:string -> category:string -> ?default:status ->
- ('a -> Pp.std_ppcmds) -> ?loc:Loc.t -> 'a -> unit
+ ('a -> Pp.t) -> ?loc:Loc.t -> 'a -> unit
val get_flags : unit -> string
val set_flags : string -> unit
diff --git a/lib/canary.ml b/lib/canary.ml
index c01bc15879..0ed1d28f37 100644
--- a/lib/canary.ml
+++ b/lib/canary.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/canary.mli b/lib/canary.mli
index 21949e7359..904b88213c 100644
--- a/lib/canary.mli
+++ b/lib/canary.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/control.ml b/lib/control.ml
index bf0e1b1cd7..f5d7df204e 100644
--- a/lib/control.ml
+++ b/lib/control.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -48,7 +48,7 @@ let windows_timeout n f e =
let exited = ref false in
let thread init =
while not !killed do
- let cur = Unix.time () in
+ let cur = Unix.gettimeofday () in
if float_of_int n <= cur -. init then begin
interrupt := true;
exited := true;
@@ -57,12 +57,12 @@ let windows_timeout n f e =
Thread.delay 0.5
done
in
- let init = Unix.time () in
+ let init = Unix.gettimeofday () in
let _id = Thread.create thread init in
try
let res = f () in
let () = killed := true in
- let cur = Unix.time () in
+ let cur = Unix.gettimeofday () in
(** The thread did not interrupt, but the computation took longer than
expected. *)
let () = if float_of_int n <= cur -. init then begin
diff --git a/lib/control.mli b/lib/control.mli
index 681df313bc..337cdf67b0 100644
--- a/lib/control.mli
+++ b/lib/control.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/coqProject_file.ml4 b/lib/coqProject_file.ml4
index 97aa90e07d..13de731f54 100644
--- a/lib/coqProject_file.ml4
+++ b/lib/coqProject_file.ml4
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -73,9 +73,6 @@ let rec post_canonize f =
if dir = Filename.current_dir_name then f else post_canonize dir
else f
-(* Avoid Sys.is_directory raise an exception (if the file does not exists) *)
-let is_directory f = Sys.file_exists f && Sys.is_directory f
-
(********************* parser *******************************************)
exception Parsing_error of string
@@ -106,6 +103,15 @@ let parse f =
res
;;
+(* Copy from minisys.ml, since we don't see that file here *)
+let exists_dir dir =
+ let rec strip_trailing_slash dir =
+ let len = String.length dir in
+ if len > 0 && (dir.[len-1] = '/' || dir.[len-1] = '\\')
+ then strip_trailing_slash (String.sub dir 0 (len-1)) else dir in
+ try Sys.is_directory (strip_trailing_slash dir) with Sys_error _ -> false
+
+
let process_cmd_line orig_dir proj args =
let orig_dir = (* avoids turning foo.v in ./foo.v *)
if orig_dir = "." then "" else orig_dir in
@@ -173,7 +179,7 @@ let process_cmd_line orig_dir proj args =
| f :: r ->
let f = CUnix.correct_path f orig_dir in
let proj =
- if is_directory f then { proj with subdirs = proj.subdirs @ [f] }
+ if exists_dir f then { proj with subdirs = proj.subdirs @ [f] }
else match CUnix.get_extension f with
| ".v" -> { proj with v_files = proj.v_files @ [f] }
| ".ml" -> { proj with ml_files = proj.ml_files @ [f] }
diff --git a/lib/coqProject_file.mli b/lib/coqProject_file.mli
index 19fc9227ae..23a27a54ab 100644
--- a/lib/coqProject_file.mli
+++ b/lib/coqProject_file.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/deque.ml b/lib/deque.ml
index ac89a35b15..373269b4f5 100644
--- a/lib/deque.ml
+++ b/lib/deque.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/deque.mli b/lib/deque.mli
index 6963f1dbac..23cb1e4919 100644
--- a/lib/deque.mli
+++ b/lib/deque.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/dyn.ml b/lib/dyn.ml
index 65d1442ac6..6bd43455f6 100644
--- a/lib/dyn.ml
+++ b/lib/dyn.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/dyn.mli b/lib/dyn.mli
index 448b11a18f..e43c8a9bcf 100644
--- a/lib/dyn.mli
+++ b/lib/dyn.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/envars.ml b/lib/envars.ml
index 47baf66a69..68604ae6c9 100644
--- a/lib/envars.ml
+++ b/lib/envars.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/envars.mli b/lib/envars.mli
index 18b7676ce7..09f2b4ca19 100644
--- a/lib/envars.mli
+++ b/lib/envars.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/explore.ml b/lib/explore.ml
index aa7bddf2b4..7da077e968 100644
--- a/lib/explore.ml
+++ b/lib/explore.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -14,7 +14,7 @@ module type SearchProblem = sig
type state
val branching : state -> state list
val success : state -> bool
- val pp : state -> std_ppcmds
+ val pp : state -> Pp.t
end
module Make = functor(S : SearchProblem) -> struct
diff --git a/lib/explore.mli b/lib/explore.mli
index 2b273e12b2..5875246ffc 100644
--- a/lib/explore.mli
+++ b/lib/explore.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -27,7 +27,7 @@ module type SearchProblem = sig
val success : state -> bool
- val pp : state -> Pp.std_ppcmds
+ val pp : state -> Pp.t
end
diff --git a/lib/feedback.ml b/lib/feedback.ml
index f6abf65120..54d16a9be3 100644
--- a/lib/feedback.ml
+++ b/lib/feedback.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -32,7 +32,7 @@ type feedback_content =
(* Extra metadata *)
| Custom of Loc.t option * string * xml
(* Generic messages *)
- | Message of level * Loc.t option * Pp.std_ppcmds
+ | Message of level * Loc.t option * Pp.t
type feedback = {
id : Stateid.t;
diff --git a/lib/feedback.mli b/lib/feedback.mli
index dc104132a0..45a02d384a 100644
--- a/lib/feedback.mli
+++ b/lib/feedback.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -40,7 +40,7 @@ type feedback_content =
(* Extra metadata *)
| Custom of Loc.t option * string * xml
(* Generic messages *)
- | Message of level * Loc.t option * Pp.std_ppcmds
+ | Message of level * Loc.t option * Pp.t
type feedback = {
id : Stateid.t; (* The document part concerned *)
@@ -78,20 +78,20 @@ relaxed. *)
(* Should we advertise these functions more? Should they be the ONLY
allowed way to output something? *)
-val msg_info : ?loc:Loc.t -> Pp.std_ppcmds -> unit
+val msg_info : ?loc:Loc.t -> Pp.t -> unit
(** Message that displays information, usually in verbose mode, such as [Foobar
is defined] *)
-val msg_notice : ?loc:Loc.t -> Pp.std_ppcmds -> unit
+val msg_notice : ?loc:Loc.t -> Pp.t -> unit
(** Message that should be displayed, such as [Print Foo] or [Show Bar]. *)
-val msg_warning : ?loc:Loc.t -> Pp.std_ppcmds -> unit
+val msg_warning : ?loc:Loc.t -> Pp.t -> unit
(** Message indicating that something went wrong, but without serious
consequences. *)
-val msg_error : ?loc:Loc.t -> Pp.std_ppcmds -> unit
+val msg_error : ?loc:Loc.t -> Pp.t -> unit
(** Message indicating that something went really wrong, though still
recoverable; otherwise an exception would have been raised. *)
-val msg_debug : ?loc:Loc.t -> Pp.std_ppcmds -> unit
+val msg_debug : ?loc:Loc.t -> Pp.t -> unit
(** For debugging purposes *)
diff --git a/lib/flags.ml b/lib/flags.ml
index 46bbba8e55..027ba16f0e 100644
--- a/lib/flags.ml
+++ b/lib/flags.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -106,7 +106,7 @@ let we_are_parsing = ref false
(* Current means no particular compatibility consideration.
For correct comparisons, this constructor should remain the last one. *)
-type compat_version = VOld | V8_5 | V8_6 | Current
+type compat_version = VOld | V8_5 | V8_6 | V8_7 | Current
let compat_version = ref Current
@@ -120,6 +120,9 @@ let version_compare v1 v2 = match v1, v2 with
| V8_6, V8_6 -> 0
| V8_6, _ -> -1
| _, V8_6 -> 1
+ | V8_7, V8_7 -> 0
+ | V8_7, _ -> -1
+ | _, V8_7 -> 1
| Current, Current -> 0
let version_strictly_greater v = version_compare !compat_version v > 0
@@ -129,6 +132,7 @@ let pr_version = function
| VOld -> "old"
| V8_5 -> "8.5"
| V8_6 -> "8.6"
+ | V8_7 -> "8.7"
| Current -> "current"
(* Translate *)
@@ -163,9 +167,9 @@ let use_polymorphic_flag () =
let make_polymorphic_flag b =
local_polymorphic_flag := Some b
-let inductive_cumulativity = ref false
-let make_inductive_cumulativity b = inductive_cumulativity := b
-let is_inductive_cumulativity () = !inductive_cumulativity
+let polymorphic_inductive_cumulativity = ref false
+let make_polymorphic_inductive_cumulativity b = polymorphic_inductive_cumulativity := b
+let is_polymorphic_inductive_cumulativity () = !polymorphic_inductive_cumulativity
(** [program_mode] tells that Program mode has been activated, either
globally via [Set Program] or locally via the Program command prefix. *)
diff --git a/lib/flags.mli b/lib/flags.mli
index 5e78f0a041..5af563b46e 100644
--- a/lib/flags.mli
+++ b/lib/flags.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -77,7 +77,7 @@ val raw_print : bool ref
(* Univ print flag, never set anywere. Maybe should belong to Univ? *)
val univ_print : bool ref
-type compat_version = VOld | V8_5 | V8_6 | Current
+type compat_version = VOld | V8_5 | V8_6 | V8_7 | Current
val compat_version : compat_version ref
val version_compare : compat_version -> compat_version -> int
val version_strictly_greater : compat_version -> bool
@@ -119,9 +119,9 @@ val is_universe_polymorphism : unit -> bool
val make_polymorphic_flag : bool -> unit
val use_polymorphic_flag : unit -> bool
-(** Global inductive cumulativity flag. *)
-val make_inductive_cumulativity : bool -> unit
-val is_inductive_cumulativity : unit -> bool
+(** Global polymorphic inductive cumulativity flag. *)
+val make_polymorphic_inductive_cumulativity : bool -> unit
+val is_polymorphic_inductive_cumulativity : unit -> bool
val warn : bool ref
val make_warn : bool -> unit
diff --git a/lib/future.ml b/lib/future.ml
index 8bef1e58e1..d9463aa0f1 100644
--- a/lib/future.ml
+++ b/lib/future.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/future.mli b/lib/future.mli
index 2a025ae844..acfce51a07 100644
--- a/lib/future.mli
+++ b/lib/future.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -154,7 +154,7 @@ val purify : ('a -> 'b) -> 'a -> 'b
val transactify : ('a -> 'b) -> 'a -> 'b
(** Debug: print a computation given an inner printing function. *)
-val print : ('a -> Pp.std_ppcmds) -> 'a computation -> Pp.std_ppcmds
+val print : ('a -> Pp.t) -> 'a computation -> Pp.t
type freeze
(* These functions are needed to get rid of side effects.
@@ -162,5 +162,5 @@ type freeze
deal with the whole system state. *)
val set_freeze : (unit -> freeze) -> (freeze -> unit) -> unit
-val customize_not_ready_msg : (string -> Pp.std_ppcmds) -> unit
-val customize_not_here_msg : (string -> Pp.std_ppcmds) -> unit
+val customize_not_ready_msg : (string -> Pp.t) -> unit
+val customize_not_here_msg : (string -> Pp.t) -> unit
diff --git a/lib/genarg.ml b/lib/genarg.ml
index 377ff81827..b78fe40373 100644
--- a/lib/genarg.ml
+++ b/lib/genarg.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -58,7 +58,7 @@ fun t1 t2 -> match t1, t2 with
end
| _ -> None
-let rec pr_genarg_type : type a b c. (a, b, c) genarg_type -> std_ppcmds = function
+let rec pr_genarg_type : type a b c. (a, b, c) genarg_type -> Pp.t = function
| ListArg t -> pr_genarg_type t ++ spc () ++ str "list"
| OptArg t -> pr_genarg_type t ++ spc () ++ str "opt"
| PairArg (t1, t2) ->
diff --git a/lib/genarg.mli b/lib/genarg.mli
index d7ad9b93b4..7fa71299e3 100644
--- a/lib/genarg.mli
+++ b/lib/genarg.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -146,7 +146,7 @@ val abstract_argument_type_eq :
('a, 'l) abstract_argument_type -> ('b, 'l) abstract_argument_type ->
('a, 'b) CSig.eq option
-val pr_argument_type : argument_type -> Pp.std_ppcmds
+val pr_argument_type : argument_type -> Pp.t
(** Print a human-readable representation for a given type. *)
val genarg_tag : 'a generic_argument -> argument_type
diff --git a/lib/hMap.ml b/lib/hMap.ml
index ea76e74272..c69efdb711 100644
--- a/lib/hMap.ml
+++ b/lib/hMap.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/hMap.mli b/lib/hMap.mli
index c4e6a08e1b..c77bfced88 100644
--- a/lib/hMap.mli
+++ b/lib/hMap.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/hashcons.ml b/lib/hashcons.ml
index 0ee3ec6277..ee22325811 100644
--- a/lib/hashcons.ml
+++ b/lib/hashcons.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/hashcons.mli b/lib/hashcons.mli
index 150899cef5..fbd2ebcf9a 100644
--- a/lib/hashcons.mli
+++ b/lib/hashcons.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/hashset.ml b/lib/hashset.ml
index af33544dc6..7f96627a68 100644
--- a/lib/hashset.ml
+++ b/lib/hashset.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -181,7 +181,7 @@ module Make (E : EqType) =
let sz = Weak.length bucket in
let rec loop i =
if i >= sz then ifnotfound index
- else if h = hashes.(i) then begin
+ else if Int.equal h hashes.(i) then begin
match Weak.get bucket i with
| Some v when E.eq v d -> v
| _ -> loop (i + 1)
diff --git a/lib/hashset.mli b/lib/hashset.mli
index 733c89621c..ec79205a5c 100644
--- a/lib/hashset.mli
+++ b/lib/hashset.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/heap.ml b/lib/heap.ml
index 97ccadeba8..a6109972d7 100644
--- a/lib/heap.ml
+++ b/lib/heap.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/heap.mli b/lib/heap.mli
index 0e77a3a068..93d504c5ac 100644
--- a/lib/heap.mli
+++ b/lib/heap.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/hook.ml b/lib/hook.ml
index a370fe3578..14ca27bcf1 100644
--- a/lib/hook.ml
+++ b/lib/hook.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/hook.mli b/lib/hook.mli
index 50347f334f..df38abc53b 100644
--- a/lib/hook.mli
+++ b/lib/hook.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/iStream.ml b/lib/iStream.ml
index 26a666e176..d3a54332a1 100644
--- a/lib/iStream.ml
+++ b/lib/iStream.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/iStream.mli b/lib/iStream.mli
index 50f5389ba2..cd7940e8d3 100644
--- a/lib/iStream.mli
+++ b/lib/iStream.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/int.ml b/lib/int.ml
index 70bd742427..63f62154d8 100644
--- a/lib/int.ml
+++ b/lib/int.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/int.mli b/lib/int.mli
index 93d1be1f7d..b65367f7d4 100644
--- a/lib/int.mli
+++ b/lib/int.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/loc.ml b/lib/loc.ml
index ee759bdfc1..9f036d90f9 100644
--- a/lib/loc.ml
+++ b/lib/loc.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/loc.mli b/lib/loc.mli
index edcf701bf2..1fbaae8368 100644
--- a/lib/loc.mli
+++ b/lib/loc.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/minisys.ml b/lib/minisys.ml
index f15021c655..1ed017e489 100644
--- a/lib/minisys.ml
+++ b/lib/minisys.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -44,7 +44,11 @@ let ok_dirname f =
(* Check directory can be opened *)
let exists_dir dir =
- try Sys.is_directory dir with Sys_error _ -> false
+ let rec strip_trailing_slash dir =
+ let len = String.length dir in
+ if len > 0 && (dir.[len-1] = '/' || dir.[len-1] = '\\')
+ then strip_trailing_slash (String.sub dir 0 (len-1)) else dir in
+ try Sys.is_directory (strip_trailing_slash dir) with Sys_error _ -> false
let apply_subdir f path name =
(* we avoid all files and subdirs starting by '.' (e.g. .svn) *)
diff --git a/lib/option.ml b/lib/option.ml
index 50fdd079dc..7cedffef08 100644
--- a/lib/option.ml
+++ b/lib/option.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/option.mli b/lib/option.mli
index f06ad9f1d1..c4d1ebc3a7 100644
--- a/lib/option.mli
+++ b/lib/option.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/pp.ml b/lib/pp.ml
index 66feae761a..88ddcb35b5 100644
--- a/lib/pp.ml
+++ b/lib/pp.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -39,7 +39,9 @@ type doc_view =
(* Following discussion on #390, we play on the safe side and make the
internal representation opaque here. *)
type t = doc_view
+
type std_ppcmds = t
+[@@ocaml.deprecated "alias of Pp.t"]
let repr x = x
let unrepr x = x
@@ -153,7 +155,7 @@ let rec pr_com ft s =
| None -> ()
(* pretty printing functions *)
-let pp_with ft =
+let pp_with ft pp =
let cpp_open_box = function
| Pp_hbox n -> Format.pp_open_hbox ft ()
| Pp_vbox n -> Format.pp_open_vbox ft n
@@ -175,7 +177,7 @@ let pp_with ft =
pp_cmd s;
pp_close_tag ft ()
in
- try pp_cmd
+ try pp_cmd pp
with reraise ->
let reraise = Backtrace.add_backtrace reraise in
let () = Format.pp_print_flush ft () in
@@ -220,23 +222,25 @@ let prlist pr l = Ppcmd_glue (List.map pr l)
if a strict behavior is needed, use [prlist_strict] instead.
evaluation is done from left to right. *)
-let prlist_sep_lastsep no_empty sep lastsep elem =
- let rec start = function
- |[] -> mt ()
- |[e] -> elem e
- |h::t -> let e = elem h in
- if no_empty && ismt e then start t else
- let rec aux = function
- |[] -> mt ()
- |h::t ->
- let e = elem h and r = aux t in
- if no_empty && ismt e then r else
- if ismt r
- then let s = lastsep () in s ++ e
- else let s = sep () in s ++ e ++ r
- in let r = aux t in e ++ r
- in start
-
+let prlist_sep_lastsep no_empty sep_thunk lastsep_thunk elem l =
+ let sep = sep_thunk () in
+ let lastsep = lastsep_thunk () in
+ let elems = List.map elem l in
+ let filtered_elems =
+ if no_empty then
+ List.filter (fun e -> not (ismt e)) elems
+ else
+ elems
+ in
+ let rec insert_seps es =
+ match es with
+ | [] -> mt ()
+ | [e] -> e
+ | h::[e] -> h ++ lastsep ++ e
+ | h::t -> h ++ sep ++ insert_seps t
+ in
+ insert_seps filtered_elems
+
let prlist_strict pr l = prlist_sep_lastsep true mt mt pr l
(* [prlist_with_sep sep pr [a ; ... ; c]] outputs
[pr a ++ sep() ++ ... ++ sep() ++ pr c] *)
diff --git a/lib/pp.mli b/lib/pp.mli
index 45834dade5..2d11cad86e 100644
--- a/lib/pp.mli
+++ b/lib/pp.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -10,7 +10,7 @@
(** Pretty printing guidelines ******************************************)
(* *)
-(* `Pp.t` or `Pp.std_ppcmds` is the main pretty printing document type *)
+(* `Pp.t` is the main pretty printing document type *)
(* in the Coq system. Documents are composed laying out boxes, and *)
(* users can add arbitrary tag metadata that backends are free *)
(* to interpret. *)
@@ -39,7 +39,9 @@ type pp_tag = string
(* Following discussion on #390, we play on the safe side and make the
internal representation opaque here. *)
type t
+
type std_ppcmds = t
+[@@ocaml.deprecated "alias of Pp.t"]
type block_type =
| Pp_hbox of int
@@ -58,124 +60,127 @@ type doc_view =
| Ppcmd_force_newline
| Ppcmd_comment of string list
-val repr : std_ppcmds -> doc_view
-val unrepr : doc_view -> std_ppcmds
+val repr : t -> doc_view
+val unrepr : doc_view -> t
(** {6 Formatting commands} *)
-val str : string -> std_ppcmds
-val brk : int * int -> std_ppcmds
-val fnl : unit -> std_ppcmds
-val ws : int -> std_ppcmds
-val mt : unit -> std_ppcmds
-val ismt : std_ppcmds -> bool
+val str : string -> t
+val brk : int * int -> t
+val fnl : unit -> t
+val ws : int -> t
+val mt : unit -> t
+val ismt : t -> bool
-val comment : string list -> std_ppcmds
+val comment : string list -> t
(** {6 Manipulation commands} *)
-val app : std_ppcmds -> std_ppcmds -> std_ppcmds
+val app : t -> t -> t
(** Concatenation. *)
-val seq : std_ppcmds list -> std_ppcmds
+val seq : t list -> t
(** Multi-Concatenation. *)
-val (++) : std_ppcmds -> std_ppcmds -> std_ppcmds
+val (++) : t -> t -> t
(** Infix alias for [app]. *)
(** {6 Derived commands} *)
-val spc : unit -> std_ppcmds
-val cut : unit -> std_ppcmds
-val align : unit -> std_ppcmds
-val int : int -> std_ppcmds
-val real : float -> std_ppcmds
-val bool : bool -> std_ppcmds
-val qstring : string -> std_ppcmds
-val qs : string -> std_ppcmds
-val quote : std_ppcmds -> std_ppcmds
-val strbrk : string -> std_ppcmds
+val spc : unit -> t
+val cut : unit -> t
+val align : unit -> t
+val int : int -> t
+val real : float -> t
+val bool : bool -> t
+val qstring : string -> t
+val qs : string -> t
+val quote : t -> t
+val strbrk : string -> t
(** {6 Boxing commands} *)
-val h : int -> std_ppcmds -> std_ppcmds
-val v : int -> std_ppcmds -> std_ppcmds
-val hv : int -> std_ppcmds -> std_ppcmds
-val hov : int -> std_ppcmds -> std_ppcmds
+val h : int -> t -> t
+val v : int -> t -> t
+val hv : int -> t -> t
+val hov : int -> t -> t
(** {6 Tagging} *)
-val tag : pp_tag -> std_ppcmds -> std_ppcmds
+val tag : pp_tag -> t -> t
(** {6 Printing combinators} *)
-val pr_comma : unit -> std_ppcmds
+val pr_comma : unit -> t
(** Well-spaced comma. *)
-val pr_semicolon : unit -> std_ppcmds
+val pr_semicolon : unit -> t
(** Well-spaced semicolon. *)
-val pr_bar : unit -> std_ppcmds
+val pr_bar : unit -> t
(** Well-spaced pipe bar. *)
-val pr_arg : ('a -> std_ppcmds) -> 'a -> std_ppcmds
+val pr_arg : ('a -> t) -> 'a -> t
(** Adds a space in front of its argument. *)
-val pr_non_empty_arg : ('a -> std_ppcmds) -> 'a -> std_ppcmds
+val pr_non_empty_arg : ('a -> t) -> 'a -> t
(** Adds a space in front of its argument if non empty. *)
-val pr_opt : ('a -> std_ppcmds) -> 'a option -> std_ppcmds
+val pr_opt : ('a -> t) -> 'a option -> t
(** Inner object preceded with a space if [Some], nothing otherwise. *)
-val pr_opt_no_spc : ('a -> std_ppcmds) -> 'a option -> std_ppcmds
+val pr_opt_no_spc : ('a -> t) -> 'a option -> t
(** Same as [pr_opt] but without the leading space. *)
-val pr_nth : int -> std_ppcmds
+val pr_nth : int -> t
(** Ordinal number with the correct suffix (i.e. "st", "nd", "th", etc.). *)
-val prlist : ('a -> std_ppcmds) -> 'a list -> std_ppcmds
+val prlist : ('a -> t) -> 'a list -> t
(** Concatenation of the list contents, without any separator.
Unlike all other functions below, [prlist] works lazily. If a strict
behavior is needed, use [prlist_strict] instead. *)
-val prlist_strict : ('a -> std_ppcmds) -> 'a list -> std_ppcmds
+val prlist_strict : ('a -> t) -> 'a list -> t
(** Same as [prlist], but strict. *)
val prlist_with_sep :
- (unit -> std_ppcmds) -> ('a -> std_ppcmds) -> 'a list -> std_ppcmds
+ (unit -> t) -> ('a -> t) -> 'a list -> t
(** [prlist_with_sep sep pr [a ; ... ; c]] outputs
- [pr a ++ sep() ++ ... ++ sep() ++ pr c]. *)
+ [pr a ++ sep () ++ ... ++ sep () ++ pr c].
+ where the thunk sep is memoized, rather than being called each place
+ its result is used.
+*)
-val prvect : ('a -> std_ppcmds) -> 'a array -> std_ppcmds
+val prvect : ('a -> t) -> 'a array -> t
(** As [prlist], but on arrays. *)
-val prvecti : (int -> 'a -> std_ppcmds) -> 'a array -> std_ppcmds
+val prvecti : (int -> 'a -> t) -> 'a array -> t
(** Indexed version of [prvect]. *)
val prvect_with_sep :
- (unit -> std_ppcmds) -> ('a -> std_ppcmds) -> 'a array -> std_ppcmds
+ (unit -> t) -> ('a -> t) -> 'a array -> t
(** As [prlist_with_sep], but on arrays. *)
val prvecti_with_sep :
- (unit -> std_ppcmds) -> (int -> 'a -> std_ppcmds) -> 'a array -> std_ppcmds
+ (unit -> t) -> (int -> 'a -> t) -> 'a array -> t
(** Indexed version of [prvect_with_sep]. *)
-val pr_enum : ('a -> std_ppcmds) -> 'a list -> std_ppcmds
+val pr_enum : ('a -> t) -> 'a list -> t
(** [pr_enum pr [a ; b ; ... ; c]] outputs
[pr a ++ str "," ++ pr b ++ str "," ++ ... ++ str "and" ++ pr c]. *)
-val pr_sequence : ('a -> std_ppcmds) -> 'a list -> std_ppcmds
+val pr_sequence : ('a -> t) -> 'a list -> t
(** Sequence of objects separated by space (unless an element is empty). *)
-val surround : std_ppcmds -> std_ppcmds
+val surround : t -> t
(** Surround with parenthesis. *)
-val pr_vertical_list : ('b -> std_ppcmds) -> 'b list -> std_ppcmds
+val pr_vertical_list : ('b -> t) -> 'b list -> t
(** {6 Main renderers, to formatter and to string } *)
(** [pp_with fmt pp] Print [pp] to [fmt] and don't flush [fmt] *)
-val pp_with : Format.formatter -> std_ppcmds -> unit
+val pp_with : Format.formatter -> t -> unit
-val string_of_ppcmds : std_ppcmds -> string
+val string_of_ppcmds : t -> string
diff --git a/lib/profile.ml b/lib/profile.ml
index d620fe69c4..0bc226a450 100644
--- a/lib/profile.ml
+++ b/lib/profile.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -85,6 +85,9 @@ let init_alloc = ref 0.0
let reset_profile () = List.iter reset_record !prof_table
let init_profile () =
+ (* We test Flags.profile as a way to support declaring profiled
+ functions in plugins *)
+ if !prof_table <> [] || Flags.profile then begin
let outside = create_record () in
stack := [outside];
last_alloc := get_alloc ();
@@ -92,6 +95,7 @@ let init_profile () =
init_time := get_time ();
outside.tottime <- - !init_time;
outside.owntime <- - !init_time
+ end
let ajoute n o =
o.owntime <- o.owntime + n.owntime;
@@ -317,15 +321,15 @@ let adjust_time ov_bc ov_ad e =
owntime = e.owntime - int_of_float (ad_imm +. bc_imm) }
let close_profile print =
- let dw = spent_alloc () in
- let t = get_time () in
- match !stack with
- | [outside] ->
- outside.tottime <- outside.tottime + t;
- outside.owntime <- outside.owntime + t;
- ajoute_ownalloc outside dw;
- ajoute_totalloc outside dw;
- if !prof_table <> [] then begin
+ if !prof_table <> [] then begin
+ let dw = spent_alloc () in
+ let t = get_time () in
+ match !stack with
+ | [outside] ->
+ outside.tottime <- outside.tottime + t;
+ outside.owntime <- outside.owntime + t;
+ ajoute_ownalloc outside dw;
+ ajoute_totalloc outside dw;
let ov_bc = time_overhead_B_C () (* B+C overhead *) in
let ov_ad = time_overhead_A_D () (* A+D overhead *) in
let adjust (n,e) = (n, adjust_time ov_bc ov_ad e) in
@@ -346,8 +350,8 @@ let close_profile print =
in
if print then format_profile updated_data;
init_profile ()
- end
- | _ -> failwith "Inconsistency"
+ | _ -> failwith "Inconsistency"
+ end
let print_profile () = close_profile true
@@ -358,9 +362,6 @@ let declare_profile name =
prof_table := (name,e)::!prof_table;
e
-(* Default initialization, may be overridden *)
-let _ = init_profile ()
-
(******************************)
(* Entry points for profiling *)
let profile1 e f a =
diff --git a/lib/profile.mli b/lib/profile.mli
index 3328d7ea3c..cae4397a11 100644
--- a/lib/profile.mli
+++ b/lib/profile.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/remoteCounter.ml b/lib/remoteCounter.ml
index 11f151a609..4358d6b2bc 100644
--- a/lib/remoteCounter.ml
+++ b/lib/remoteCounter.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/remoteCounter.mli b/lib/remoteCounter.mli
index 1b0fa6a00e..c262e50e5b 100644
--- a/lib/remoteCounter.mli
+++ b/lib/remoteCounter.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/rtree.ml b/lib/rtree.ml
index f89b98c046..6d3875fac4 100644
--- a/lib/rtree.ml
+++ b/lib/rtree.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/rtree.mli b/lib/rtree.mli
index e27134c3b6..1a916bbaf0 100644
--- a/lib/rtree.mli
+++ b/lib/rtree.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -78,7 +78,7 @@ val map : ('a -> 'b) -> 'a t -> 'b t
val smartmap : ('a -> 'a) -> 'a t -> 'a t
(** A rather simple minded pretty-printer *)
-val pp_tree : ('a -> Pp.std_ppcmds) -> 'a t -> Pp.std_ppcmds
+val pp_tree : ('a -> Pp.t) -> 'a t -> Pp.t
val eq_rtree : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
(** @deprecated Same as [Rtree.equal] *)
diff --git a/lib/spawn.ml b/lib/spawn.ml
index 4d7e78d861..0cf163e737 100644
--- a/lib/spawn.ml
+++ b/lib/spawn.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/spawn.mli b/lib/spawn.mli
index 9b86b09549..a131715e9d 100644
--- a/lib/spawn.mli
+++ b/lib/spawn.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/system.ml b/lib/system.ml
index e0e2c829d9..12eacf2eaf 100644
--- a/lib/system.ml
+++ b/lib/system.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/system.mli b/lib/system.mli
index 214369095c..7281de97c9 100644
--- a/lib/system.mli
+++ b/lib/system.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -96,7 +96,7 @@ type time
val get_time : unit -> time
val time_difference : time -> time -> float (** in seconds *)
-val fmt_time_difference : time -> time -> Pp.std_ppcmds
+val fmt_time_difference : time -> time -> Pp.t
val with_time : bool -> ('a -> 'b) -> 'a -> 'b
diff --git a/lib/terminal.ml b/lib/terminal.ml
index de21f10280..34efddfbca 100644
--- a/lib/terminal.ml
+++ b/lib/terminal.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -35,6 +35,8 @@ type style = {
italic : bool option;
underline : bool option;
negative : bool option;
+ prefix : string option;
+ suffix : string option;
}
let set o1 o2 = match o1 with
@@ -51,9 +53,11 @@ let default = {
italic = None;
underline = None;
negative = None;
+ prefix = None;
+ suffix = None;
}
-let make ?fg_color ?bg_color ?bold ?italic ?underline ?negative ?style () =
+let make ?fg_color ?bg_color ?bold ?italic ?underline ?negative ?style ?prefix ?suffix () =
let st = match style with
| None -> default
| Some st -> st
@@ -65,6 +69,8 @@ let make ?fg_color ?bg_color ?bold ?italic ?underline ?negative ?style () =
italic = set st.italic italic;
underline = set st.underline underline;
negative = set st.negative negative;
+ prefix = set st.prefix prefix;
+ suffix = set st.suffix suffix;
}
let merge s1 s2 =
@@ -75,6 +81,8 @@ let merge s1 s2 =
italic = set s1.italic s2.italic;
underline = set s1.underline s2.underline;
negative = set s1.negative s2.negative;
+ prefix = set s1.prefix s2.prefix;
+ suffix = set s1.suffix s2.suffix;
}
let base_color = function
@@ -168,6 +176,8 @@ let reset_style = {
italic = Some false;
underline = Some false;
negative = Some false;
+ prefix = None;
+ suffix = None;
}
let has_style t =
diff --git a/lib/terminal.mli b/lib/terminal.mli
index e0fd7f2284..b1b76e6e2a 100644
--- a/lib/terminal.mli
+++ b/lib/terminal.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -35,11 +35,14 @@ type style = {
italic : bool option;
underline : bool option;
negative : bool option;
+ prefix : string option;
+ suffix : string option;
}
val make : ?fg_color:color -> ?bg_color:color ->
?bold:bool -> ?italic:bool -> ?underline:bool ->
- ?negative:bool -> ?style:style -> unit -> style
+ ?negative:bool -> ?style:style ->
+ ?prefix:string -> ?suffix:string -> unit -> style
(** Create a style from the given flags. It is derived from the optional
[style] argument if given. *)
diff --git a/lib/trie.ml b/lib/trie.ml
index 0309fde9b2..0b0ba27613 100644
--- a/lib/trie.ml
+++ b/lib/trie.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/trie.mli b/lib/trie.mli
index de67e8f967..a87acc8a69 100644
--- a/lib/trie.mli
+++ b/lib/trie.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/unicode.mli b/lib/unicode.mli
index 2609e1968f..c7d7424801 100644
--- a/lib/unicode.mli
+++ b/lib/unicode.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/unionfind.ml b/lib/unionfind.ml
index 6e131d8fbd..f9c92d6a8e 100644
--- a/lib/unionfind.ml
+++ b/lib/unionfind.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/unionfind.mli b/lib/unionfind.mli
index ea249ae2e8..b242232edb 100644
--- a/lib/unionfind.mli
+++ b/lib/unionfind.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/util.mli b/lib/util.mli
index 56ec5394eb..d910e7e28e 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
diff --git a/lib/xml_datatype.mli b/lib/xml_datatype.mli
index a8e37935ba..c55f8c2f3e 100644
--- a/lib/xml_datatype.mli
+++ b/lib/xml_datatype.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)