diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-06-14 01:44:53 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-06-14 01:44:53 +0200 |
commit | 19330a458b907b5e66a967adbfe572d92194913c (patch) | |
tree | 2d3ffa4715224082dec3c9d6f8247881ca2b1f2c /library | |
parent | 95bdd608fa7862dc28cc7f4f95578ed1a20353eb (diff) | |
parent | d018d4148ef6cce96006bd76f83ccf46f6225e11 (diff) |
Merge branch "LtacProf for trunk" (PR #165).
Diffstat (limited to 'library')
-rw-r--r-- | library/declaremods.ml | 6 | ||||
-rw-r--r-- | library/declaremods.mli | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/library/declaremods.ml b/library/declaremods.ml index f3f734aa0..dcd63c769 100644 --- a/library/declaremods.ml +++ b/library/declaremods.ml @@ -897,7 +897,13 @@ let start_library dir = Lib.start_compilation dir mp; Lib.add_frozen_state () +let end_library_hook = ref ignore +let append_end_library_hook f = + let old_f = !end_library_hook in + end_library_hook := fun () -> old_f(); f () + let end_library ?except dir = + !end_library_hook(); let oname = Lib.end_compilation_checks dir in let mp,cenv,ast = Global.export ?except dir in let prefix, lib_stack = Lib.end_compilation oname in diff --git a/library/declaremods.mli b/library/declaremods.mli index 2b440c087..3917fe8d6 100644 --- a/library/declaremods.mli +++ b/library/declaremods.mli @@ -90,6 +90,9 @@ val end_library : ?except:Future.UUIDSet.t -> library_name -> Safe_typing.compiled_library * library_objects * Safe_typing.native_library +(** append a function to be executed at end_library *) +val append_end_library_hook : (unit -> unit) -> unit + (** [really_import_module mp] opens the module [mp] (in a Caml sense). It modifies Nametab and performs the [open_object] function for every object of the module. Raises [Not_found] when [mp] is unknown |