From 6b908b5185a55a27a82c2b0fce4713812adde156 Mon Sep 17 00:00:00 2001 From: mdenes Date: Tue, 22 Jan 2013 17:37:00 +0000 Subject: New implementation of the conversion test, using normalization by evaluation to native OCaml code. Warning: the "retroknowledge" mechanism has not been ported to the native compiler, because integers and persistent arrays will ultimately be defined as primitive constructions. Until then, computation on numbers may be faster using the VM, since it takes advantage of machine integers. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16136 85f007b7-540e-0410-9357-904b9bb8a0f7 --- library/declaremods.ml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'library/declaremods.ml') diff --git a/library/declaremods.ml b/library/declaremods.ml index 0d9ffb29e..99704d1c0 100644 --- a/library/declaremods.ml +++ b/library/declaremods.ml @@ -652,22 +652,27 @@ type library_objects = let register_library dir cenv objs digest = let mp = MPfile dir in - let substobjs, keep = + let substobjs, keep, values = try ignore(Global.lookup_module mp); (* if it's in the environment, the cached objects should be correct *) Dirmap.find dir !library_cache with Not_found -> - if not (mp_eq mp (Global.import cenv digest)) then + let mp', values = Global.import cenv digest in + if not (mp_eq mp mp') then anomaly "Unexpected disk module name"; let mp,substitute,keep = objs in let substobjs = [], mp, substitute in - let modobjs = substobjs, keep in + let modobjs = substobjs, keep, values in library_cache := Dirmap.add dir modobjs !library_cache; modobjs in do_module false "register_library" load_objects 1 dir mp substobjs keep +let get_library_symbols_tbl dir = + let _,_,values = Dirmap.find dir !library_cache in + values + let start_library dir = let mp = Global.start_library dir in openmod_info:=mp,[],None,[]; @@ -680,9 +685,9 @@ let set_end_library_hook f = end_library_hook := f let end_library dir = !end_library_hook(); let prefix, lib_stack = Lib.end_compilation dir in - let mp,cenv = Global.export dir in + let mp,cenv,ast = Global.export dir in let substitute, keep, _ = Lib.classify_segment lib_stack in - cenv,(mp,substitute,keep) + cenv,(mp,substitute,keep),ast (* implementation of Export M and Import M *) -- cgit v1.2.3