1. HongboZhang
  2. ocaml

Commits

lefessan  committed 422c753

Fix problem of size of bin-annot files

- Reset most of the fields of Env.t when saving bin-annot files
- Move debugger/envaux.ml to typing/, and add a function to
recover environements from bin-annot files.
- Move tools/typedtreeIter.ml to typing/
- Move the code of typing/typedtreeMap.ml from cmt_format.ml

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12702f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

  • Participants
  • Parent commits 30f6ce0
  • Branches master

Comments (0)

Files changed (24)

File .depend

View file
     parsing/location.cmi parsing/lexer.cmi
 parsing/lexer.cmx : utils/warnings.cmx parsing/parser.cmx utils/misc.cmx \
     parsing/location.cmx parsing/lexer.cmi
-parsing/linenum.cmo : utils/misc.cmi
-parsing/linenum.cmx : utils/misc.cmx
 parsing/location.cmo : utils/warnings.cmi utils/terminfo.cmi \
     parsing/location.cmi
 parsing/location.cmx : utils/warnings.cmx utils/terminfo.cmx \
     typing/ident.cmi typing/env.cmi parsing/asttypes.cmi
 typing/datarepr.cmi : typing/types.cmi typing/path.cmi typing/ident.cmi \
     parsing/asttypes.cmi
-typing/env.cmi : utils/warnings.cmi typing/types.cmi utils/tbl.cmi \
-    typing/subst.cmi typing/path.cmi parsing/longident.cmi \
-    parsing/location.cmi typing/ident.cmi utils/consistbl.cmi \
-    typing/btype.cmi typing/annot.cmi
-typing/ident.cmti.cmi :
+typing/env.cmi : utils/warnings.cmi typing/types.cmi typing/subst.cmi \
+    typing/path.cmi parsing/longident.cmi parsing/location.cmi \
+    typing/ident.cmi utils/consistbl.cmi typing/annot.cmi
+typing/envaux.cmi : typing/path.cmi bytecomp/instruct.cmi typing/env.cmi
 typing/ident.cmi :
 typing/includeclass.cmi : typing/types.cmi typing/env.cmi typing/ctype.cmi
 typing/includecore.cmi : typing/types.cmi typing/typedtree.cmi \
 typing/typedtree.cmi : typing/types.cmi typing/primitive.cmi typing/path.cmi \
     parsing/longident.cmi parsing/location.cmi typing/ident.cmi \
     typing/env.cmi parsing/asttypes.cmi
+typing/typedtreeIter.cmi : typing/typedtree.cmi parsing/asttypes.cmi
+typing/typedtreeMap.cmi : typing/typedtree.cmi parsing/asttypes.cmi
 typing/typemod.cmi : typing/types.cmi typing/typedtree.cmi \
     parsing/parsetree.cmi parsing/longident.cmi parsing/location.cmi \
     typing/includemod.cmi typing/ident.cmi typing/env.cmi
     utils/config.cmi typing/cmi_format.cmi
 typing/cmi_format.cmx : typing/types.cmx utils/misc.cmx parsing/location.cmx \
     utils/config.cmx typing/cmi_format.cmi
-typing/cmt_format.cmo : typing/types.cmi typing/typedtree.cmi utils/misc.cmi \
-    parsing/location.cmi parsing/lexer.cmi typing/env.cmi utils/config.cmi \
-    typing/cmi_format.cmi utils/clflags.cmi typing/cmt_format.cmi
-typing/cmt_format.cmx : typing/types.cmx typing/typedtree.cmx utils/misc.cmx \
-    parsing/location.cmx parsing/lexer.cmx typing/env.cmx utils/config.cmx \
-    typing/cmi_format.cmx utils/clflags.cmx typing/cmt_format.cmi
+typing/cmt_format.cmo : typing/types.cmi typing/typedtreeMap.cmi \
+    typing/typedtree.cmi utils/misc.cmi parsing/location.cmi \
+    parsing/lexer.cmi typing/env.cmi utils/config.cmi typing/cmi_format.cmi \
+    utils/clflags.cmi typing/cmt_format.cmi
+typing/cmt_format.cmx : typing/types.cmx typing/typedtreeMap.cmx \
+    typing/typedtree.cmx utils/misc.cmx parsing/location.cmx \
+    parsing/lexer.cmx typing/env.cmx utils/config.cmx typing/cmi_format.cmx \
+    utils/clflags.cmx typing/cmt_format.cmi
 typing/ctype.cmo : typing/types.cmi typing/subst.cmi typing/path.cmi \
     utils/misc.cmi parsing/longident.cmi parsing/location.cmi \
     typing/ident.cmi typing/env.cmi utils/clflags.cmi typing/btype.cmi \
     utils/misc.cmx parsing/longident.cmx parsing/location.cmx \
     typing/ident.cmx typing/env.cmx utils/clflags.cmx typing/btype.cmx \
     parsing/asttypes.cmi typing/ctype.cmi
-typing/datarepr.cmo : typing/types.cmi typing/predef.cmi utils/misc.cmi \
-    typing/ident.cmi typing/btype.cmi parsing/asttypes.cmi \
-    typing/datarepr.cmi
-typing/datarepr.cmx : typing/types.cmx typing/predef.cmx utils/misc.cmx \
-    typing/ident.cmx typing/btype.cmx parsing/asttypes.cmi \
-    typing/datarepr.cmi
+typing/datarepr.cmo : typing/types.cmi typing/predef.cmi typing/ident.cmi \
+    typing/btype.cmi parsing/asttypes.cmi typing/datarepr.cmi
+typing/datarepr.cmx : typing/types.cmx typing/predef.cmx typing/ident.cmx \
+    typing/btype.cmx parsing/asttypes.cmi typing/datarepr.cmi
 typing/env.cmo : utils/warnings.cmi typing/types.cmi utils/tbl.cmi \
     typing/subst.cmi typing/predef.cmi typing/path.cmi utils/misc.cmi \
     parsing/longident.cmi parsing/location.cmi typing/ident.cmi \
     typing/datarepr.cmx utils/consistbl.cmx utils/config.cmx \
     typing/cmi_format.cmx utils/clflags.cmx typing/btype.cmx \
     parsing/asttypes.cmi typing/annot.cmi typing/env.cmi
-typing/ident.cmt.cmo :
-typing/ident.cmt.cmx :
+typing/envaux.cmo : typing/types.cmi typing/subst.cmi typing/printtyp.cmi \
+    typing/path.cmi typing/mtype.cmi utils/misc.cmi bytecomp/instruct.cmi \
+    typing/env.cmi typing/envaux.cmi
+typing/envaux.cmx : typing/types.cmx typing/subst.cmx typing/printtyp.cmx \
+    typing/path.cmx typing/mtype.cmx utils/misc.cmx bytecomp/instruct.cmx \
+    typing/env.cmx typing/envaux.cmi
 typing/ident.cmo : typing/ident.cmi
 typing/ident.cmx : typing/ident.cmi
 typing/includeclass.cmo : typing/types.cmi typing/printtyp.cmi \
     typing/types.cmi typing/typedtree.cmi typing/typedecl.cmi \
     typing/typecore.cmi typing/subst.cmi typing/stypes.cmi \
     typing/printtyp.cmi typing/predef.cmi typing/path.cmi \
-    parsing/parsetree.cmi typing/parmatch.cmi utils/misc.cmi \
-    parsing/longident.cmi parsing/location.cmi typing/includeclass.cmi \
-    typing/ident.cmi typing/env.cmi typing/ctype.cmi typing/cmt_format.cmi \
-    utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi \
-    typing/typeclass.cmi
+    parsing/parsetree.cmi typing/parmatch.cmi parsing/longident.cmi \
+    parsing/location.cmi typing/includeclass.cmi typing/ident.cmi \
+    typing/env.cmi typing/ctype.cmi typing/cmt_format.cmi utils/clflags.cmi \
+    typing/btype.cmi parsing/asttypes.cmi typing/typeclass.cmi
 typing/typeclass.cmx : utils/warnings.cmx typing/typetexp.cmx \
     typing/types.cmx typing/typedtree.cmx typing/typedecl.cmx \
     typing/typecore.cmx typing/subst.cmx typing/stypes.cmx \
     typing/printtyp.cmx typing/predef.cmx typing/path.cmx \
-    parsing/parsetree.cmi typing/parmatch.cmx utils/misc.cmx \
-    parsing/longident.cmx parsing/location.cmx typing/includeclass.cmx \
-    typing/ident.cmx typing/env.cmx typing/ctype.cmx typing/cmt_format.cmx \
-    utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi \
-    typing/typeclass.cmi
+    parsing/parsetree.cmi typing/parmatch.cmx parsing/longident.cmx \
+    parsing/location.cmx typing/includeclass.cmx typing/ident.cmx \
+    typing/env.cmx typing/ctype.cmx typing/cmt_format.cmx utils/clflags.cmx \
+    typing/btype.cmx parsing/asttypes.cmi typing/typeclass.cmi
 typing/typecore.cmo : utils/warnings.cmi typing/typetexp.cmi \
     typing/types.cmi typing/typedtree.cmi typing/subst.cmi typing/stypes.cmi \
     typing/printtyp.cmi typing/primitive.cmi typing/predef.cmi \
 typing/typedtree.cmx : typing/types.cmx typing/primitive.cmx typing/path.cmx \
     utils/misc.cmx parsing/longident.cmx parsing/location.cmx \
     typing/ident.cmx typing/env.cmx parsing/asttypes.cmi typing/typedtree.cmi
+typing/typedtreeIter.cmo : typing/typedtree.cmi utils/misc.cmi \
+    parsing/asttypes.cmi typing/typedtreeIter.cmi
+typing/typedtreeIter.cmx : typing/typedtree.cmx utils/misc.cmx \
+    parsing/asttypes.cmi typing/typedtreeIter.cmi
+typing/typedtreeMap.cmo : typing/typedtree.cmi utils/misc.cmi \
+    parsing/asttypes.cmi typing/typedtreeMap.cmi
+typing/typedtreeMap.cmx : typing/typedtree.cmx utils/misc.cmx \
+    parsing/asttypes.cmi typing/typedtreeMap.cmi
 typing/typemod.cmo : utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \
     typing/typedtree.cmi typing/typedecl.cmi typing/typecore.cmi \
     typing/typeclass.cmi typing/subst.cmi typing/stypes.cmi \
     typing/env.cmx typing/ctype.cmx utils/config.cmx typing/cmt_format.cmx \
     utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi typing/annot.cmi \
     typing/typemod.cmi
-typing/types.cmo : typing/primitive.cmi typing/path.cmi utils/misc.cmi \
+typing/types.cmo : typing/primitive.cmi typing/path.cmi \
     parsing/longident.cmi parsing/location.cmi typing/ident.cmi \
     parsing/asttypes.cmi typing/types.cmi
-typing/types.cmx : typing/primitive.cmx typing/path.cmx utils/misc.cmx \
+typing/types.cmx : typing/primitive.cmx typing/path.cmx \
     parsing/longident.cmx parsing/location.cmx typing/ident.cmx \
     parsing/asttypes.cmi typing/types.cmi
 typing/typetexp.cmo : utils/warnings.cmi typing/types.cmi \
 bytecomp/symtable.cmi : typing/ident.cmi bytecomp/cmo_format.cmi
 bytecomp/translclass.cmi : typing/typedtree.cmi parsing/location.cmi \
     bytecomp/lambda.cmi typing/ident.cmi parsing/asttypes.cmi
-bytecomp/translcore.cmi : typing/types.cmi typing/typedtree.cmi \
-    typing/primitive.cmi typing/path.cmi parsing/location.cmi \
-    bytecomp/lambda.cmi typing/ident.cmi parsing/asttypes.cmi
+bytecomp/translcore.cmi : typing/typedtree.cmi typing/primitive.cmi \
+    typing/path.cmi parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi \
+    parsing/asttypes.cmi
 bytecomp/translmod.cmi : typing/typedtree.cmi typing/primitive.cmi \
     parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi
 bytecomp/translobj.cmi : bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi
     typing/primitive.cmx utils/misc.cmx bytecomp/lambda.cmx \
     bytecomp/instruct.cmx typing/ident.cmx utils/config.cmx \
     parsing/asttypes.cmi bytecomp/bytegen.cmi
-bytecomp/bytelibrarian.cmo : utils/misc.cmi utils/config.cmi \
-    bytecomp/cmo_format.cmi utils/clflags.cmi bytecomp/bytelink.cmi \
-    bytecomp/bytelibrarian.cmi
-bytecomp/bytelibrarian.cmx : utils/misc.cmx utils/config.cmx \
-    bytecomp/cmo_format.cmi utils/clflags.cmx bytecomp/bytelink.cmx \
-    bytecomp/bytelibrarian.cmi
+bytecomp/bytelibrarian.cmo : utils/misc.cmi parsing/location.cmi \
+    utils/config.cmi bytecomp/cmo_format.cmi utils/clflags.cmi \
+    bytecomp/bytelink.cmi bytecomp/bytelibrarian.cmi
+bytecomp/bytelibrarian.cmx : utils/misc.cmx parsing/location.cmx \
+    utils/config.cmx bytecomp/cmo_format.cmi utils/clflags.cmx \
+    bytecomp/bytelink.cmx bytecomp/bytelibrarian.cmi
 bytecomp/bytelink.cmo : utils/warnings.cmi bytecomp/symtable.cmi \
