From d103a645df233dd40064e968fa8693607defa6a7 Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Fri, 23 May 2014 17:19:59 +0200 Subject: Extraction: discard unnecessary code inside modules without signatures In the case of an inner module without explicit signature, (and not used later in a functor application), we now extract only the needed items (used later or asked by the user), instead of blindly extracting all fields as earlier. --- plugins/extraction/modutil.ml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/extraction/modutil.ml') diff --git a/plugins/extraction/modutil.ml b/plugins/extraction/modutil.ml index e6bcefe22b..94f6f52cbe 100644 --- a/plugins/extraction/modutil.ml +++ b/plugins/extraction/modutil.ml @@ -197,6 +197,11 @@ let rec msig_of_ms = function let signature_of_structure s = List.map (fun (mp,ms) -> mp,msig_of_ms ms) s +let rec mtyp_of_mexpr = function + | MEfunctor (id,ty,e) -> MTfunsig (id,ty, mtyp_of_mexpr e) + | MEstruct (mp,str) -> MTsig (mp, msig_of_ms str) + | _ -> assert false + (*s Searching one [ml_decl] in a [ml_structure] by its [global_reference] *) -- cgit v1.2.3