-    bytecomp/opcodes.cmo utils/misc.cmi parsing/location.cmi \
-    bytecomp/instruct.cmi typing/ident.cmi bytecomp/dll.cmi \
-    utils/consistbl.cmi utils/config.cmi bytecomp/cmo_format.cmi \
-    utils/clflags.cmi utils/ccomp.cmi bytecomp/bytesections.cmi \
-    bytecomp/bytelink.cmi
+    bytecomp/opcodes.cmo utils/misc.cmi parsing/location.cmi typing/ident.cmi \
+    bytecomp/dll.cmi utils/consistbl.cmi utils/config.cmi \
+    bytecomp/cmo_format.cmi utils/clflags.cmi utils/ccomp.cmi \
+    bytecomp/bytesections.cmi bytecomp/bytelink.cmi
 bytecomp/bytelink.cmx : utils/warnings.cmx bytecomp/symtable.cmx \
-    bytecomp/opcodes.cmx utils/misc.cmx parsing/location.cmx \
-    bytecomp/instruct.cmx typing/ident.cmx bytecomp/dll.cmx \
-    utils/consistbl.cmx utils/config.cmx bytecomp/cmo_format.cmi \
-    utils/clflags.cmx utils/ccomp.cmx bytecomp/bytesections.cmx \
-    bytecomp/bytelink.cmi
+    bytecomp/opcodes.cmx utils/misc.cmx parsing/location.cmx typing/ident.cmx \
+    bytecomp/dll.cmx utils/consistbl.cmx utils/config.cmx \
+    bytecomp/cmo_format.cmi utils/clflags.cmx utils/ccomp.cmx \
+    bytecomp/bytesections.cmx bytecomp/bytelink.cmi
 bytecomp/bytepackager.cmo : typing/typemod.cmi bytecomp/translmod.cmi \
-    typing/subst.cmi typing/path.cmi utils/misc.cmi bytecomp/instruct.cmi \
-    typing/ident.cmi typing/env.cmi bytecomp/emitcode.cmi utils/config.cmi \
-    bytecomp/cmo_format.cmi utils/clflags.cmi bytecomp/bytelink.cmi \
-    bytecomp/bytegen.cmi bytecomp/bytepackager.cmi
+    typing/subst.cmi typing/path.cmi utils/misc.cmi parsing/location.cmi \
+    bytecomp/instruct.cmi typing/ident.cmi typing/env.cmi \
+    bytecomp/emitcode.cmi utils/config.cmi bytecomp/cmo_format.cmi \
+    utils/clflags.cmi bytecomp/bytelink.cmi bytecomp/bytegen.cmi \
+    bytecomp/bytepackager.cmi
 bytecomp/bytepackager.cmx : typing/typemod.cmx bytecomp/translmod.cmx \
-    typing/subst.cmx typing/path.cmx utils/misc.cmx bytecomp/instruct.cmx \
-    typing/ident.cmx typing/env.cmx bytecomp/emitcode.cmx utils/config.cmx \
-    bytecomp/cmo_format.cmi utils/clflags.cmx bytecomp/bytelink.cmx \
-    bytecomp/bytegen.cmx bytecomp/bytepackager.cmi
+    typing/subst.cmx typing/path.cmx utils/misc.cmx parsing/location.cmx \
+    bytecomp/instruct.cmx typing/ident.cmx typing/env.cmx \
+    bytecomp/emitcode.cmx utils/config.cmx bytecomp/cmo_format.cmi \
+    utils/clflags.cmx bytecomp/bytelink.cmx bytecomp/bytegen.cmx \
+    bytecomp/bytepackager.cmi
 bytecomp/bytesections.cmo : utils/misc.cmi utils/config.cmi \
     bytecomp/bytesections.cmi
 bytecomp/bytesections.cmx : utils/misc.cmx utils/config.cmx \
     bytecomp/symtable.cmi
 bytecomp/translclass.cmo : typing/types.cmi bytecomp/typeopt.cmi \
     typing/typedtree.cmi bytecomp/translobj.cmi bytecomp/translcore.cmi \
-    typing/path.cmi utils/misc.cmi bytecomp/matching.cmi parsing/location.cmi \
+    typing/path.cmi bytecomp/matching.cmi parsing/location.cmi \
     bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi utils/clflags.cmi \
     typing/btype.cmi parsing/asttypes.cmi bytecomp/translclass.cmi
 bytecomp/translclass.cmx : typing/types.cmx bytecomp/typeopt.cmx \
     typing/typedtree.cmx bytecomp/translobj.cmx bytecomp/translcore.cmx \
-    typing/path.cmx utils/misc.cmx bytecomp/matching.cmx parsing/location.cmx \
+    typing/path.cmx bytecomp/matching.cmx parsing/location.cmx \
     bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx utils/clflags.cmx \
     typing/btype.cmx parsing/asttypes.cmi bytecomp/translclass.cmi
 bytecomp/translcore.cmo : typing/types.cmi bytecomp/typeopt.cmi \
     utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi \
     bytecomp/translobj.cmi
 bytecomp/typeopt.cmo : typing/types.cmi typing/typedtree.cmi \
-    typing/primitive.cmi typing/predef.cmi typing/path.cmi utils/misc.cmi \
-    bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi typing/ctype.cmi \
-    parsing/asttypes.cmi bytecomp/typeopt.cmi
+    typing/predef.cmi typing/path.cmi bytecomp/lambda.cmi typing/ident.cmi \
+    typing/env.cmi typing/ctype.cmi bytecomp/typeopt.cmi
 bytecomp/typeopt.cmx : typing/types.cmx typing/typedtree.cmx \
-    typing/primitive.cmx typing/predef.cmx typing/path.cmx utils/misc.cmx \
-    bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx typing/ctype.cmx \
-    parsing/asttypes.cmi bytecomp/typeopt.cmi
+    typing/predef.cmx typing/path.cmx bytecomp/lambda.cmx typing/ident.cmx \
+    typing/env.cmx typing/ctype.cmx bytecomp/typeopt.cmi
 asmcomp/asmgen.cmi : bytecomp/lambda.cmi asmcomp/cmm.cmi
 asmcomp/asmlibrarian.cmi :
 asmcomp/asmlink.cmi : asmcomp/cmx_format.cmi
     asmcomp/spill.cmi asmcomp/selection.cmi asmcomp/scheduling.cmi \
     asmcomp/reload.cmi asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/printmach.cmi \
     asmcomp/printlinear.cmi asmcomp/printcmm.cmi typing/primitive.cmi \
-    utils/misc.cmi asmcomp/mach.cmi asmcomp/liveness.cmi \
+    utils/misc.cmi asmcomp/mach.cmi parsing/location.cmi asmcomp/liveness.cmi \
     asmcomp/linearize.cmi asmcomp/interf.cmi asmcomp/emitaux.cmi \
     asmcomp/emit.cmi utils/config.cmi asmcomp/compilenv.cmi \
     asmcomp/comballoc.cmi asmcomp/coloring.cmi asmcomp/cmmgen.cmi \
     asmcomp/spill.cmx asmcomp/selection.cmx asmcomp/scheduling.cmx \
     asmcomp/reload.cmx asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/printmach.cmx \
     asmcomp/printlinear.cmx asmcomp/printcmm.cmx typing/primitive.cmx \
-    utils/misc.cmx asmcomp/mach.cmx asmcomp/liveness.cmx \
+    utils/misc.cmx asmcomp/mach.cmx parsing/location.cmx asmcomp/liveness.cmx \
     asmcomp/linearize.cmx asmcomp/interf.cmx asmcomp/emitaux.cmx \
     asmcomp/emit.cmx utils/config.cmx asmcomp/compilenv.cmx \
     asmcomp/comballoc.cmx asmcomp/coloring.cmx asmcomp/cmmgen.cmx \
     asmcomp/cmx_format.cmi asmcomp/cmmgen.cmx utils/clflags.cmx \
     utils/ccomp.cmx asmcomp/asmgen.cmx asmcomp/asmlink.cmi
 asmcomp/asmpackager.cmo : typing/typemod.cmi bytecomp/translmod.cmi \
-    utils/misc.cmi parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi \
-    typing/env.cmi utils/config.cmi asmcomp/compilenv.cmi \
-    asmcomp/cmx_format.cmi utils/clflags.cmi asmcomp/clambda.cmi \
-    utils/ccomp.cmi asmcomp/asmlink.cmi asmcomp/asmgen.cmi \
+    utils/misc.cmi parsing/location.cmi typing/ident.cmi typing/env.cmi \
+    utils/config.cmi asmcomp/compilenv.cmi asmcomp/cmx_format.cmi \
+    utils/clflags.cmi utils/ccomp.cmi asmcomp/asmlink.cmi asmcomp/asmgen.cmi \
     asmcomp/asmpackager.cmi
 asmcomp/asmpackager.cmx : typing/typemod.cmx bytecomp/translmod.cmx \
-    utils/misc.cmx parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx \
-    typing/env.cmx utils/config.cmx asmcomp/compilenv.cmx \
-    asmcomp/cmx_format.cmi utils/clflags.cmx asmcomp/clambda.cmx \
-    utils/ccomp.cmx asmcomp/asmlink.cmx asmcomp/asmgen.cmx \
+    utils/misc.cmx parsing/location.cmx typing/ident.cmx typing/env.cmx \
+    utils/config.cmx asmcomp/compilenv.cmx asmcomp/cmx_format.cmi \
+    utils/clflags.cmx utils/ccomp.cmx asmcomp/asmlink.cmx asmcomp/asmgen.cmx \
     asmcomp/asmpackager.cmi
 asmcomp/clambda.cmo : bytecomp/lambda.cmi typing/ident.cmi \
     asmcomp/debuginfo.cmi parsing/asttypes.cmi asmcomp/clambda.cmi
     asmcomp/cmm.cmi
 asmcomp/cmm.cmx : typing/ident.cmx asmcomp/debuginfo.cmx asmcomp/arch.cmx \
     asmcomp/cmm.cmi
-asmcomp/cmmgen.cmo : typing/types.cmi bytecomp/switch.cmi asmcomp/proc.cmi \
+asmcomp/cmmgen.cmo : bytecomp/switch.cmi asmcomp/proc.cmi \
     typing/primitive.cmi utils/misc.cmi bytecomp/lambda.cmi typing/ident.cmi \
     asmcomp/debuginfo.cmi utils/config.cmi asmcomp/compilenv.cmi \
     asmcomp/cmx_format.cmi asmcomp/cmm.cmi utils/clflags.cmi \
     asmcomp/clambda.cmi parsing/asttypes.cmi asmcomp/arch.cmo \
     asmcomp/cmmgen.cmi
-asmcomp/cmmgen.cmx : typing/types.cmx bytecomp/switch.cmx asmcomp/proc.cmx \
+asmcomp/cmmgen.cmx : bytecomp/switch.cmx asmcomp/proc.cmx \
     typing/primitive.cmx utils/misc.cmx bytecomp/lambda.cmx typing/ident.cmx \
     asmcomp/debuginfo.cmx utils/config.cmx asmcomp/compilenv.cmx \
     asmcomp/cmx_format.cmi asmcomp/cmm.cmx utils/clflags.cmx \
     asmcomp/arch.cmo asmcomp/comballoc.cmi
 asmcomp/comballoc.cmx : asmcomp/reg.cmx asmcomp/mach.cmx utils/config.cmx \
     asmcomp/arch.cmx asmcomp/comballoc.cmi
-asmcomp/compilenv.cmo : utils/misc.cmi bytecomp/lambda.cmi typing/ident.cmi \
-    typing/env.cmi utils/config.cmi asmcomp/cmx_format.cmi \
-    asmcomp/clambda.cmi asmcomp/compilenv.cmi
-asmcomp/compilenv.cmx : utils/misc.cmx bytecomp/lambda.cmx typing/ident.cmx \
-    typing/env.cmx utils/config.cmx asmcomp/cmx_format.cmi \
-    asmcomp/clambda.cmx asmcomp/compilenv.cmi
+asmcomp/compilenv.cmo : utils/misc.cmi parsing/location.cmi \
+    bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi utils/config.cmi \
+    asmcomp/cmx_format.cmi asmcomp/clambda.cmi asmcomp/compilenv.cmi
+asmcomp/compilenv.cmx : utils/misc.cmx parsing/location.cmx \
+    bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx utils/config.cmx \
+    asmcomp/cmx_format.cmi asmcomp/clambda.cmx asmcomp/compilenv.cmi
 asmcomp/debuginfo.cmo : parsing/location.cmi bytecomp/lambda.cmi \
     asmcomp/debuginfo.cmi
 asmcomp/debuginfo.cmx : parsing/location.cmx bytecomp/lambda.cmx \
     asmcomp/mach.cmx asmcomp/linearize.cmx asmcomp/emitaux.cmx \
     asmcomp/debuginfo.cmx utils/config.cmx asmcomp/compilenv.cmx \
     asmcomp/cmm.cmx utils/clflags.cmx asmcomp/arch.cmx asmcomp/emit.cmi
-asmcomp/emitaux.cmo : asmcomp/reg.cmi asmcomp/linearize.cmi \
-    asmcomp/debuginfo.cmi utils/config.cmi asmcomp/cmm.cmi utils/clflags.cmi \
-    asmcomp/arch.cmo asmcomp/emitaux.cmi
-asmcomp/emitaux.cmx : asmcomp/reg.cmx asmcomp/linearize.cmx \
-    asmcomp/debuginfo.cmx utils/config.cmx asmcomp/cmm.cmx utils/clflags.cmx \
-    asmcomp/arch.cmx asmcomp/emitaux.cmi
-asmcomp/interf.cmo : asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \
-    asmcomp/mach.cmi asmcomp/interf.cmi
-asmcomp/interf.cmx : asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \
-    asmcomp/mach.cmx asmcomp/interf.cmi
+asmcomp/emitaux.cmo : asmcomp/debuginfo.cmi utils/config.cmi \
+    utils/clflags.cmi asmcomp/arch.cmo asmcomp/emitaux.cmi
+asmcomp/emitaux.cmx : asmcomp/debuginfo.cmx utils/config.cmx \
+    utils/clflags.cmx asmcomp/arch.cmx asmcomp/emitaux.cmi
+asmcomp/interf.cmo : asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/mach.cmi \
+    asmcomp/interf.cmi
+asmcomp/interf.cmx : asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/mach.cmx \
+    asmcomp/interf.cmi
 asmcomp/linearize.cmo : asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \
     asmcomp/mach.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \
     asmcomp/linearize.cmi
 asmcomp/mach.cmx : asmcomp/reg.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx \
     asmcomp/arch.cmx asmcomp/mach.cmi
 asmcomp/printclambda.cmo : bytecomp/printlambda.cmi bytecomp/lambda.cmi \
-    typing/ident.cmi asmcomp/debuginfo.cmi asmcomp/clambda.cmi \
-    parsing/asttypes.cmi asmcomp/printclambda.cmi
+    typing/ident.cmi asmcomp/clambda.cmi parsing/asttypes.cmi \
+    asmcomp/printclambda.cmi
 asmcomp/printclambda.cmx : bytecomp/printlambda.cmx bytecomp/lambda.cmx \
-    typing/ident.cmx asmcomp/debuginfo.cmx asmcomp/clambda.cmx \
-    parsing/asttypes.cmi asmcomp/printclambda.cmi
+    typing/ident.cmx asmcomp/clambda.cmx parsing/asttypes.cmi \
+    asmcomp/printclambda.cmi
 asmcomp/printcmm.cmo : typing/ident.cmi asmcomp/debuginfo.cmi \
     asmcomp/cmm.cmi asmcomp/printcmm.cmi
 asmcomp/printcmm.cmx : typing/ident.cmx asmcomp/debuginfo.cmx \
     asmcomp/reloadgen.cmi
 asmcomp/reloadgen.cmx : asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \
     asmcomp/reloadgen.cmi
-asmcomp/schedgen.cmo : asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \
+asmcomp/schedgen.cmo : asmcomp/reg.cmi asmcomp/mach.cmi \
     asmcomp/linearize.cmi asmcomp/cmm.cmi asmcomp/arch.cmo \
     asmcomp/schedgen.cmi
-asmcomp/schedgen.cmx : asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \
+asmcomp/schedgen.cmx : asmcomp/reg.cmx asmcomp/mach.cmx \
     asmcomp/linearize.cmx asmcomp/cmm.cmx asmcomp/arch.cmx \
     asmcomp/schedgen.cmi
 asmcomp/scheduling.cmo : asmcomp/schedgen.cmi asmcomp/scheduling.cmi
     asmcomp/proc.cmx utils/misc.cmx asmcomp/mach.cmx typing/ident.cmx \
     asmcomp/debuginfo.cmx asmcomp/cmm.cmx asmcomp/arch.cmx \
     asmcomp/selectgen.cmi
-asmcomp/selection.cmo : asmcomp/selectgen.cmi asmcomp/reg.cmi \
-    asmcomp/proc.cmi utils/misc.cmi asmcomp/mach.cmi asmcomp/cmm.cmi \
-    utils/clflags.cmi asmcomp/arch.cmo asmcomp/selection.cmi
-asmcomp/selection.cmx : asmcomp/selectgen.cmx asmcomp/reg.cmx \
-    asmcomp/proc.cmx utils/misc.cmx asmcomp/mach.cmx asmcomp/cmm.cmx \
-    utils/clflags.cmx asmcomp/arch.cmx asmcomp/selection.cmi
+asmcomp/selection.cmo : asmcomp/selectgen.cmi asmcomp/proc.cmi \
+    utils/misc.cmi asmcomp/mach.cmi asmcomp/cmm.cmi utils/clflags.cmi \
+    asmcomp/arch.cmo asmcomp/selection.cmi
+asmcomp/selection.cmx : asmcomp/selectgen.cmx asmcomp/proc.cmx \
+    utils/misc.cmx asmcomp/mach.cmx asmcomp/cmm.cmx utils/clflags.cmx \
+    asmcomp/arch.cmx asmcomp/selection.cmi
 asmcomp/spill.cmo : asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \
     asmcomp/mach.cmi asmcomp/spill.cmi
 asmcomp/spill.cmx : asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \
 driver/optmain.cmi :
 driver/pparse.cmi :
 driver/compile.cmo : utils/warnings.cmi typing/typemod.cmi \
-    typing/typedtree.cmi bytecomp/translmod.cmi typing/stypes.cmi \
-    bytecomp/simplif.cmi typing/printtyp.cmi bytecomp/printlambda.cmi \
-    bytecomp/printinstr.cmi parsing/printast.cmi driver/pparse.cmi \
-    parsing/parse.cmi utils/misc.cmi parsing/location.cmi typing/ident.cmi \
-    typing/env.cmi bytecomp/emitcode.cmi utils/config.cmi utils/clflags.cmi \
-    utils/ccomp.cmi bytecomp/bytegen.cmi driver/compile.cmi
+    typing/typedtree.cmi typing/typecore.cmi bytecomp/translmod.cmi \
+    typing/stypes.cmi bytecomp/simplif.cmi typing/printtyp.cmi \
+    bytecomp/printlambda.cmi bytecomp/printinstr.cmi parsing/printast.cmi \
+    driver/pparse.cmi parsing/parse.cmi utils/misc.cmi parsing/location.cmi \
+    typing/includemod.cmi typing/ident.cmi typing/env.cmi \
+    bytecomp/emitcode.cmi utils/config.cmi utils/clflags.cmi utils/ccomp.cmi \
+    bytecomp/bytegen.cmi driver/compile.cmi
 driver/compile.cmx : utils/warnings.cmx typing/typemod.cmx \
-    typing/typedtree.cmx bytecomp/translmod.cmx typing/stypes.cmx \
-    bytecomp/simplif.cmx typing/printtyp.cmx bytecomp/printlambda.cmx \
-    bytecomp/printinstr.cmx parsing/printast.cmx driver/pparse.cmx \
-    parsing/parse.cmx utils/misc.cmx parsing/location.cmx typing/ident.cmx \
-    typing/env.cmx bytecomp/emitcode.cmx utils/config.cmx utils/clflags.cmx \
-    utils/ccomp.cmx bytecomp/bytegen.cmx driver/compile.cmi
+    typing/typedtree.cmx typing/typecore.cmx bytecomp/translmod.cmx \
+    typing/stypes.cmx bytecomp/simplif.cmx typing/printtyp.cmx \
+    bytecomp/printlambda.cmx bytecomp/printinstr.cmx parsing/printast.cmx \
+    driver/pparse.cmx parsing/parse.cmx utils/misc.cmx parsing/location.cmx \
+    typing/includemod.cmx typing/ident.cmx typing/env.cmx \
+    bytecomp/emitcode.cmx utils/config.cmx utils/clflags.cmx utils/ccomp.cmx \
+    bytecomp/bytegen.cmx driver/compile.cmi
 driver/errors.cmo : utils/warnings.cmi typing/typetexp.cmi \
     typing/typemod.cmi typing/typedecl.cmi typing/typecore.cmi \
     typing/typeclass.cmi bytecomp/translmod.cmi bytecomp/translcore.cmi \
 driver/main_args.cmo : utils/warnings.cmi driver/main_args.cmi
 driver/main_args.cmx : utils/warnings.cmx driver/main_args.cmi
 driver/optcompile.cmo : utils/warnings.cmi typing/typemod.cmi \
-    typing/typedtree.cmi bytecomp/translmod.cmi typing/stypes.cmi \
-    bytecomp/simplif.cmi typing/printtyp.cmi bytecomp/printlambda.cmi \
-    parsing/printast.cmi driver/pparse.cmi parsing/parse.cmi utils/misc.cmi \
-    parsing/location.cmi typing/ident.cmi typing/env.cmi utils/config.cmi \
+    typing/typedtree.cmi typing/typecore.cmi bytecomp/translmod.cmi \
+    typing/stypes.cmi bytecomp/simplif.cmi typing/printtyp.cmi \
+    bytecomp/printlambda.cmi parsing/printast.cmi driver/pparse.cmi \
+    parsing/parse.cmi utils/misc.cmi parsing/location.cmi \
+    typing/includemod.cmi typing/ident.cmi typing/env.cmi utils/config.cmi \
     asmcomp/compilenv.cmi utils/clflags.cmi utils/ccomp.cmi \
     asmcomp/asmgen.cmi driver/optcompile.cmi
 driver/optcompile.cmx : utils/warnings.cmx typing/typemod.cmx \
-    typing/typedtree.cmx bytecomp/translmod.cmx typing/stypes.cmx \
-    bytecomp/simplif.cmx typing/printtyp.cmx bytecomp/printlambda.cmx \
-    parsing/printast.cmx driver/pparse.cmx parsing/parse.cmx utils/misc.cmx \
-    parsing/location.cmx typing/ident.cmx typing/env.cmx utils/config.cmx \
+    typing/typedtree.cmx typing/typecore.cmx bytecomp/translmod.cmx \
+    typing/stypes.cmx bytecomp/simplif.cmx typing/printtyp.cmx \
+    bytecomp/printlambda.cmx parsing/printast.cmx driver/pparse.cmx \
+    parsing/parse.cmx utils/misc.cmx parsing/location.cmx \
+    typing/includemod.cmx typing/ident.cmx typing/env.cmx utils/config.cmx \
     asmcomp/compilenv.cmx utils/clflags.cmx utils/ccomp.cmx \
     asmcomp/asmgen.cmx driver/optcompile.cmi
 driver/opterrors.cmo : utils/warnings.cmi typing/typetexp.cmi \
     parsing/printast.cmi typing/predef.cmi typing/path.cmi \
     parsing/parsetree.cmi parsing/parse.cmi typing/outcometree.cmi \
     typing/oprint.cmi utils/misc.cmi bytecomp/meta.cmi parsing/longident.cmi \
-    parsing/location.cmi parsing/lexer.cmi typing/ident.cmi \
-    toplevel/genprintval.cmi driver/errors.cmi typing/env.cmi \
-    bytecomp/emitcode.cmi bytecomp/dll.cmi utils/consistbl.cmi \
+    parsing/location.cmi parsing/lexer.cmi typing/includemod.cmi \
+    typing/ident.cmi toplevel/genprintval.cmi driver/errors.cmi \
+    typing/env.cmi bytecomp/emitcode.cmi bytecomp/dll.cmi utils/consistbl.cmi \
     utils/config.cmi driver/compile.cmi utils/clflags.cmi \
     bytecomp/bytegen.cmi typing/btype.cmi toplevel/toploop.cmi
 toplevel/toploop.cmx : utils/warnings.cmx typing/types.cmx \
     parsing/printast.cmx typing/predef.cmx typing/path.cmx \
     parsing/parsetree.cmi parsing/parse.cmx typing/outcometree.cmi \
     typing/oprint.cmx utils/misc.cmx bytecomp/meta.cmx parsing/longident.cmx \
-    parsing/location.cmx parsing/lexer.cmx typing/ident.cmx \
-    toplevel/genprintval.cmx driver/errors.cmx typing/env.cmx \
-    bytecomp/emitcode.cmx bytecomp/dll.cmx utils/consistbl.cmx \
+    parsing/location.cmx parsing/lexer.cmx typing/includemod.cmx \
+    typing/ident.cmx toplevel/genprintval.cmx driver/errors.cmx \
+    typing/env.cmx bytecomp/emitcode.cmx bytecomp/dll.cmx utils/consistbl.cmx \
     utils/config.cmx driver/compile.cmx utils/clflags.cmx \
     bytecomp/bytegen.cmx typing/btype.cmx toplevel/toploop.cmi
 toplevel/topmain.cmo : utils/warnings.cmi toplevel/toploop.cmi \

File Changes

View file
 - PR#5551: Avoid repeated lookups for missing cmi files
 - PR#5662: typo in md5.c
 
+Internals:
+- Moved debugger/envaux.ml to typing/envaux.ml to publish env_of_only_summary
+   as part of compilerlibs, to be used on bin-annot files.
+
 OCaml 4.00.0:
 -------------
 

File Makefile

View file
   typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo \
   typing/typedtree.cmo typing/printtyped.cmo typing/ctype.cmo \
   typing/printtyp.cmo typing/includeclass.cmo \
-  typing/mtype.cmo typing/includecore.cmo \
+  typing/mtype.cmo typing/envaux.cmo typing/includecore.cmo \
   typing/includemod.cmo typing/typetexp.cmo typing/parmatch.cmo \
-  typing/cmt_format.cmo typing/stypes.cmo typing/typecore.cmo \
+  typing/typedtreeIter.cmo typing/typedtreeMap.cmo typing/cmt_format.cmo \
+  typing/stypes.cmo typing/typecore.cmo \
   typing/typedecl.cmo typing/typeclass.cmo \
   typing/typemod.cmo
 

File Makefile.nt

View file
   typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo \
   typing/typedtree.cmo typing/ctype.cmo \
   typing/printtyp.cmo typing/includeclass.cmo \
-  typing/mtype.cmo typing/includecore.cmo \
+  typing/mtype.cmo typing/envaux.cmo typing/includecore.cmo \
   typing/includemod.cmo typing/parmatch.cmo \
   typing/typetexp.cmo \
-  typing/cmt_format.cmo typing/stypes.cmo typing/typecore.cmo \
+  typing/typedtreeIter.cmo typing/typedtreeMap.cmo typing/cmt_format.cmo \
+  typing/stypes.cmo typing/typecore.cmo \
   typing/typedecl.cmo typing/typeclass.cmo \
   typing/typemod.cmo
 

File debugger/.depend

View file
-breakpoints.cmi: primitives.cmi ../bytecomp/instruct.cmi
-checkpoints.cmi: primitives.cmi debugcom.cmi
-command_line.cmi:
-debugcom.cmi: primitives.cmi
-debugger_config.cmi:
-dynlink.cmi:
-envaux.cmi: ../typing/path.cmi ../bytecomp/instruct.cmi ../typing/env.cmi
-eval.cmi: ../typing/types.cmi ../typing/path.cmi parser_aux.cmi \
+breakpoints.cmi : primitives.cmi ../bytecomp/instruct.cmi
+checkpoints.cmi : primitives.cmi debugcom.cmi
+command_line.cmi :
+debugcom.cmi : primitives.cmi
+debugger_config.cmi :
+dynlink.cmi :
+eval.cmi : ../typing/types.cmi ../typing/path.cmi parser_aux.cmi \
     ../parsing/longident.cmi ../bytecomp/instruct.cmi ../typing/ident.cmi \
     ../typing/env.cmi debugcom.cmi
-events.cmi: ../bytecomp/instruct.cmi
-exec.cmi:
-frames.cmi: primitives.cmi ../bytecomp/instruct.cmi
-history.cmi:
-input_handling.cmi: primitives.cmi
-int64ops.cmi:
-lexer.cmi: parser.cmi
-loadprinter.cmi: ../parsing/longident.cmi dynlink.cmi
-parameters.cmi:
-parser.cmi: parser_aux.cmi ../parsing/longident.cmi
-parser_aux.cmi: primitives.cmi ../parsing/longident.cmi
-pattern_matching.cmi: ../typing/typedtree.cmi parser_aux.cmi debugcom.cmi
-pos.cmi: ../bytecomp/instruct.cmi
-primitives.cmi: $(UNIXDIR)/unix.cmi
-printval.cmi: ../typing/types.cmi ../typing/path.cmi parser_aux.cmi \
+events.cmi : ../bytecomp/instruct.cmi
+exec.cmi :
+frames.cmi : primitives.cmi ../bytecomp/instruct.cmi
+history.cmi :
+input_handling.cmi : primitives.cmi
+int64ops.cmi :
+lexer.cmi : parser.cmi
+loadprinter.cmi : ../parsing/longident.cmi dynlink.cmi
+parameters.cmi :
+parser.cmi : parser_aux.cmi ../parsing/longident.cmi
+parser_aux.cmi : primitives.cmi ../parsing/longident.cmi
+pattern_matching.cmi : ../typing/typedtree.cmi parser_aux.cmi debugcom.cmi
+pos.cmi : ../bytecomp/instruct.cmi
+primitives.cmi : $(UNIXDIR)/unix.cmi
+printval.cmi : ../typing/types.cmi ../typing/path.cmi parser_aux.cmi \
     ../typing/env.cmi debugcom.cmi
-program_loading.cmi: primitives.cmi
-program_management.cmi:
-question.cmi:
-show_information.cmi: ../bytecomp/instruct.cmi
-show_source.cmi: ../bytecomp/instruct.cmi
-source.cmi:
-symbols.cmi: ../bytecomp/instruct.cmi
-time_travel.cmi: primitives.cmi
-trap_barrier.cmi:
-unix_tools.cmi: $(UNIXDIR)/unix.cmi
-breakpoints.cmo: symbols.cmi primitives.cmi pos.cmi ../bytecomp/instruct.cmi \
-    exec.cmi debugcom.cmi checkpoints.cmi breakpoints.cmi
-breakpoints.cmx: symbols.cmx primitives.cmx pos.cmx ../bytecomp/instruct.cmx \
-    exec.cmx debugcom.cmx checkpoints.cmx breakpoints.cmi
-checkpoints.cmo: primitives.cmi int64ops.cmi debugcom.cmi checkpoints.cmi
-checkpoints.cmx: primitives.cmx int64ops.cmx debugcom.cmx checkpoints.cmi
-command_line.cmo: unix_tools.cmi $(UNIXDIR)/unix.cmi \
+program_loading.cmi : primitives.cmi
+program_management.cmi :
+question.cmi :
+show_information.cmi : ../bytecomp/instruct.cmi
+show_source.cmi : ../bytecomp/instruct.cmi
+source.cmi :
+symbols.cmi : ../bytecomp/instruct.cmi
+time_travel.cmi : primitives.cmi
+trap_barrier.cmi :
+unix_tools.cmi : $(UNIXDIR)/unix.cmi
+breakpoints.cmo : symbols.cmi primitives.cmi pos.cmi \
+    ../bytecomp/instruct.cmi exec.cmi debugcom.cmi checkpoints.cmi \
+    breakpoints.cmi
+breakpoints.cmx : symbols.cmx primitives.cmx pos.cmx \
+    ../bytecomp/instruct.cmx exec.cmx debugcom.cmx checkpoints.cmx \
+    breakpoints.cmi
+checkpoints.cmo : primitives.cmi int64ops.cmi debugcom.cmi checkpoints.cmi
+checkpoints.cmx : primitives.cmx int64ops.cmx debugcom.cmx checkpoints.cmi
+command_line.cmo : unix_tools.cmi $(UNIXDIR)/unix.cmi \
     ../typing/types.cmi time_travel.cmi symbols.cmi source.cmi \
     show_source.cmi show_information.cmi question.cmi program_management.cmi \
     program_loading.cmi printval.cmi primitives.cmi pos.cmi parser_aux.cmi \
     parser.cmi parameters.cmi ../utils/misc.cmi ../parsing/longident.cmi \
     ../parsing/location.cmi loadprinter.cmi lexer.cmi int64ops.cmi \
     ../bytecomp/instruct.cmi input_handling.cmi history.cmi frames.cmi \
-    events.cmi eval.cmi envaux.cmi debugger_config.cmi debugcom.cmi \
+    events.cmi eval.cmi ../typing/envaux.cmi debugger_config.cmi debugcom.cmi \
     ../typing/ctype.cmi ../utils/config.cmi checkpoints.cmi breakpoints.cmi \
     command_line.cmi
-command_line.cmx: unix_tools.cmx $(UNIXDIR)/unix.cmx \
+command_line.cmx : unix_tools.cmx $(UNIXDIR)/unix.cmx \
     ../typing/types.cmx time_travel.cmx symbols.cmx source.cmx \
     show_source.cmx show_information.cmx question.cmx program_management.cmx \
     program_loading.cmx printval.cmx primitives.cmx pos.cmx parser_aux.cmi \
     parser.cmx parameters.cmx ../utils/misc.cmx ../parsing/longident.cmx \
     ../parsing/location.cmx loadprinter.cmx lexer.cmx int64ops.cmx \
     ../bytecomp/instruct.cmx input_handling.cmx history.cmx frames.cmx \
-    events.cmx eval.cmx envaux.cmx debugger_config.cmx debugcom.cmx \
+    events.cmx eval.cmx ../typing/envaux.cmx debugger_config.cmx debugcom.cmx \
     ../typing/ctype.cmx ../utils/config.cmx checkpoints.cmx breakpoints.cmx \
     command_line.cmi
-debugcom.cmo: primitives.cmi ../utils/misc.cmi int64ops.cmi \
+debugcom.cmo : primitives.cmi ../utils/misc.cmi int64ops.cmi \
     input_handling.cmi debugcom.cmi
-debugcom.cmx: primitives.cmx ../utils/misc.cmx int64ops.cmx \
+debugcom.cmx : primitives.cmx ../utils/misc.cmx int64ops.cmx \
     input_handling.cmx debugcom.cmi
-debugger_config.cmo: int64ops.cmi debugger_config.cmi
-debugger_config.cmx: int64ops.cmx debugger_config.cmi
-dynlink.cmo: ../bytecomp/symtable.cmi ../bytecomp/opcodes.cmo \
+debugger_config.cmo : int64ops.cmi debugger_config.cmi
+debugger_config.cmx : int64ops.cmx debugger_config.cmi
+dynlink.cmo : ../bytecomp/symtable.cmi ../bytecomp/opcodes.cmo \
     ../utils/misc.cmi ../bytecomp/meta.cmi ../bytecomp/dll.cmi \
     ../utils/consistbl.cmi ../utils/config.cmi ../bytecomp/cmo_format.cmi \
-    dynlink.cmi
-dynlink.cmx: ../bytecomp/symtable.cmx ../bytecomp/opcodes.cmx \
+    ../typing/cmi_format.cmi dynlink.cmi
+dynlink.cmx : ../bytecomp/symtable.cmx ../bytecomp/opcodes.cmx \
     ../utils/misc.cmx ../bytecomp/meta.cmx ../bytecomp/dll.cmx \
     ../utils/consistbl.cmx ../utils/config.cmx ../bytecomp/cmo_format.cmi \
-    dynlink.cmi
-envaux.cmo: ../typing/types.cmi ../typing/subst.cmi ../typing/printtyp.cmi \
-    ../typing/path.cmi ../typing/mtype.cmi ../utils/misc.cmi \
-    ../bytecomp/instruct.cmi ../typing/env.cmi envaux.cmi
-envaux.cmx: ../typing/types.cmx ../typing/subst.cmx ../typing/printtyp.cmx \
-    ../typing/path.cmx ../typing/mtype.cmx ../utils/misc.cmx \
-    ../bytecomp/instruct.cmx ../typing/env.cmx envaux.cmi
-eval.cmo: ../typing/types.cmi ../bytecomp/symtable.cmi ../typing/subst.cmi \
+    ../typing/cmi_format.cmx dynlink.cmi
+eval.cmo : ../typing/types.cmi ../bytecomp/symtable.cmi ../typing/subst.cmi \
     printval.cmi ../typing/printtyp.cmi ../typing/predef.cmi \
     ../typing/path.cmi parser_aux.cmi ../utils/misc.cmi \
     ../parsing/longident.cmi ../bytecomp/instruct.cmi ../typing/ident.cmi \
     frames.cmi ../typing/env.cmi debugcom.cmi ../typing/ctype.cmi \
     ../typing/btype.cmi eval.cmi
-eval.cmx: ../typing/types.cmx ../bytecomp/symtable.cmx ../typing/subst.cmx \
+eval.cmx : ../typing/types.cmx ../bytecomp/symtable.cmx ../typing/subst.cmx \
     printval.cmx ../typing/printtyp.cmx ../typing/predef.cmx \
     ../typing/path.cmx parser_aux.cmi ../utils/misc.cmx \
     ../parsing/longident.cmx ../bytecomp/instruct.cmx ../typing/ident.cmx \
     frames.cmx ../typing/env.cmx debugcom.cmx ../typing/ctype.cmx \
     ../typing/btype.cmx eval.cmi
-events.cmo: ../parsing/location.cmi ../bytecomp/instruct.cmi events.cmi
-events.cmx: ../parsing/location.cmx ../bytecomp/instruct.cmx events.cmi
-exec.cmo: exec.cmi
-exec.cmx: exec.cmi
-frames.cmo: symbols.cmi ../utils/misc.cmi ../bytecomp/instruct.cmi events.cmi \
-    debugcom.cmi frames.cmi
-frames.cmx: symbols.cmx ../utils/misc.cmx ../bytecomp/instruct.cmx events.cmx \
-    debugcom.cmx frames.cmi
-history.cmo: primitives.cmi int64ops.cmi debugger_config.cmi checkpoints.cmi \
-    history.cmi
-history.cmx: primitives.cmx int64ops.cmx debugger_config.cmx checkpoints.cmx \
-    history.cmi
-input_handling.cmo: $(UNIXDIR)/unix.cmi primitives.cmi \
+events.cmo : ../parsing/location.cmi ../bytecomp/instruct.cmi events.cmi
+events.cmx : ../parsing/location.cmx ../bytecomp/instruct.cmx events.cmi
+exec.cmo : exec.cmi
+exec.cmx : exec.cmi
+frames.cmo : symbols.cmi ../utils/misc.cmi ../bytecomp/instruct.cmi \
+    events.cmi debugcom.cmi frames.cmi
+frames.cmx : symbols.cmx ../utils/misc.cmx ../bytecomp/instruct.cmx \
+    events.cmx debugcom.cmx frames.cmi
+history.cmo : primitives.cmi int64ops.cmi debugger_config.cmi \
+    checkpoints.cmi history.cmi
+history.cmx : primitives.cmx int64ops.cmx debugger_config.cmx \
+    checkpoints.cmx history.cmi
+input_handling.cmo : $(UNIXDIR)/unix.cmi primitives.cmi \
     input_handling.cmi
-input_handling.cmx: $(UNIXDIR)/unix.cmx primitives.cmx \
+input_handling.cmx : $(UNIXDIR)/unix.cmx primitives.cmx \
     input_handling.cmi
-int64ops.cmo: int64ops.cmi
-int64ops.cmx: int64ops.cmi
-lexer.cmo: parser.cmi lexer.cmi
-lexer.cmx: parser.cmx lexer.cmi
-loadprinter.cmo: ../typing/types.cmi ../bytecomp/symtable.cmi printval.cmi \
+int64ops.cmo : int64ops.cmi
+int64ops.cmx : int64ops.cmi
+lexer.cmo : parser.cmi lexer.cmi
+lexer.cmx : parser.cmx lexer.cmi
+loadprinter.cmo : ../typing/types.cmi ../bytecomp/symtable.cmi printval.cmi \
     ../typing/printtyp.cmi ../typing/path.cmi ../utils/misc.cmi \
     ../parsing/longident.cmi ../typing/ident.cmi ../typing/env.cmi \
     dynlink.cmi ../typing/ctype.cmi ../utils/config.cmi loadprinter.cmi
-loadprinter.cmx: ../typing/types.cmx ../bytecomp/symtable.cmx printval.cmx \
+loadprinter.cmx : ../typing/types.cmx ../bytecomp/symtable.cmx printval.cmx \
     ../typing/printtyp.cmx ../typing/path.cmx ../utils/misc.cmx \
     ../parsing/longident.cmx ../typing/ident.cmx ../typing/env.cmx \
     dynlink.cmx ../typing/ctype.cmx ../utils/config.cmx loadprinter.cmi
-main.cmo: unix_tools.cmi $(UNIXDIR)/unix.cmi time_travel.cmi \
+main.cmo : unix_tools.cmi $(UNIXDIR)/unix.cmi time_travel.cmi \
     show_information.cmi question.cmi program_management.cmi primitives.cmi \
     parameters.cmi ../utils/misc.cmi input_handling.cmi frames.cmi exec.cmi \
     ../typing/env.cmi debugger_config.cmi ../utils/config.cmi \
     command_line.cmi ../typing/cmi_format.cmi ../utils/clflags.cmi \
     checkpoints.cmi
-main.cmx: unix_tools.cmx $(UNIXDIR)/unix.cmx time_travel.cmx \
+main.cmx : unix_tools.cmx $(UNIXDIR)/unix.cmx time_travel.cmx \
     show_information.cmx question.cmx program_management.cmx primitives.cmx \
     parameters.cmx ../utils/misc.cmx input_handling.cmx frames.cmx exec.cmx \
     ../typing/env.cmx debugger_config.cmx ../utils/config.cmx \
     command_line.cmx ../typing/cmi_format.cmx ../utils/clflags.cmx \
     checkpoints.cmx
-parameters.cmo: primitives.cmi envaux.cmi debugger_config.cmi \
+parameters.cmo : primitives.cmi ../typing/envaux.cmi debugger_config.cmi \
     ../utils/config.cmi parameters.cmi
-parameters.cmx: primitives.cmx envaux.cmx debugger_config.cmx \
+parameters.cmx : primitives.cmx ../typing/envaux.cmx debugger_config.cmx \
     ../utils/config.cmx parameters.cmi
-parser.cmo: parser_aux.cmi ../parsing/longident.cmi int64ops.cmi \
+parser.cmo : parser_aux.cmi ../parsing/longident.cmi int64ops.cmi \
     input_handling.cmi parser.cmi
-parser.cmx: parser_aux.cmi ../parsing/longident.cmx int64ops.cmx \
+parser.cmx : parser_aux.cmi ../parsing/longident.cmx int64ops.cmx \
     input_handling.cmx parser.cmi
-pattern_matching.cmo: ../typing/typedtree.cmi parser_aux.cmi \
+pattern_matching.cmo : ../typing/typedtree.cmi parser_aux.cmi \
     ../utils/misc.cmi debugger_config.cmi debugcom.cmi ../typing/ctype.cmi \
     pattern_matching.cmi
-pattern_matching.cmx: ../typing/typedtree.cmx parser_aux.cmi \
+pattern_matching.cmx : ../typing/typedtree.cmx parser_aux.cmi \
     ../utils/misc.cmx debugger_config.cmx debugcom.cmx ../typing/ctype.cmx \
     pattern_matching.cmi
-pos.cmo: source.cmi primitives.cmi ../parsing/location.cmi \
+pos.cmo : source.cmi primitives.cmi ../parsing/location.cmi \
     ../bytecomp/instruct.cmi pos.cmi
-pos.cmx: source.cmx primitives.cmx ../parsing/location.cmx \
+pos.cmx : source.cmx primitives.cmx ../parsing/location.cmx \
     ../bytecomp/instruct.cmx pos.cmi
-primitives.cmo: $(UNIXDIR)/unix.cmi primitives.cmi
-primitives.cmx: $(UNIXDIR)/unix.cmx primitives.cmi
-printval.cmo: ../typing/types.cmi ../bytecomp/symtable.cmi \
+primitives.cmo : $(UNIXDIR)/unix.cmi primitives.cmi
+primitives.cmx : $(UNIXDIR)/unix.cmx primitives.cmi
+printval.cmo : ../typing/types.cmi ../bytecomp/symtable.cmi \
     ../typing/printtyp.cmi ../typing/path.cmi parser_aux.cmi \
     ../typing/outcometree.cmi ../typing/oprint.cmi \
     ../toplevel/genprintval.cmi debugcom.cmi printval.cmi
-printval.cmx: ../typing/types.cmx ../bytecomp/symtable.cmx \
+printval.cmx : ../typing/types.cmx ../bytecomp/symtable.cmx \
     ../typing/printtyp.cmx ../typing/path.cmx parser_aux.cmi \
     ../typing/outcometree.cmi ../typing/oprint.cmx \
     ../toplevel/genprintval.cmx debugcom.cmx printval.cmi
-program_loading.cmo: unix_tools.cmi $(UNIXDIR)/unix.cmi primitives.cmi \
-    parameters.cmi input_handling.cmi debugger_config.cmi program_loading.cmi
-program_loading.cmx: unix_tools.cmx $(UNIXDIR)/unix.cmx primitives.cmx \
-    parameters.cmx input_handling.cmx debugger_config.cmx program_loading.cmi
-program_management.cmo: unix_tools.cmi $(UNIXDIR)/unix.cmi \
+program_loading.cmo : unix_tools.cmi $(UNIXDIR)/unix.cmi \
+    primitives.cmi parameters.cmi input_handling.cmi debugger_config.cmi \
+    program_loading.cmi
+program_loading.cmx : unix_tools.cmx $(UNIXDIR)/unix.cmx \
+    primitives.cmx parameters.cmx input_handling.cmx debugger_config.cmx \
+    program_loading.cmi
+program_management.cmo : unix_tools.cmi $(UNIXDIR)/unix.cmi \
     time_travel.cmi symbols.cmi question.cmi program_loading.cmi \
     primitives.cmi parameters.cmi int64ops.cmi input_handling.cmi history.cmi \
     debugger_config.cmi breakpoints.cmi program_management.cmi
-program_management.cmx: unix_tools.cmx $(UNIXDIR)/unix.cmx \
+program_management.cmx : unix_tools.cmx $(UNIXDIR)/unix.cmx \
     time_travel.cmx symbols.cmx question.cmx program_loading.cmx \
     primitives.cmx parameters.cmx int64ops.cmx input_handling.cmx history.cmx \
     debugger_config.cmx breakpoints.cmx program_management.cmi
-question.cmo: primitives.cmi lexer.cmi input_handling.cmi question.cmi
-question.cmx: primitives.cmx lexer.cmx input_handling.cmx question.cmi
-show_information.cmo: symbols.cmi source.cmi show_source.cmi printval.cmi \
+question.cmo : primitives.cmi lexer.cmi input_handling.cmi question.cmi
+question.cmx : primitives.cmx lexer.cmx input_handling.cmx question.cmi
+show_information.cmo : symbols.cmi source.cmi show_source.cmi printval.cmi \
     ../utils/misc.cmi ../bytecomp/instruct.cmi frames.cmi events.cmi \
     debugcom.cmi checkpoints.cmi breakpoints.cmi show_information.cmi
-show_information.cmx: symbols.cmx source.cmx show_source.cmx printval.cmx \
+show_information.cmx : symbols.cmx source.cmx show_source.cmx printval.cmx \
     ../utils/misc.cmx ../bytecomp/instruct.cmx frames.cmx events.cmx \
     debugcom.cmx checkpoints.cmx breakpoints.cmx show_information.cmi
-show_source.cmo: source.cmi primitives.cmi parameters.cmi \
+show_source.cmo : source.cmi primitives.cmi parameters.cmi \
     ../parsing/location.cmi ../bytecomp/instruct.cmi events.cmi \
     debugger_config.cmi show_source.cmi
-show_source.cmx: source.cmx primitives.cmx parameters.cmx \
+show_source.cmx : source.cmx primitives.cmx parameters.cmx \
     ../parsing/location.cmx ../bytecomp/instruct.cmx events.cmx \
     debugger_config.cmx show_source.cmi
-source.cmo: primitives.cmi ../utils/misc.cmi debugger_config.cmi \
+source.cmo : primitives.cmi ../utils/misc.cmi debugger_config.cmi \
     ../utils/config.cmi source.cmi
-source.cmx: primitives.cmx ../utils/misc.cmx debugger_config.cmx \
+source.cmx : primitives.cmx ../utils/misc.cmx debugger_config.cmx \
     ../utils/config.cmx source.cmi
-symbols.cmo: ../bytecomp/symtable.cmi program_loading.cmi \
+symbols.cmo : ../bytecomp/symtable.cmi program_loading.cmi \
     ../bytecomp/instruct.cmi events.cmi debugger_config.cmi debugcom.cmi \
     checkpoints.cmi ../bytecomp/bytesections.cmi symbols.cmi
-symbols.cmx: ../bytecomp/symtable.cmx program_loading.cmx \
+symbols.cmx : ../bytecomp/symtable.cmx program_loading.cmx \
     ../bytecomp/instruct.cmx events.cmx debugger_config.cmx debugcom.cmx \
     checkpoints.cmx ../bytecomp/bytesections.cmx symbols.cmi
-time_travel.cmo: trap_barrier.cmi symbols.cmi question.cmi \
+time_travel.cmo : trap_barrier.cmi symbols.cmi question.cmi \
     program_loading.cmi primitives.cmi ../utils/misc.cmi int64ops.cmi \
     ../bytecomp/instruct.cmi input_handling.cmi exec.cmi events.cmi \
     debugger_config.cmi debugcom.cmi checkpoints.cmi breakpoints.cmi \
     time_travel.cmi
-time_travel.cmx: trap_barrier.cmx symbols.cmx question.cmx \
+time_travel.cmx : trap_barrier.cmx symbols.cmx question.cmx \
     program_loading.cmx primitives.cmx ../utils/misc.cmx int64ops.cmx \
     ../bytecomp/instruct.cmx input_handling.cmx exec.cmx events.cmx \
     debugger_config.cmx debugcom.cmx checkpoints.cmx breakpoints.cmx \
     time_travel.cmi
-trap_barrier.cmo: exec.cmi debugcom.cmi checkpoints.cmi trap_barrier.cmi
-trap_barrier.cmx: exec.cmx debugcom.cmx checkpoints.cmx trap_barrier.cmi
-unix_tools.cmo: $(UNIXDIR)/unix.cmi primitives.cmi ../utils/misc.cmi \
+trap_barrier.cmo : exec.cmi debugcom.cmi checkpoints.cmi trap_barrier.cmi
+trap_barrier.cmx : exec.cmx debugcom.cmx checkpoints.cmx trap_barrier.cmi
+unix_tools.cmo : $(UNIXDIR)/unix.cmi primitives.cmi ../utils/misc.cmi \
     unix_tools.cmi
-unix_tools.cmx: $(UNIXDIR)/unix.cmx primitives.cmx ../utils/misc.cmx \
+unix_tools.cmx : $(UNIXDIR)/unix.cmx primitives.cmx ../utils/misc.cmx \
     unix_tools.cmi

File debugger/Makefile.shared

View file
   ../typing/subst.cmo ../typing/predef.cmo \
   ../typing/datarepr.cmo ../typing/cmi_format.cmo ../typing/env.cmo ../typing/oprint.cmo \
   ../typing/ctype.cmo ../typing/printtyp.cmo ../typing/mtype.cmo \
+  ../typing/envaux.cmo \
   ../bytecomp/runtimedef.cmo ../bytecomp/bytesections.cmo \
   ../bytecomp/dll.cmo ../bytecomp/meta.cmo ../bytecomp/symtable.cmo \
   ../bytecomp/opcodes.cmo \
 	primitives.cmo \
 	unix_tools.cmo \
 	debugger_config.cmo \
-	envaux.cmo \
 	parameters.cmo \
 	lexer.cmo \
 	input_handling.cmo \

File debugger/envaux.ml

-(***********************************************************************)
-(*                                                                     *)
-(*                                OCaml                                *)
-(*                                                                     *)
-(*          Jerome Vouillon, projet Cristal, INRIA Rocquencourt        *)
-(*          OCaml port by John Malecki and Xavier Leroy                *)
-(*                                                                     *)
-(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
-(*  en Automatique.  All rights reserved.  This file is distributed    *)
-(*  under the terms of the Q Public License version 1.0.               *)
-(*                                                                     *)
-(***********************************************************************)
-
-(* $Id$ *)
-
-open Misc
-open Types
-open Env
-
-type error =
-    Module_not_found of Path.t
-
-exception Error of error
-
-let env_cache =
-  (Hashtbl.create 59 : ((Env.summary * Subst.t), Env.t) Hashtbl.t)
-
-let reset_cache () =
-  Hashtbl.clear env_cache;
-  Env.reset_cache()
-
-let extract_sig env mty =
-  match Mtype.scrape env mty with
-    Mty_signature sg -> sg
-  | _ -> fatal_error "Envaux.extract_sig"
-
-let rec env_from_summary sum subst =
-  try
-    Hashtbl.find env_cache (sum, subst)
-  with Not_found ->
-    let env =
-      match sum with
-        Env_empty ->
-          Env.empty
-      | Env_value(s, id, desc) ->
-          Env.add_value id (Subst.value_description subst desc) (env_from_summary s subst)
-      | Env_type(s, id, desc) ->
-          Env.add_type id (Subst.type_declaration subst desc) (env_from_summary s subst)
-      | Env_exception(s, id, desc) ->
-          Env.add_exception id (Subst.exception_declaration subst desc) (env_from_summary s subst)
-      | Env_module(s, id, desc) ->
-          Env.add_module id (Subst.modtype subst desc) (env_from_summary s subst)
-      | Env_modtype(s, id, desc) ->
-          Env.add_modtype id (Subst.modtype_declaration subst desc) (env_from_summary s subst)
-      | Env_class(s, id, desc) ->
-          Env.add_class id (Subst.class_declaration subst desc) (env_from_summary s subst)
-      | Env_cltype (s, id, desc) ->
-          Env.add_cltype id (Subst.cltype_declaration subst desc) (env_from_summary s subst)
-      | Env_open(s, path) ->
-          let env = env_from_summary s subst in
-          let path' = Subst.module_path subst path in
-          let mty =
-            try
-              Env.find_module path' env
-            with Not_found ->
-              raise (Error (Module_not_found path'))
-          in
-          Env.open_signature path' (extract_sig env mty) env
-    in
-      Hashtbl.add env_cache (sum, subst) env;
-      env
-
-let env_of_event =
-  function
-    None    -> Env.empty
-  | Some ev -> env_from_summary ev.Instruct.ev_typenv ev.Instruct.ev_typsubst
-
-(* Error report *)
-
-open Format
-
-let report_error ppf = function
-  | Module_not_found p ->
-      fprintf ppf "@[Cannot find module %a@].@." Printtyp.path p

File debugger/envaux.mli

-(***********************************************************************)
-(*                                                                     *)
-(*                                OCaml                                *)
-(*                                                                     *)
-(*          Jerome Vouillon, projet Cristal, INRIA Rocquencourt        *)
-(*          OCaml port by John Malecki and Xavier Leroy                *)
-(*                                                                     *)
-(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
-(*  en Automatique.  All rights reserved.  This file is distributed    *)
-(*  under the terms of the Q Public License version 1.0.               *)
-(*                                                                     *)
-(***********************************************************************)
-
-(* $Id$ *)
-
-open Format
-
-(* Convert environment summaries to environments *)
-
-val env_of_event: Instruct.debug_event option -> Env.t
-
-(* Empty the environment caches. To be called when load_path changes. *)
-
-val reset_cache: unit -> unit
-
-(* Error report *)
-
-type error =
-    Module_not_found of Path.t
-
-exception Error of error
-
-val report_error: formatter -> error -> unit

File ocamldoc/Makefile

View file
 	$(OCAMLSRCDIR)/typing/typedtree.cmo \
 	$(OCAMLSRCDIR)/typing/parmatch.cmo \
 	$(OCAMLSRCDIR)/typing/stypes.cmo \
+	$(OCAMLSRCDIR)/typing/typedtreeMap.cmo \
 	$(OCAMLSRCDIR)/typing/cmt_format.cmo \
 	$(OCAMLSRCDIR)/typing/typecore.cmo \
 	$(OCAMLSRCDIR)/typing/includeclass.cmo \

File ocamldoc/Makefile.nt

View file
 	$(OCAMLSRCDIR)/typing/typedtree.cmo \
 	$(OCAMLSRCDIR)/typing/parmatch.cmo \
 	$(OCAMLSRCDIR)/typing/stypes.cmo \
+	$(OCAMLSRCDIR)/typing/typedtreeMap.cmo \
 	$(OCAMLSRCDIR)/typing/cmt_format.cmo \
 	$(OCAMLSRCDIR)/typing/typecore.cmo \
 	$(OCAMLSRCDIR)/typing/includeclass.cmo \

File testsuite/tests/asmcomp/Makefile

View file
   $(TOPDIR)/typing/includemod.cmo \
   $(TOPDIR)/typing/parmatch.cmo \
   $(TOPDIR)/typing/typetexp.cmo \
+  $(TOPDIR)/typing/typedtreeMap.cmo \
   $(TOPDIR)/typing/cmt_format.cmo \
   $(TOPDIR)/typing/stypes.cmo \
   $(TOPDIR)/typing/typecore.cmo \

File tools/Makefile.shared

View file
           ../typing/oprint.cmo \
           ../typing/primitive.cmo \
           ../typing/printtyp.cmo \
+          ../typing/typedtreeMap.cmo \
+          ../typing/typedtreeIter.cmo \
           ../typing/cmt_format.cmo \
           ../typing/stypes.cmo \
           \
-          pprintast.cmo untypeast.cmo typedtreeIter.cmo  \
+          pprintast.cmo untypeast.cmo \
           cmt2annot.cmo read_cmt.cmo
 
 read_cmt: $(READ_CMT)

File tools/typedtreeIter.ml

-(**************************************************************************)
-(*                                                                        *)
-(*                                OCaml                                   *)
-(*                                                                        *)
-(*    Thomas Gazagnaire (OCamlPro), Fabrice Le Fessant (INRIA Saclay)     *)
-(*                                                                        *)
-(*   Copyright 2007 Institut National de Recherche en Informatique et     *)
-(*   en Automatique.  All rights reserved.  This file is distributed      *)
-(*   under the terms of the Q Public License version 1.0.                 *)
-(*                                                                        *)
-(**************************************************************************)
-
-(*
-TODO:
- - 2012/05/10: Follow camlp4 way of building map and iter using classes
-     and inheritance ?
-*)
-
-open Asttypes
-open Typedtree
-
-module type IteratorArgument = sig
-
-    val enter_structure : structure -> unit
-    val enter_value_description : value_description -> unit
-    val enter_type_declaration : type_declaration -> unit
-    val enter_exception_declaration :
-      exception_declaration -> unit
-    val enter_pattern : pattern -> unit
-    val enter_expression : expression -> unit
-    val enter_package_type : package_type -> unit
-    val enter_signature : signature -> unit
-    val enter_signature_item : signature_item -> unit
-    val enter_modtype_declaration : modtype_declaration -> unit
-    val enter_module_type : module_type -> unit
-    val enter_module_expr : module_expr -> unit
-    val enter_with_constraint : with_constraint -> unit
-    val enter_class_expr : class_expr -> unit
-    val enter_class_signature : class_signature -> unit
-    val enter_class_declaration : class_declaration -> unit
-    val enter_class_description : class_description -> unit
-    val enter_class_type_declaration : class_type_declaration -> unit
-    val enter_class_type : class_type -> unit
-    val enter_class_type_field : class_type_field -> unit
-    val enter_core_type : core_type -> unit
-    val enter_core_field_type : core_field_type -> unit
-    val enter_class_structure : class_structure -> unit
-    val enter_class_field : class_field -> unit
-    val enter_structure_item : structure_item -> unit
-
-
-    val leave_structure : structure -> unit
-    val leave_value_description : value_description -> unit
-    val leave_type_declaration : type_declaration -> unit
-    val leave_exception_declaration :
-      exception_declaration -> unit
-    val leave_pattern : pattern -> unit
-    val leave_expression : expression -> unit
-    val leave_package_type : package_type -> unit
-    val leave_signature : signature -> unit
-    val leave_signature_item : signature_item -> unit
-    val leave_modtype_declaration : modtype_declaration -> unit
-    val leave_module_type : module_type -> unit
-    val leave_module_expr : module_expr -> unit
-    val leave_with_constraint : with_constraint -> unit
-    val leave_class_expr : class_expr -> unit
-    val leave_class_signature : class_signature -> unit
-    val leave_class_declaration : class_declaration -> unit
-    val leave_class_description : class_description -> unit
-    val leave_class_type_declaration : class_type_declaration -> unit
-    val leave_class_type : class_type -> unit
-    val leave_class_type_field : class_type_field -> unit
-    val leave_core_type : core_type -> unit
-    val leave_core_field_type : core_field_type -> unit
-    val leave_class_structure : class_structure -> unit
-    val leave_class_field : class_field -> unit
-    val leave_structure_item : structure_item -> unit
-
-    val enter_bindings : rec_flag -> unit
-    val enter_binding : pattern -> expression -> unit
-    val leave_binding : pattern -> expression -> unit
-    val leave_bindings : rec_flag -> unit
-
-      end
-
-module MakeIterator(Iter : IteratorArgument) : sig
-
-    val iter_structure : structure -> unit
-    val iter_signature : signature -> unit
-    val iter_structure_item : structure_item -> unit
-    val iter_signature_item : signature_item -> unit
-    val iter_expression : expression -> unit
-    val iter_module_type : module_type -> unit
-    val iter_pattern : pattern -> unit
-    val iter_class_expr : class_expr -> unit
-
-  end = struct
-
-    let may_iter f v =
-      match v with
-        None -> ()
-      | Some x -> f x
-
-
-    open Misc
-    open Asttypes
-
-    let rec iter_structure str =
-      Iter.enter_structure str;
-      List.iter iter_structure_item str.str_items;
-      Iter.leave_structure str
-
-
-    and iter_binding (pat, exp) =
-      Iter.enter_binding pat exp;
-      iter_pattern pat;
-      iter_expression exp;
-      Iter.leave_binding pat exp
-
-    and iter_bindings rec_flag list =
-      Iter.enter_bindings rec_flag;
-      List.iter iter_binding list;
-      Iter.leave_bindings rec_flag
-
-    and iter_structure_item item =
-      Iter.enter_structure_item item;
-      begin
-        match item.str_desc with
-          Tstr_eval exp -> iter_expression exp
-        | Tstr_value (rec_flag, list) ->
-            iter_bindings rec_flag list
-        | Tstr_primitive (id, _, v) -> iter_value_description v
-        | Tstr_type list ->
-            List.iter (fun (id, _, decl) -> iter_type_declaration decl) list
-        | Tstr_exception (id, _, decl) -> iter_exception_declaration decl
-        | Tstr_exn_rebind (id, _, p, _) -> ()
-        | Tstr_module (id, _, mexpr) ->
-            iter_module_expr mexpr
-        | Tstr_recmodule list ->
-            List.iter (fun (id, _, mtype, mexpr) ->
-                iter_module_type mtype;
-                iter_module_expr mexpr) list
-        | Tstr_modtype (id, _, mtype) ->
-            iter_module_type mtype
-        | Tstr_open _ -> ()
-        | Tstr_class list ->
-            List.iter (fun (ci, _, _) ->
-                Iter.enter_class_declaration ci;
-                iter_class_expr ci.ci_expr;
-                Iter.leave_class_declaration ci;
-            ) list
-        | Tstr_class_type list ->
-            List.iter (fun (id, _, ct) ->
-                Iter.enter_class_type_declaration ct;
-                iter_class_type ct.ci_expr;
-                Iter.leave_class_type_declaration ct;
-            ) list
-        | Tstr_include (mexpr, _) ->
-            iter_module_expr mexpr
-      end;
-      Iter.leave_structure_item item
-
-    and iter_value_description v =
-      Iter.enter_value_description v;
-      iter_core_type v.val_desc;
-      Iter.leave_value_description v
-
-    and iter_type_declaration decl =
-      Iter.enter_type_declaration decl;
-      List.iter (fun (ct1, ct2, loc) ->
-          iter_core_type ct1;
-          iter_core_type ct2
-      ) decl.typ_cstrs;
-      begin match decl.typ_kind with
-          Ttype_abstract -> ()
-        | Ttype_variant list ->
-            List.iter (fun (s, _, cts, loc) ->
-                List.iter iter_core_type cts
-            ) list
-        | Ttype_record list ->
-            List.iter (fun (s, _, mut, ct, loc) ->
-                iter_core_type ct
-            ) list
-      end;
-      begin match decl.typ_manifest with
-          None -> ()
-        | Some ct -> iter_core_type ct
-      end;
-      Iter.leave_type_declaration decl
-
-    and iter_exception_declaration decl =
-      Iter.enter_exception_declaration decl;
-      List.iter iter_core_type decl.exn_params;
-      Iter.leave_exception_declaration decl;
-
-    and iter_pattern pat =
-      Iter.enter_pattern pat;
-      List.iter (fun (cstr, _) -> match cstr with
-              | Tpat_type _ -> ()
-              | Tpat_unpack -> ()
-              | Tpat_constraint ct -> iter_core_type ct) pat.pat_extra;
-      begin
-        match pat.pat_desc with
-          Tpat_any -> ()
-        | Tpat_var (id, _) -> ()
-        | Tpat_alias (pat1, _, _) -> iter_pattern pat1
-        | Tpat_constant cst -> ()
-        | Tpat_tuple list ->
-            List.iter iter_pattern list
-        | Tpat_construct (path, _, _, args, _) ->
-            List.iter iter_pattern args
-        | Tpat_variant (label, pato, _) ->
-            begin match pato with
-                None -> ()
-              | Some pat -> iter_pattern pat
-            end
-        | Tpat_record (list, closed) ->
-            List.iter (fun (path, _, _, pat) -> iter_pattern pat) list
-        | Tpat_array list -> List.iter iter_pattern list
-        | Tpat_or (p1, p2, _) -> iter_pattern p1; iter_pattern p2
-        | Tpat_lazy p -> iter_pattern p
-      end;
-      Iter.leave_pattern pat
-
-    and option f x = match x with None -> () | Some e -> f e
-
-    and iter_expression exp =
-      Iter.enter_expression exp;
-      List.iter (function (cstr, _) ->
-        match cstr with
-          Texp_constraint (cty1, cty2) ->
-            option iter_core_type cty1; option iter_core_type cty2
-        | Texp_open (path, _, _) -> ()
-        | Texp_poly cto -> option iter_core_type cto
-        | Texp_newtype s -> ())
-        exp.exp_extra;
-      begin
-        match exp.exp_desc with
-          Texp_ident (path, _, _) -> ()
-        | Texp_constant cst -> ()
-        | Texp_let (rec_flag, list, exp) ->
-            iter_bindings rec_flag list;
-            iter_expression exp
-        | Texp_function (label, cases, _) ->
-            iter_bindings Nonrecursive cases
-        | Texp_apply (exp, list) ->
-            iter_expression exp;
-            List.iter (fun (label, expo, _) ->
-                match expo with
-                  None -> ()
-                | Some exp -> iter_expression exp
-            ) list
-        | Texp_match (exp, list, _) ->
-            iter_expression exp;
-            iter_bindings Nonrecursive list
-        | Texp_try (exp, list) ->
-            iter_expression exp;
-            iter_bindings Nonrecursive list
-        | Texp_tuple list ->
-            List.iter iter_expression list
-        | Texp_construct (path, _, _, args, _) ->
-            List.iter iter_expression args
-        | Texp_variant (label, expo) ->
-            begin match expo with
-                None -> ()
-              | Some exp -> iter_expression exp
-            end
-        | Texp_record (list, expo) ->
-            List.iter (fun (path, _, _, exp) ->
-                iter_expression exp
-            ) list;
-            begin match expo with
-                None -> ()
-              | Some exp -> iter_expression exp
-            end
-        | Texp_field (exp, path, _, label) ->
-            iter_expression exp
-        | Texp_setfield (exp1, path, _ , label, exp2) ->
-            iter_expression exp1;
-            iter_expression exp2
-        | Texp_array list ->
-            List.iter iter_expression list
-        | Texp_ifthenelse (exp1, exp2, expo) ->
-            iter_expression exp1;
-            iter_expression exp2;
-            begin match expo with
-                None -> ()
-              | Some exp -> iter_expression exp
-            end
-        | Texp_sequence (exp1, exp2) ->
-            iter_expression exp1;
-            iter_expression exp2
-        | Texp_while (exp1, exp2) ->
-            iter_expression exp1;
-            iter_expression exp2
-        | Texp_for (id, _, exp1, exp2, dir, exp3) ->
-            iter_expression exp1;
-            iter_expression exp2;
-            iter_expression exp3
-        | Texp_when (exp1, exp2) ->
-            iter_expression exp1;
-            iter_expression exp2
-        | Texp_send (exp, meth, expo) ->
-            iter_expression exp;
-	  begin
-	    match expo with
-		None -> ()
-	      | Some exp -> iter_expression exp
-	  end
-        | Texp_new (path, _, _) -> ()
-        | Texp_instvar (_, path, _) -> ()
-        | Texp_setinstvar (_, _, _, exp) ->
-            iter_expression exp
-        | Texp_override (_, list) ->
-            List.iter (fun (path, _, exp) ->
-                iter_expression exp
-            ) list
-        | Texp_letmodule (id, _, mexpr, exp) ->
-            iter_module_expr mexpr;
-            iter_expression exp
-        | Texp_assert exp -> iter_expression exp
-        | Texp_assertfalse -> ()
-        | Texp_lazy exp -> iter_expression exp
-        | Texp_object (cl, _) ->
-            iter_class_structure cl
-        | Texp_pack (mexpr) ->
-            iter_module_expr mexpr
-      end;
-      Iter.leave_expression exp;
-
-    and iter_package_type pack =
-      Iter.enter_package_type pack;
-      List.iter (fun (s, ct) -> iter_core_type ct) pack.pack_fields;
-      Iter.leave_package_type pack;
-
-    and iter_signature sg =
-      Iter.enter_signature sg;
-      List.iter iter_signature_item sg.sig_items;
-      Iter.leave_signature sg;
-
-    and iter_signature_item item =
-      Iter.enter_signature_item item;
-      begin
-        match item.sig_desc with
-          Tsig_value (id, _, v) ->
-            iter_value_description v
-        | Tsig_type list ->
-            List.iter (fun (id, _, decl) ->
-                iter_type_declaration decl
-            ) list
-        | Tsig_exception (id, _, decl) ->
-            iter_exception_declaration decl
-        | Tsig_module (id, _, mtype) ->
-            iter_module_type mtype
-        | Tsig_recmodule list ->
-            List.iter (fun (id, _, mtype) -> iter_module_type mtype) list
-        | Tsig_modtype (id, _, mdecl) ->
-            iter_modtype_declaration mdecl
-        | Tsig_open _ -> ()
-        | Tsig_include (mty,_) -> iter_module_type mty
-        | Tsig_class list ->
-            List.iter iter_class_description list
-        | Tsig_class_type list ->
-            List.iter iter_class_type_declaration list
-      end;
-      Iter.leave_signature_item item;
-
-    and iter_modtype_declaration mdecl =
-      Iter.enter_modtype_declaration mdecl;
-      begin
-        match mdecl with
-          Tmodtype_abstract -> ()
-        | Tmodtype_manifest mtype -> iter_module_type mtype
-      end;
-      Iter.leave_modtype_declaration mdecl;
-
-
-    and iter_class_description cd =
-      Iter.enter_class_description cd;
-      iter_class_type cd.ci_expr;
-      Iter.leave_class_description cd;
-
-    and iter_class_type_declaration cd =
-      Iter.enter_class_type_declaration cd;
-      iter_class_type cd.ci_expr;
-        Iter.leave_class_type_declaration cd;
-
-    and iter_module_type mty =
-      Iter.enter_module_type mty;
-      begin
-        match mty.mty_desc with
-          Tmty_ident (path, _) -> ()
-        | Tmty_signature sg -> iter_signature sg
-        | Tmty_functor (id, _, mtype1, mtype2) ->
-            iter_module_type mtype1; iter_module_type mtype2
-        | Tmty_with (mtype, list) ->
-            iter_module_type mtype;
-            List.iter (fun (path, _, withc) ->
-                iter_with_constraint withc
-            ) list
-        | Tmty_typeof mexpr ->
-            iter_module_expr mexpr
-      end;
-      Iter.leave_module_type mty;
-
-    and iter_with_constraint cstr =
-      Iter.enter_with_constraint cstr;
-      begin
-        match cstr with
-          Twith_type decl -> iter_type_declaration decl
-        | Twith_module _ -> ()
-        | Twith_typesubst decl -> iter_type_declaration decl
-        | Twith_modsubst _ -> ()
-      end;
-      Iter.leave_with_constraint cstr;
-
-    and iter_module_expr mexpr =
-      Iter.enter_module_expr mexpr;
-      begin
-        match mexpr.mod_desc with
-          Tmod_ident (p, _) -> ()
-        | Tmod_structure st -> iter_structure st
-        | Tmod_functor (id, _, mtype, mexpr) ->
-            iter_module_type mtype;
-            iter_module_expr mexpr
-        | Tmod_apply (mexp1, mexp2, _) ->
-            iter_module_expr mexp1;
-            iter_module_expr mexp2
-        | Tmod_constraint (mexpr, _, Tmodtype_implicit, _ ) ->
-            iter_module_expr mexpr
-        | Tmod_constraint (mexpr, _, Tmodtype_explicit mtype, _) ->
-            iter_module_expr mexpr;
-            iter_module_type mtype
-        | Tmod_unpack (exp, mty) ->
-            iter_expression exp
-(*          iter_module_type mty *)
-      end;
-      Iter.leave_module_expr mexpr;
-
-    and iter_class_expr cexpr =
-      Iter.enter_class_expr cexpr;
-      begin
-        match cexpr.cl_desc with
-        | Tcl_constraint (cl, None, _, _, _ ) ->
-            iter_class_expr cl;
-        | Tcl_structure clstr -> iter_class_structure clstr
-        | Tcl_fun (label, pat, priv, cl, partial) ->
-          iter_pattern pat;
-	  List.iter (fun (id, _, exp) -> iter_expression exp) priv;
-          iter_class_expr cl
-
-        | Tcl_apply (cl, args) ->
-            iter_class_expr cl;
-            List.iter (fun (label, expo, _) ->
-                match expo with
-                  None -> ()
-                | Some exp -> iter_expression exp
-            ) args
-
-        | Tcl_let (rec_flat, bindings, ivars, cl) ->
-          iter_bindings rec_flat bindings;
-	  List.iter (fun (id, _, exp) -> iter_expression exp) ivars;
-            iter_class_expr cl
-
-        | Tcl_constraint (cl, Some clty, vals, meths, concrs) ->
-            iter_class_expr cl;
-            iter_class_type clty
-
-        | Tcl_ident (_, _, tyl) ->
-            List.iter iter_core_type tyl
-      end;
-      Iter.leave_class_expr cexpr;
-
-    and iter_class_type ct =
-      Iter.enter_class_type ct;
-      begin
-        match ct.cltyp_desc with
-          Tcty_signature csg -> iter_class_signature csg
-        | Tcty_constr (path, _, list) ->
-            List.iter iter_core_type list
-        | Tcty_fun (label, ct, cl) ->
-            iter_core_type ct;
-            iter_class_type cl
-      end;
-      Iter.leave_class_type ct;
-
-    and iter_class_signature cs =
-      Iter.enter_class_signature cs;
-      iter_core_type cs.csig_self;
-      List.iter iter_class_type_field cs.csig_fields;
-      Iter.leave_class_signature cs
-
-
-    and iter_class_type_field ctf =
-      Iter.enter_class_type_field ctf;
-      begin
-        match ctf.ctf_desc with
-          Tctf_inher ct -> iter_class_type ct
-        | Tctf_val (s, mut, virt, ct) ->
-            iter_core_type ct
-        | Tctf_virt  (s, priv, ct) ->
-            iter_core_type ct
-        | Tctf_meth  (s, priv, ct) ->
-            iter_core_type ct
-        | Tctf_cstr  (ct1, ct2) ->
-            iter_core_type ct1;
-            iter_core_type ct2
-      end;
-      Iter.leave_class_type_field ctf
-
-    and iter_core_type ct =
-      Iter.enter_core_type ct;
-      begin
-        match ct.ctyp_desc with
-          Ttyp_any -> ()
-        | Ttyp_var s -> ()
-        | Ttyp_arrow (label, ct1, ct2) ->
-            iter_core_type ct1;
-            iter_core_type ct2
-        | Ttyp_tuple list -> List.iter iter_core_type list
-        | Ttyp_constr (path, _, list) ->
-            List.iter iter_core_type list
-        | Ttyp_object list ->
-            List.iter iter_core_field_type list
-        | Ttyp_class (path, _, list, labels) ->
-            List.iter iter_core_type list
-        | Ttyp_alias (ct, s) ->
-            iter_core_type ct
-        | Ttyp_variant (list, bool, labels) ->
-            List.iter iter_row_field list
-        | Ttyp_poly (list, ct) -> iter_core_type ct
-        | Ttyp_package pack -> iter_package_type pack
-      end;
-      Iter.leave_core_type ct;
-
-    and iter_core_field_type cft =
-      Iter.enter_core_field_type cft;
-      begin match cft.field_desc with
-          Tcfield_var -> ()
-        | Tcfield (s, ct) -> iter_core_type ct
-      end;
-      Iter.leave_core_field_type cft;
-
-    and iter_class_structure cs =
-      Iter.enter_class_structure cs;
-      iter_pattern cs.cstr_pat;
-      List.iter iter_class_field cs.cstr_fields;
-      Iter.leave_class_structure cs;
-
-
-    and iter_row_field rf =
-      match rf with
-        Ttag (label, bool, list) ->
-          List.iter iter_core_type list
-      | Tinherit ct -> iter_core_type ct
-
-    and iter_class_field cf =
-      Iter.enter_class_field cf;
-      begin
-        match cf.cf_desc with
-          Tcf_inher (ovf, cl, super, _vals, _meths) ->
-          iter_class_expr cl
-      | Tcf_constr (cty, cty') ->
-          iter_core_type cty;
-          iter_core_type cty'
-      | Tcf_val (lab, _, _, mut, Tcfk_virtual cty, override) ->
-          iter_core_type cty
-      | Tcf_val (lab, _, _, mut, Tcfk_concrete exp, override) ->
-          iter_expression exp
-      | Tcf_meth (lab, _, priv, Tcfk_virtual cty, override) ->
-          iter_core_type cty
-      | Tcf_meth (lab, _, priv, Tcfk_concrete exp, override) ->
-          iter_expression exp
-(*      | Tcf_let (rec_flag, bindings, exps) ->
-          iter_bindings rec_flag bindings;
-	List.iter (fun (id, _, exp) -> iter_expression exp) exps; *)
-      | Tcf_init exp ->
-          iter_expression exp
-      end;
-      Iter.leave_class_field cf;
-
-  end
-
-module DefaultIteratorArgument = struct
-
-      let enter_structure _ = ()
-      let enter_value_description _ = ()
-      let enter_type_declaration _ = ()
-      let enter_exception_declaration _ = ()
-      let enter_pattern _ = ()
-      let enter_expression _ = ()
-      let enter_package_type _ = ()
-      let enter_signature _ = ()
-      let enter_signature_item _ = ()
-      let enter_modtype_declaration _ = ()
-      let enter_module_type _ = ()
-      let enter_module_expr _ = ()
-      let enter_with_constraint _ = ()
-      let enter_class_expr _ = ()
-      let enter_class_signature _ = ()
-      let enter_class_declaration _ = ()
-      let enter_class_description _ = ()
-      let enter_class_type_declaration _ = ()
-      let enter_class_type _ = ()
-      let enter_class_type_field _ = ()
-      let enter_core_type _ = ()
-      let enter_core_field_type _ = ()
-      let enter_class_structure _ = ()
-    let enter_class_field _ = ()
-    let enter_structure_item _ = ()
-
-
-      let leave_structure _ = ()
-      let leave_value_description _ = ()
-      let leave_type_declaration _ = ()
-      let leave_exception_declaration _ = ()
-      let leave_pattern _ = ()
-      let leave_expression _ = ()
-      let leave_package_type _ = ()
-      let leave_signature _ = ()
-      let leave_signature_item _ = ()
-      let leave_modtype_declaration _ = ()
-      let leave_module_type _ = ()
-      let leave_module_expr _ = ()
-      let leave_with_constraint _ = ()
-      let leave_class_expr _ = ()
-      let leave_class_signature _ = ()
-      let leave_class_declaration _ = ()
-      let leave_class_description _ = ()
-      let leave_class_type_declaration _ = ()
-      let leave_class_type _ = ()
-      let leave_class_type_field _ = ()
-      let leave_core_type _ = ()
-      let leave_core_field_type _ = ()
-      let leave_class_structure _ = ()
-    let leave_class_field _ = ()
-    let leave_structure_item _ = ()
-
-    let enter_binding _ _ = ()
-    let leave_binding _ _ = ()
-
-    let enter_bindings _ = ()
-    let leave_bindings _ = ()
-
-  end
-
-

File tools/typedtreeIter.mli

-(**************************************************************************)
-(*                                                                        *)
-(*                                OCaml                                   *)
-(*                                                                        *)
-(*    Thomas Gazagnaire (OCamlPro), Fabrice Le Fessant (INRIA Saclay)     *)
-(*                                                                        *)
-(*   Copyright 2007 Institut National de Recherche en Informatique et     *)
-(*   en Automatique.  All rights reserved.  This file is distributed      *)
-(*   under the terms of the Q Public License version 1.0.                 *)
-(*                                                                        *)
-(**************************************************************************)
-
-open Asttypes
-open Typedtree
-
-
-module type IteratorArgument = sig
-    val enter_structure : structure -> unit
-    val enter_value_description : value_description -> unit
-    val enter_type_declaration : type_declaration -> unit
-    val enter_exception_declaration :
-      exception_declaration -> unit
-    val enter_pattern : pattern -> unit
-    val enter_expression : expression -> unit
-    val enter_package_type : package_type -> unit
-    val enter_signature : signature -> unit
-    val enter_signature_item : signature_item -> unit
-    val enter_modtype_declaration : modtype_declaration -> unit
-    val enter_module_type : module_type -> unit
-    val enter_module_expr : module_expr -> unit
-    val enter_with_constraint : with_constraint -> unit
-    val enter_class_expr : class_expr -> unit
-    val enter_class_signature : class_signature -> unit
-    val enter_class_declaration : class_declaration -> unit
-    val enter_class_description : class_description -> unit
-    val enter_class_type_declaration : class_type_declaration -> unit
-    val enter_class_type : class_type -> unit
-    val enter_class_type_field : class_type_field -> unit
-    val enter_core_type : core_type -> unit
-    val enter_core_field_type : core_field_type -> unit
-    val enter_class_structure : class_structure -> unit
-    val enter_class_field : class_field -> unit
-    val enter_structure_item : structure_item -> unit
-
-
-      val leave_structure : structure -> unit
-    val leave_value_description : value_description -> unit
-    val leave_type_declaration : type_declaration -> unit
-    val leave_exception_declaration :
-      exception_declaration -> unit
-    val leave_pattern : pattern -> unit
-    val leave_expression : expression -> unit
-    val leave_package_type : package_type -> unit
-    val leave_signature : signature -> unit
-    val leave_signature_item : signature_item -> unit
-    val leave_modtype_declaration : modtype_declaration -> unit
-    val leave_module_type : module_type -> unit
-    val leave_module_expr : module_expr -> unit
-    val leave_with_constraint : with_constraint -> unit
-    val leave_class_expr : class_expr -> unit
-    val leave_class_signature : class_signature -> unit
-    val leave_class_declaration : class_declaration -> unit
-    val leave_class_description : class_description -> unit
-    val leave_class_type_declaration : class_type_declaration -> unit
-    val leave_class_type : class_type -> unit
-    val leave_class_type_field : class_type_field -> unit
-    val leave_core_type : core_type -> unit
-    val leave_core_field_type : core_field_type -> unit
-    val leave_class_structure : class_structure -> unit
-    val leave_class_field : class_field -> unit
-    val leave_structure_item : structure_item -> unit
-
-    val enter_bindings : rec_flag -> unit
-    val enter_binding : pattern -> expression -> unit
-    val leave_binding : pattern -> expression -> unit
-    val leave_bindings : rec_flag -> unit
-
-      end
-
-module MakeIterator :
-  functor
-  (Iter : IteratorArgument) ->
-           sig
-             val iter_structure : structure -> unit
-             val iter_signature : signature -> unit
-    val iter_structure_item : structure_item -> unit
-    val iter_signature_item : signature_item -> unit
-    val iter_expression : expression -> unit
-    val iter_module_type : module_type -> unit
-    val iter_pattern : pattern -> unit
-    val iter_class_expr : class_expr -> unit
-           end
-
-module DefaultIteratorArgument : IteratorArgument
-

File typing/cmt_format.ml

View file
    integrated in Typerex).
 *)
 
+
+
 let read_magic_number ic =
   let len_magic_number = String.length Config.cmt_magic_number in
   let magic_number = String.create len_magic_number in
   cmt_initial_env : Env.t;
   cmt_imports : (string * Digest.t) list;
   cmt_interface_digest : Digest.t option;
+  cmt_use_summaries : bool;
 }
 
 type error =
     Not_a_typedtree of string
 
+
+
+
+
+(*
+  Keeping all the environments in the typedtree can result in
+  huge typedtrees.
+*)
+
+
+let need_to_clear_env =
+  try ignore (Sys.getenv "OCAML_BINANNOT_WITHENV"); false
+  with Not_found -> true
+
+(* Re-introduce sharing after clearing environments *)
+let env_hcons = Hashtbl.create 133
+let keep_only_summary env =
+  let new_env = Env.keep_only_summary env in
+  try
+    Hashtbl.find env_hcons new_env
+  with Not_found ->
+    Hashtbl.add env_hcons new_env new_env;
+    new_env
+let clear_env_hcons () = Hashtbl.clear env_hcons
+
+module ClearEnv  = TypedtreeMap.MakeMap (struct
+  open TypedtreeMap
+  include DefaultMapArgument
+
+  let leave_pattern p = { p with pat_env = keep_only_summary p.pat_env }
+  let leave_expression e =
+    let exp_extra = List.map (function
+        (Texp_open (path, lloc, env), loc) ->
+          (Texp_open (path, lloc, keep_only_summary env), loc)
+      | exp_extra -> exp_extra) e.exp_extra in
+    { e with
+      exp_env = keep_only_summary e.exp_env;
+      exp_extra = exp_extra }
+  let leave_class_expr c =
+    { c with cl_env = keep_only_summary c.cl_env }
+  let leave_module_expr m =
+    { m with mod_env = keep_only_summary m.mod_env }
+  let leave_structure s =
+    { s with str_final_env = keep_only_summary s.str_final_env }
+  let leave_structure_item str =
+    { str with str_env = keep_only_summary str.str_env }
+  let leave_module_type m =
+    { m with mty_env = keep_only_summary m.mty_env }
+  let leave_signature s =
+    { s with sig_final_env = keep_only_summary s.sig_final_env }
+  let leave_signature_item s =
+    { s with sig_env = keep_only_summary s.sig_env }
+  let leave_core_type c =
+    { c with ctyp_env = keep_only_summary c.ctyp_env }
+  let leave_class_type c =
+    { c with cltyp_env = keep_only_summary c.cltyp_env }
+
+end)
+
+let clear_part p = match p with
+  | Partial_structure s -> Partial_structure (ClearEnv.map_structure s)
+  | Partial_structure_item s ->
+    Partial_structure_item (ClearEnv.map_structure_item s)
+  | Partial_expression e -> Partial_expression (ClearEnv.map_expression e)
+  | Partial_pattern p -> Partial_pattern (ClearEnv.map_pattern p)
+  | Partial_class_expr ce -> Partial_class_expr (ClearEnv.map_class_expr ce)
+  | Partial_signature s -> Partial_signature (ClearEnv.map_signature s)
+  | Partial_signature_item s ->
+    Partial_signature_item (ClearEnv.map_signature_item s)
+  | Partial_module_type s -> Partial_module_type (ClearEnv.map_module_type s)
+
+let clear_env binary_annots =
+  if need_to_clear_env then
+    match binary_annots with
+      | Implementation s -> Implementation (ClearEnv.map_structure s)
+      | Interface s -> Interface (ClearEnv.map_signature s)
+      | Packed _ -> binary_annots
+      | Partial_implementation array ->
+        Partial_implementation (Array.map clear_part array)
+      | Partial_interface array ->
+        Partial_interface (Array.map clear_part array)
+
+  else binary_annots
+
+
+
+
 exception Error of error
 
 let input_cmt ic = (input_value ic : cmt_infos)
 
 let read_cmi filename =
   match read filename with
-      None, _ -> raise (Cmi_format.Error (Cmi_format.Not_an_interface filename))
+      None, _ ->
+        raise (Cmi_format.Error (Cmi_format.Not_an_interface filename))
     | Some cmi, _ -> cmi
 
 let saved_types = ref []
     let source_digest = Misc.may_map Digest.file sourcefile in
     let cmt = {
       cmt_modname = modname;
-      cmt_annots = binary_annots;
+      cmt_annots = clear_env binary_annots;
       cmt_comments = Lexer.comments ();
       cmt_args = Sys.argv;
       cmt_sourcefile = sourcefile;
       cmt_builddir =  Sys.getcwd ();
       cmt_loadpath = !Config.load_path;
       cmt_source_digest = source_digest;
-      cmt_initial_env = initial_env;
+      cmt_initial_env = if need_to_clear_env then
+          keep_only_summary initial_env else initial_env;
       cmt_imports = List.sort compare imports;
       cmt_interface_digest = this_crc;
+      cmt_use_summaries = need_to_clear_env;
     } in
+    clear_env_hcons ();
     output_cmt oc cmt;
     close_out oc;
     set_saved_types [];

File typing/cmt_format.mli

View file
   cmt_initial_env : Env.t;
   cmt_imports : (string * Digest.t) list;
   cmt_interface_digest : Digest.t option;
+  cmt_use_summaries : bool;
 }
 
 type error =

File typing/env.ml

View file
 
 let summary env = env.summary
 
+let keep_only_summary env =
+  { empty with
+    summary = env.summary;
+    local_constraints = env.local_constraints;
+    in_signature = env.in_signature;
+  }
+
+let env_of_only_summary env_from_summary env =
+  let new_env = env_from_summary env.summary Subst.identity in
+  { new_env with
+    local_constraints = env.local_constraints;
+    in_signature = env.in_signature;
+  }
+
 (* Error report *)
 
 open Format

File typing/env.mli

View file
 
 val summary: t -> summary
 
+(* Return an equivalent environment where all fields have been reset,
+   except the summary. The initial environment can be rebuilt from the
+   summary, using Envaux.env_of_only_summary. *)
+
+val keep_only_summary : t -> t
+val env_of_only_summary : (summary -> Subst.t -> t) -> t -> t
+
 (* Error report *)
 
 type error =

File typing/envaux.ml

View file
+(***********************************************************************)
+(*                                                                     *)
+(*                                OCaml                                *)
+(*                                                                     *)
+(*          Jerome Vouillon, projet Cristal, INRIA Rocquencourt        *)
+(*          OCaml port by John Malecki and Xavier Leroy                *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id$ *)
+
+open Misc
+open Types
+open Env
+
+type error =
+    Module_not_found of Path.t
+
+exception Error of error
+
+let env_cache =
+  (Hashtbl.create 59 : ((Env.summary * Subst.t), Env.t) Hashtbl.t)
+
+let reset_cache () =
+  Hashtbl.clear env_cache;
+  Env.reset_cache()
+
+let extract_sig env mty =
+  match Mtype.scrape env mty with
+    Mty_signature sg -> sg
+  | _ -> fatal_error "Envaux.extract_sig"
+
+let rec env_from_summary sum subst =
+  try
+    Hashtbl.find env_cache (sum, subst)
+  with Not_found ->
+    let env =
+      match sum with
+        Env_empty ->
+          Env.empty
+      | Env_value(s, id, desc) ->
+          Env.add_value id (Subst.value_description subst desc) (env_from_summary s subst)
+      | Env_type(s, id, desc) ->
+          Env.add_type id (Subst.type_declaration subst desc) (env_from_summary s subst)
+      | Env_exception(s, id, desc) ->
+          Env.add_exception id (Subst.exception_declaration subst desc) (env_from_summary s subst)
+      | Env_module(s, id, desc) ->
+          Env.add_module id (Subst.modtype subst desc) (env_from_summary s subst)
+      | Env_modtype(s, id, desc) ->
+          Env.add_modtype id (Subst.modtype_declaration subst desc) (env_from_summary s subst)
+      | Env_class(s, id, desc) ->
+          Env.add_class id (Subst.class_declaration subst desc) (env_from_summary s subst)
+      | Env_cltype (s, id, desc) ->
+          Env.add_cltype id (Subst.cltype_declaration subst desc) (env_from_summary s subst)
+      | Env_open(s, path) ->
+          let env = env_from_summary s subst in
+          let path' = Subst.module_path subst path in
+          let mty =
+            try
+              Env.find_module path' env
+            with Not_found ->
+              raise (Error (Module_not_found path'))
+          in
+          Env.open_signature path' (extract_sig env mty) env
+    in
+      Hashtbl.add env_cache (sum, subst) env;
+      env
+
+let env_of_event =
+  function
+    None    -> Env.empty
+  | Some ev -> env_from_summary ev.Instruct.ev_typenv ev.Instruct.ev_typsubst
+
+let env_of_only_summary env =
+  Env.env_of_only_summary env_from_summary env
+
+(* Error report *)
+
+open Format
+
+let report_error ppf = function
+  | Module_not_found p ->
+      fprintf ppf "@[Cannot find module %a@].@." Printtyp.path p

File typing/envaux.mli

View file
+(***********************************************************************)
+(*                                                                     *)
+(*                                OCaml                                *)
+(*                                                                     *)
+(*          Jerome Vouillon, projet Cristal, INRIA Rocquencourt        *)
+(*          OCaml port by John Malecki and Xavier Leroy                *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id$ *)
+
+open Format
+
+(* Convert environment summaries to environments *)
+
+val env_of_event: Instruct.debug_event option -> Env.t
+
+(* Empty the environment caches. To be called when load_path changes. *)
+
+val reset_cache: unit -> unit
+
+val env_of_only_summary : Env.t -> Env.t
+