Imported Upstream version 3.11.1~rc0
authorStephane Glondu <steph@glondu.net>
Tue, 19 May 2009 15:41:21 +0000 (17:41 +0200)
committerStephane Glondu <steph@glondu.net>
Tue, 19 May 2009 15:41:21 +0000 (17:41 +0200)
197 files changed:
.depend
Changes
Makefile
VERSION
_tags
asmcomp/amd64/emit.mlp
asmcomp/amd64/proc.ml
asmcomp/cmmgen.ml
asmcomp/emitaux.ml
asmcomp/emitaux.mli
asmcomp/i386/emit.mlp
asmcomp/i386/emit_nt.mlp
asmcomp/power/emit.mlp
asmrun/signals_osdep.h
boot/myocamlbuild.boot
boot/ocamlc
boot/ocamldep
boot/ocamllex
bytecomp/bytegen.ml
bytecomp/bytepackager.ml
bytecomp/dll.ml
bytecomp/instruct.ml
bytecomp/instruct.mli
byterun/Makefile
byterun/finalise.c
byterun/globroots.c
byterun/int64_emul.h
byterun/int64_native.h
byterun/ints.c
camlp4/Camlp4/Printers/OCamlr.ml
camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
camlp4/boot/Camlp4.ml
camlp4/boot/camlp4boot.ml
configure
debugger/.depend
debugger/breakpoints.ml
debugger/command_line.ml
debugger/debugger_config.ml
debugger/debugger_config.mli
debugger/dynlink.ml
debugger/dynlink.mli
debugger/envaux.ml
debugger/eval.ml
debugger/events.ml
debugger/frames.ml
debugger/history.ml
debugger/input_handling.ml
debugger/lexer.mll
debugger/loadprinter.ml
debugger/main.ml
debugger/parameters.ml
debugger/parameters.mli
debugger/parser.mly
debugger/parser_aux.mli
debugger/primitives.ml
debugger/primitives.mli
debugger/printval.ml
debugger/program_loading.ml
debugger/program_management.ml
debugger/show_information.ml
debugger/show_source.ml
debugger/source.ml
debugger/symbols.ml
debugger/time_travel.ml
debugger/unix_tools.ml
driver/main.ml
man/ocaml.m
myocamlbuild.ml
ocamlbuild/Makefile
ocamlbuild/bool.ml
ocamlbuild/bool.mli
ocamlbuild/command.ml
ocamlbuild/command.mli
ocamlbuild/configuration.ml
ocamlbuild/configuration.mli
ocamlbuild/discard_printf.ml
ocamlbuild/discard_printf.mli
ocamlbuild/display.ml
ocamlbuild/display.mli
ocamlbuild/fda.ml
ocamlbuild/fda.mli
ocamlbuild/flags.ml
ocamlbuild/flags.mli
ocamlbuild/glob.ml
ocamlbuild/glob.mli
ocamlbuild/glob_ast.ml
ocamlbuild/glob_ast.mli
ocamlbuild/glob_lexer.mli
ocamlbuild/glob_lexer.mll
ocamlbuild/hooks.ml
ocamlbuild/hooks.mli
ocamlbuild/hygiene.ml
ocamlbuild/hygiene.mli
ocamlbuild/lexers.mli
ocamlbuild/lexers.mll
ocamlbuild/log.ml
ocamlbuild/log.mli
ocamlbuild/main.ml
ocamlbuild/main.mli
ocamlbuild/misc/opentracer.ml
ocamlbuild/my_std.ml
ocamlbuild/my_std.mli
ocamlbuild/my_unix.ml
ocamlbuild/my_unix.mli
ocamlbuild/ocaml_arch.ml
ocamlbuild/ocaml_arch.mli
ocamlbuild/ocaml_compiler.ml
ocamlbuild/ocaml_compiler.mli
ocamlbuild/ocaml_dependencies.ml
ocamlbuild/ocaml_dependencies.mli
ocamlbuild/ocaml_specific.ml
ocamlbuild/ocaml_specific.mli
ocamlbuild/ocaml_tools.ml
ocamlbuild/ocaml_tools.mli
ocamlbuild/ocaml_utils.ml
ocamlbuild/ocaml_utils.mli
ocamlbuild/ocamlbuild.ml
ocamlbuild/ocamlbuild.mli
ocamlbuild/ocamlbuild_executor.ml
ocamlbuild/ocamlbuild_executor.mli
ocamlbuild/ocamlbuild_pack.mlpack
ocamlbuild/ocamlbuild_plugin.ml
ocamlbuild/ocamlbuild_unix_plugin.ml
ocamlbuild/ocamlbuild_unix_plugin.mli
ocamlbuild/ocamlbuild_where.ml [new file with mode: 0644]
ocamlbuild/ocamlbuild_where.mli
ocamlbuild/ocamlbuildlight.ml
ocamlbuild/ocamlbuildlight.mli
ocamlbuild/options.ml
ocamlbuild/options.mli
ocamlbuild/pathname.ml
ocamlbuild/pathname.mli
ocamlbuild/plugin.ml
ocamlbuild/plugin.mli
ocamlbuild/ppcache.ml
ocamlbuild/ppcache.mli
ocamlbuild/report.ml
ocamlbuild/report.mli
ocamlbuild/resource.ml
ocamlbuild/resource.mli
ocamlbuild/rule.ml
ocamlbuild/rule.mli
ocamlbuild/shell.ml
ocamlbuild/shell.mli
ocamlbuild/signatures.mli
ocamlbuild/slurp.ml
ocamlbuild/slurp.mli
ocamlbuild/solver.ml
ocamlbuild/solver.mli
ocamlbuild/start.sh
ocamlbuild/std_signatures.mli
ocamlbuild/tags.ml
ocamlbuild/tags.mli
ocamlbuild/tools.ml
ocamlbuild/tools.mli
ocamldoc/.depend
ocamldoc/Makefile
ocamldoc/Makefile.nt
ocamldoc/odoc.ml
ocamldoc/odoc_args.ml
ocamldoc/odoc_args.mli
ocamldoc/odoc_messages.ml
ocamldoc/odoc_name.ml
ocamldoc/odoc_opt.ml [deleted file]
otherlibs/dbm/Makefile
otherlibs/labltk/lib/Makefile
otherlibs/labltk/support/Makefile.common
otherlibs/labltk/tkanim/Makefile
otherlibs/num/big_int.ml
otherlibs/num/test/test_big_ints.ml
otherlibs/str/str.ml
otherlibs/systhreads/posix.c
otherlibs/unix/unix.mli
otherlibs/win32unix/pipe.c
otherlibs/win32unix/stat.c
otherlibs/win32unix/unixsupport.c
stdlib/format.ml
stdlib/map.mli
stdlib/parsing.ml
stdlib/pervasives.mli
stdlib/printf.ml
stdlib/scanf.ml
typing/ctype.ml
typing/ctype.mli
typing/env.ml
typing/includeclass.ml
typing/parmatch.ml
typing/subst.ml
typing/subst.mli
typing/typeclass.ml
typing/typecore.ml
typing/typedecl.ml
typing/typetexp.ml
utils/config.mlbuild
utils/config.mlp
utils/tbl.ml
utils/tbl.mli

diff --git a/.depend b/.depend
index 57e692f3e0bd128ce8159956f8d7ec34914fc022..b52df95321c78222c47f26c8ef68c2da0f86991d 100644 (file)
--- a/.depend
+++ b/.depend
@@ -164,13 +164,15 @@ typing/oprint.cmo: typing/outcometree.cmi parsing/asttypes.cmi \
 typing/oprint.cmx: typing/outcometree.cmi parsing/asttypes.cmi \
     typing/oprint.cmi 
 typing/parmatch.cmo: utils/warnings.cmi typing/types.cmi typing/typedtree.cmi \
-    typing/predef.cmi typing/path.cmi utils/misc.cmi parsing/location.cmi \
-    typing/ident.cmi typing/env.cmi typing/datarepr.cmi typing/ctype.cmi \
-    typing/btype.cmi parsing/asttypes.cmi typing/parmatch.cmi 
+    typing/subst.cmi typing/predef.cmi typing/path.cmi utils/misc.cmi \
+    parsing/location.cmi typing/ident.cmi typing/env.cmi typing/datarepr.cmi \
+    typing/ctype.cmi typing/btype.cmi parsing/asttypes.cmi \
+    typing/parmatch.cmi 
 typing/parmatch.cmx: utils/warnings.cmx typing/types.cmx typing/typedtree.cmx \
-    typing/predef.cmx typing/path.cmx utils/misc.cmx parsing/location.cmx \
-    typing/ident.cmx typing/env.cmx typing/datarepr.cmx typing/ctype.cmx \
-    typing/btype.cmx parsing/asttypes.cmi typing/parmatch.cmi 
+    typing/subst.cmx typing/predef.cmx typing/path.cmx utils/misc.cmx \
+    parsing/location.cmx typing/ident.cmx typing/env.cmx typing/datarepr.cmx \
+    typing/ctype.cmx typing/btype.cmx parsing/asttypes.cmi \
+    typing/parmatch.cmi 
 typing/path.cmo: typing/ident.cmi typing/path.cmi 
 typing/path.cmx: typing/ident.cmx typing/path.cmi 
 typing/predef.cmo: typing/types.cmi typing/path.cmi typing/ident.cmi \
@@ -287,7 +289,7 @@ bytecomp/bytesections.cmi:
 bytecomp/cmo_format.cmi: bytecomp/lambda.cmi typing/ident.cmi 
 bytecomp/dll.cmi: 
 bytecomp/emitcode.cmi: bytecomp/instruct.cmi bytecomp/cmo_format.cmi 
-bytecomp/instruct.cmi: typing/types.cmi parsing/location.cmi \
+bytecomp/instruct.cmi: typing/types.cmi typing/subst.cmi parsing/location.cmi \
     bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi 
 bytecomp/lambda.cmi: typing/types.cmi typing/primitive.cmi typing/path.cmi \
     parsing/location.cmi typing/ident.cmi typing/env.cmi parsing/asttypes.cmi 
@@ -310,12 +312,12 @@ bytecomp/translmod.cmi: typing/typedtree.cmi typing/primitive.cmi \
 bytecomp/translobj.cmi: bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi 
 bytecomp/typeopt.cmi: typing/typedtree.cmi typing/path.cmi \
     bytecomp/lambda.cmi 
-bytecomp/bytegen.cmo: typing/types.cmi bytecomp/switch.cmi typing/stypes.cmi \
-    typing/primitive.cmi utils/misc.cmi bytecomp/lambda.cmi \
+bytecomp/bytegen.cmo: typing/types.cmi bytecomp/switch.cmi typing/subst.cmi \
+    typing/stypes.cmi typing/primitive.cmi utils/misc.cmi bytecomp/lambda.cmi \
     bytecomp/instruct.cmi typing/ident.cmi utils/config.cmi \
     parsing/asttypes.cmi typing/annot.cmi bytecomp/bytegen.cmi 
-bytecomp/bytegen.cmx: typing/types.cmx bytecomp/switch.cmx typing/stypes.cmx \
-    typing/primitive.cmx utils/misc.cmx bytecomp/lambda.cmx \
+bytecomp/bytegen.cmx: typing/types.cmx bytecomp/switch.cmx typing/subst.cmx \
+    typing/stypes.cmx typing/primitive.cmx utils/misc.cmx bytecomp/lambda.cmx \
     bytecomp/instruct.cmx typing/ident.cmx utils/config.cmx \
     parsing/asttypes.cmi typing/annot.cmi bytecomp/bytegen.cmi 
 bytecomp/bytelibrarian.cmo: utils/misc.cmi utils/config.cmi \
@@ -335,15 +337,15 @@ bytecomp/bytelink.cmx: bytecomp/symtable.cmx bytecomp/opcodes.cmx \
     utils/clflags.cmx utils/ccomp.cmx bytecomp/bytesections.cmx \
     bytecomp/bytelink.cmi 
 bytecomp/bytepackager.cmo: typing/typemod.cmi bytecomp/translmod.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 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 \
-    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 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/config.cmi bytecomp/bytesections.cmi 
 bytecomp/bytesections.cmx: utils/config.cmx bytecomp/bytesections.cmi 
 bytecomp/dll.cmo: utils/misc.cmi utils/config.cmi bytecomp/dll.cmi 
@@ -358,9 +360,9 @@ bytecomp/emitcode.cmx: bytecomp/translmod.cmx typing/primitive.cmx \
     bytecomp/instruct.cmx typing/env.cmx utils/config.cmx \
     bytecomp/cmo_format.cmi utils/clflags.cmx typing/btype.cmx \
     parsing/asttypes.cmi bytecomp/emitcode.cmi 
-bytecomp/instruct.cmo: typing/types.cmi parsing/location.cmi \
+bytecomp/instruct.cmo: typing/types.cmi typing/subst.cmi parsing/location.cmi \
     bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi bytecomp/instruct.cmi 
-bytecomp/instruct.cmx: typing/types.cmx parsing/location.cmx \
+bytecomp/instruct.cmx: typing/types.cmx typing/subst.cmx parsing/location.cmx \
     bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx bytecomp/instruct.cmi 
 bytecomp/lambda.cmo: typing/types.cmi typing/primitive.cmi typing/path.cmi \
     utils/misc.cmi parsing/location.cmi typing/ident.cmi typing/env.cmi \
diff --git a/Changes b/Changes
index 4176ceb61a94601f18651a0fce1dd9c64961b79a..34eb1d9828a852ec5c3bd1f4075a8f9efcb31ba6 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,51 @@
+Objective Caml 3.11.1:
+----------------------
+
+Bug fixes:
+- PR#4095: ocamldebug: strange behaviour of control-C
+- PR#4403: ocamldebug: improved handling of packed modules
+- PR#4650: Str.regexp_case_fold mis-handling complemented character sets [^a]
+- PR#4660: Scanf.format_from_string: handling of double quote
+- PR#4666: Unix.exec* failure in multithread programs under MacOS X and FreeBSD
+- PR#4667: debugger out of sync with dynlink changes
+- PR#4678: random "out of memory" error with systhreads
+- PR#4690: issue with dynamic loading under MacOS 10.5
+- PR#4692: wrong error message with options -i and -pack passed to ocamlc
+- PR#4699: in otherlibs/dbm, fixed construction of dlldbm.so.
+- PR#4704: error in caml_modify_generational_global_root()
+- PR#4708: (ocamldoc) improved printing of infix identifiers such as "lor".
+- PR#4722: typo in configure script
+- PR#4729: documented the fact that PF_INET6 is not available on all platforms
+- PR#4730: incorrect typing involving abbreviation "type 'a t = 'a"
+- PR#4731: incorrect quoting of arguments passed to the assembler on x86-64
+- PR#4735: Unix.LargeFile.fstat cannot report size over 32bits on Win32
+- PR#4740: guard against possible processor error in
+           {Int32,Int64,Nativeint}.{div,rem}
+- PR#4745: type inference wrongly produced non-generalizable type variables.
+- PR#4749: better pipe size for win32unix
+- PR#4756: printf: no error reported for wrong format '%_s'
+- PR#4758: scanf: handling of \<newline> by format '%S'
+- PR#4766: incorrect simplification of some type abbreviations.
+- PR#4768: printf: %F does not respect width and precision specifications
+- PR#4769: Format.bprintf fails to flush
+- PR#4775: compiler crash on crazy types (temporary fix)
+- PR#4776: bad interaction between exceptions and classes
+- PR#4780: labltk build problem under Windows.
+- PR#4790: under Windows, map ERROR_NO_DATA Win32 error to EPIPE Unix error.
+- PR#4792: bug in Big_int.big_int_of_int64 on 32-bit platforms.
+- Module Parsing: improved computation of locations when an ocamlyacc rule
+                  starts with an empty nonterminal
+- Type-checker: fixed wrong variance computation for private types
+- x86-32 code generator, MSVC port: wrong "fld" instruction generated.
+- ocamlbuild: incorrectly using the compile-time value of $OCAMLLIB
+- Makefile problem when configured with -no-shared-libs
+- ocamldoc: use dynamic loading in native code
+
+Other changes:
+- Improved wording of various error messages
+  (contributed by Jonathan Davies, Citrix).
+- Support for 64-bit mode in Solaris/x86 (PR#4670).
+
 Objective Caml 3.11.0:
 ----------------------
 
@@ -2387,4 +2435,4 @@ Caml Special Light 1.06:
 
 * First public release.
 
-$Id: Changes,v 1.183.2.8 2008/12/03 16:16:30 doligez Exp $
+$Id: Changes,v 1.183.2.13 2009/05/19 14:46:13 doligez Exp $
index 5a015ee36f108ceb2617148af290ad60ca8396ba..c33a2686b2393b7632b701fd136a7197c97e5306 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile,v 1.222.2.2 2008/10/23 15:29:11 ertai Exp $
+# $Id: Makefile,v 1.222.2.3 2009/05/19 14:46:13 doligez Exp $
 
 # The main Makefile
 
@@ -739,14 +739,8 @@ clean::
        $(CAMLOPT) $(COMPFLAGS) -c $<
 
 partialclean::
-       rm -f utils/*.cm[iox] utils/*.[so] utils/*~
-       rm -f parsing/*.cm[iox] parsing/*.[so] parsing/*~
-       rm -f typing/*.cm[iox] typing/*.[so] typing/*~
-       rm -f bytecomp/*.cm[iox] bytecomp/*.[so] bytecomp/*~
-       rm -f asmcomp/*.cm[iox] asmcomp/*.[so] asmcomp/*~
-       rm -f driver/*.cm[iox] driver/*.[so] driver/*~
-       rm -f toplevel/*.cm[iox] toplevel/*.[so] toplevel/*~
-       rm -f tools/*.cm[iox] tools/*.[so] tools/*~
+       for d in utils parsing typing bytecomp asmcomp driver toplevel tools; \
+         do rm -f $$d/*.cm[iox] $$d/*.annot $$d/*.[so] $$d/*~; done
        rm -f *~
 
 depend: beforedepend
diff --git a/VERSION b/VERSION
index 8444af032ce3979c7c0ec260178416eabb3d6c0b..7486269b85a1f11196f784b2779c689438ebe14a 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
-3.11.0
+3.11.1+rc0
 
 # The version string is the first line of this file.
 # It must be in the format described in stdlib/sys.mli
 
-# $Id: VERSION,v 1.26.2.7 2008/12/03 16:16:30 doligez Exp $
+# $Id: VERSION,v 1.26.2.13 2009/05/19 14:46:13 doligez Exp $
diff --git a/_tags b/_tags
index 47121f86152e3c438ec10f470b4665bbfda5acbc..37ba928ef42e33f9938c48ab8caf5b6e7956748e 100644 (file)
--- a/_tags
+++ b/_tags
@@ -26,8 +26,7 @@ true: use_stdlib
 <ocamldoc/**>: -debug
 <ocamldoc/*.ml>: ocamldoc_sources
 <ocamldoc/*.ml*>: include_unix, include_str, include_dynlink
-"ocamldoc/odoc.byte": use_unix, use_str, use_dynlink
-"ocamldoc/odoc_opt.native": use_unix, use_str
+<ocamldoc/odoc.{byte,native}>: use_unix, use_str, use_dynlink
 
 <camlp4/**/*.ml*>: camlp4boot, -warn_Alez, warn_Ale
 <camlp4/Camlp4_{config,import}.ml*>: -camlp4boot
index 4516178a7a5f2a57eccab29caa5583fb1a02c112..a5b4643f9d73f59ac35d1fb284e5efc000e72c09 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp,v 1.16.2.2 2008/11/08 16:08:09 xleroy Exp $ *)
+(* $Id: emit.mlp,v 1.16.2.4 2009/03/28 15:10:04 xleroy Exp $ *)
 
 (* Emission of x86-64 (AMD 64) assembly code *)
 
@@ -668,7 +668,11 @@ let fundecl fundecl =
   bound_error_call := 0;
   `    .text\n`;
   emit_align 16;
-  `    .globl  {emit_symbol fundecl.fun_name}\n`;
+  if macosx && is_generic_function fundecl.fun_name
+  then (* PR#4690 *)
+    `  .private_extern {emit_symbol fundecl.fun_name}\n`
+  else
+    `  .globl  {emit_symbol fundecl.fun_name}\n`;
   `{emit_symbol fundecl.fun_name}:\n`;
   if !Clflags.gprofile then emit_profile();
   if frame_required() then begin
@@ -753,12 +757,13 @@ let begin_assembly() =
   let lbl_begin = Compilenv.make_symbol (Some "code_begin") in
   `    .text\n`;
   `    .globl  {emit_symbol lbl_begin}\n`;
-  `{emit_symbol lbl_begin}:\n`
+  `{emit_symbol lbl_begin}:\n`;
+  if macosx then `     nop\n` (* PR#4690 *)
 
 let end_assembly() =
   let lbl_end = Compilenv.make_symbol (Some "code_end") in
   `    .text\n`;
-  if macosx then `     NOP\n`; (* suppress "ld warning: atom sorting error" *)
+  if macosx then `     nop\n`; (* suppress "ld warning: atom sorting error" *)
   `    .globl  {emit_symbol lbl_end}\n`;
   `{emit_symbol lbl_end}:\n`;
   `    .data\n`;
index f4cf25550422db26c761225e724474a8de79ebe9..d6766eeeb522911ac8b9697047a0844944fd70b1 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: proc.ml,v 1.5 2007/11/06 15:16:55 frisch Exp $ *)
+(* $Id: proc.ml,v 1.5.4.1 2009/03/28 15:52:13 xleroy Exp $ *)
 
 (* Description of the AMD64 processor *)
 
@@ -197,5 +197,5 @@ let contains_calls = ref false
 (* Calling the assembler *)
 
 let assemble_file infile outfile =
-  Ccomp.command (Config.asm ^ " -o " ^ outfile ^ " " ^ infile)
-
+  Ccomp.command (Config.asm ^ " -o " ^
+                 Filename.quote outfile ^ " " ^ Filename.quote infile)
index e9041f0685386e64a87dd7892525476dcfa220f5..9cf8c956647787dfeab7c509d39e8b665be49888 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: cmmgen.ml,v 1.114 2008/08/05 13:35:20 xleroy Exp $ *)
+(* $Id: cmmgen.ml,v 1.114.2.1 2009/01/26 17:06:10 xleroy Exp $ *)
 
 (* Translation from closed lambda to C-- *)
 
@@ -1943,9 +1943,8 @@ module IntSet = Set.Make(
   end)
 
 let default_apply = IntSet.add 2 (IntSet.add 3 IntSet.empty)
-  (* These apply funs are always present in the main program.
-     TODO: add more, and do the same for send and curry funs
-     (maybe up to 10-15?). *)
+  (* These apply funs are always present in the main program because
+     the run-time system needs them (cf. asmrun/<arch>.S) . *)
 
 let generic_functions shared units =
   let (apply,send,curry) =
@@ -1955,12 +1954,8 @@ let generic_functions shared units =
         List.fold_right IntSet.add ui.Compilenv.ui_send_fun send,
         List.fold_right IntSet.add ui.Compilenv.ui_curry_fun curry)
       (IntSet.empty,IntSet.empty,IntSet.empty)
-      units
-  in
-  let apply =
-    if shared then IntSet.diff apply default_apply
-    else IntSet.union apply default_apply
-  in
+      units in
+  let apply = if shared then apply else IntSet.union apply default_apply in
   let accu = IntSet.fold (fun n accu -> apply_function n :: accu) apply [] in
   let accu = IntSet.fold (fun n accu -> send_function n :: accu) send accu in
   IntSet.fold (fun n accu -> curry_function n @ accu) curry accu
index ee381a591dea5a9d8b4f923c65a691821a340f90..fe8279a396029591a2cb60e316e22be7874fe62a 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emitaux.ml,v 1.12 2007/01/29 12:10:50 xleroy Exp $ *)
+(* $Id: emitaux.ml,v 1.12.12.1 2009/01/26 17:06:10 xleroy Exp $ *)
 
 (* Common functions for emitting assembly code *)
 
@@ -156,3 +156,16 @@ let emit_frames a =
   List.iter emit_frame !frame_descriptors;
   Hashtbl.iter emit_filename filenames;
   frame_descriptors := []
+
+(* Detection of functions that can be duplicated between a DLL and
+   the main program (PR#4690) *)
+
+let isprefix s1 s2 =
+  String.length s1 <= String.length s2
+  && String.sub s2 0 (String.length s1) = s1
+
+let is_generic_function name =
+  List.exists
+    (fun p -> isprefix p name)
+    ["caml_apply"; "caml_curry"; "caml_send"; "caml_tuplify"]
+
index bf8ef1e79e3af4571a7bbc606845806c1f324248..a63c8babc08a1adf29041dfedbc223a2d4edea37 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emitaux.mli,v 1.12 2007/01/29 12:10:50 xleroy Exp $ *)
+(* $Id: emitaux.mli,v 1.12.12.1 2009/01/26 17:06:10 xleroy Exp $ *)
 
 (* Common functions for emitting assembly code *)
 
@@ -45,3 +45,5 @@ type emit_frame_actions =
     efa_string: string -> unit }
 
 val emit_frames: emit_frame_actions -> unit
+
+val is_generic_function: string -> bool
index 13af98155c0607ec916c07e271a3821b1c75e721..a073675fba6022be8c53748005341970ee5c541f 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp,v 1.41.2.2 2008/11/08 16:08:09 xleroy Exp $ *)
+(* $Id: emit.mlp,v 1.41.2.4 2009/03/28 15:10:04 xleroy Exp $ *)
 
 (* Emission of Intel 386 assembly code *)
 
@@ -888,7 +888,11 @@ let fundecl fundecl =
   bound_error_call := 0;
   `    .text\n`;
   emit_align 16;
-  `    .globl  {emit_symbol fundecl.fun_name}\n`;
+  if macosx && is_generic_function fundecl.fun_name
+  then (* PR#4690 *)
+    `  .private_extern {emit_symbol fundecl.fun_name}\n`
+  else
+    `  .globl  {emit_symbol fundecl.fun_name}\n`;
   `{emit_symbol fundecl.fun_name}:\n`;
   if !Clflags.gprofile then emit_profile();
   let n = frame_size() - 4 in
@@ -954,12 +958,13 @@ let begin_assembly() =
   let lbl_begin = Compilenv.make_symbol (Some "code_begin") in
   `    .text\n`;
   `    .globl  {emit_symbol lbl_begin}\n`;
-  `{emit_symbol lbl_begin}:\n`
+  `{emit_symbol lbl_begin}:\n`;
+  if macosx then `     nop\n` (* PR#4690 *)
 
 let end_assembly() =
   let lbl_end = Compilenv.make_symbol (Some "code_end") in
   `    .text\n`;
-  if macosx then `     NOP\n`; (* suppress "ld warning: atom sorting error" *)
+  if macosx then `     nop\n`; (* suppress "ld warning: atom sorting error" *)
   `    .globl  {emit_symbol lbl_end}\n`;
   `{emit_symbol lbl_end}:\n`;
   `    .data\n`;
index 8cf816ac9450e7ff4550096c17655748afe82659..5195b21fcf01d04ec90de14550f24a5de99052b1 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit_nt.mlp,v 1.28 2008/01/11 16:13:11 doligez Exp $ *)
+(* $Id: emit_nt.mlp,v 1.28.4.1 2009/03/21 16:15:47 xleroy Exp $ *)
 
 (* Emission of Intel 386 assembly code, MASM syntax. *)
 
@@ -379,7 +379,7 @@ let emit_instr i =
             if is_tos src then
               `        fstp    {emit_reg dst}\n`
             else if is_tos dst then
-              `        fld     {emit_reg dst}\n`
+              `        fld     {emit_reg src}\n`
             else begin
               `        fld     {emit_reg src}\n`;
               `        fstp    {emit_reg dst}\n`
index e9c12feea5f618b25fe5c7ed38af24c220e5f76c..5c2063d49ddad7846462d5f484079f3efdff05ed 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp,v 1.26 2007/11/09 15:06:57 frisch Exp $ *)
+(* $Id: emit.mlp,v 1.26.4.1 2009/01/26 17:06:10 xleroy Exp $ *)
 
 (* Emission of PowerPC assembly code *)
 
@@ -835,6 +835,10 @@ let fundecl fundecl =
   call_gc_label := 0;
   float_literals := [];
   int_literals := [];
+  if Config.system = "rhapsody" && is_generic_function fundecl.fun_name
+  then (* PR#4690 *)
+    `  .private_extern {emit_symbol fundecl.fun_name}\n`
+  else
   `    .globl  {emit_symbol fundecl.fun_name}\n`;
   begin match Config.system with
   | "elf" | "bsd" ->
index 919ff4521f71000b67047c7fb13f63827fdf3357..0422c2d1e1d82a7161ca3b573b6249681672765e 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: signals_osdep.h,v 1.11.4.1 2008/11/07 10:34:16 xleroy Exp $ */
+/* $Id: signals_osdep.h,v 1.11.4.2 2009/03/28 15:18:31 xleroy Exp $ */
 
 /* Processor- and OS-dependent signal interface */
 
   #define CONTEXT_SP (CONTEXT_STATE.CONTEXT_REG(rsp))
   #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
 
+/****************** AMD64, Solaris x86 */
+
+#elif defined(TARGET_amd64) && defined (SYS_solaris)
+
+  #include <ucontext.h>
+
+  #define DECLARE_SIGNAL_HANDLER(name) \
+    static void name(int sig, siginfo_t * info, ucontext_t * context)
+
+  #define SET_SIGACT(sigact,name) \
+    sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \
+    sigact.sa_flags = SA_SIGINFO
+
+  typedef greg_t context_reg;
+  #define CONTEXT_PC (context->uc_mcontext.gregs[REG_RIP])
+  #define CONTEXT_EXCEPTION_POINTER (context->uc_mcontext.gregs[REG_R14])
+  #define CONTEXT_YOUNG_PTR (context->uc_mcontext.gregs[REG_R15])
+  #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
+
 /****************** I386, Linux */
 
 #elif defined(TARGET_i386) && defined(SYS_linux_elf)
   #define CONTEXT_PC (CONTEXT_STATE.CONTEXT_REG(eip))
   #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
 
+/****************** I386, Solaris x86 */
+
+#elif defined(TARGET_i386) && defined(SYS_solaris)
+
+  #define DECLARE_SIGNAL_HANDLER(name) \
+    static void name(int sig, siginfo_t * info, void * context)
+
+  #define SET_SIGACT(sigact,name) \
+    sigact.sa_sigaction = (name); \
+    sigact.sa_flags = SA_SIGINFO
+
+  #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
+
 /****************** MIPS, all OS */
 
 #elif defined(TARGET_mips)
index 2ee22ef5dfbd950ec21c3f782b463785fb9229ea..58a535d7430f5b16bb8a0815c1c615e58f832650 100755 (executable)
Binary files a/boot/myocamlbuild.boot and b/boot/myocamlbuild.boot differ
index 8002783b5afe0b543635ee867f8547b9dc09d704..8c55166e1bbafa43c8047fd2da59b876319c5729 100755 (executable)
Binary files a/boot/ocamlc and b/boot/ocamlc differ
index 0ff6b5015c2bda6520a1fc8a0718c4b91895b492..5bf8338f0963b85c9676023c91aaa472a800d094 100755 (executable)
Binary files a/boot/ocamldep and b/boot/ocamldep differ
index f2775309fdf4e22b389bbc77cffde366962c1a5a..087d530dc18a7e2b601676001253a01dc07e3356 100755 (executable)
Binary files a/boot/ocamllex and b/boot/ocamllex differ
index 0a5fab875e1276f8579161ab4865aa3171617e0d..ffb2b46e2532e5c8459e4b4af4331969d793659e 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: bytegen.ml,v 1.72 2008/10/03 15:02:55 maranget Exp $ *)
+(* $Id: bytegen.ml,v 1.72.2.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (*  bytegen.ml : translation of lambda terms to lists of instructions. *)
 
@@ -171,6 +171,7 @@ let copy_event ev kind info repr =
     ev_kind = kind;
     ev_info = info;
     ev_typenv = ev.ev_typenv;
+    ev_typsubst = ev.ev_typsubst;
     ev_compenv = ev.ev_compenv;
     ev_stacksize = ev.ev_stacksize;
     ev_repr = repr }
@@ -714,6 +715,7 @@ let rec comp_expr env exp sz cont =
           ev_kind = kind;
           ev_info = info;
           ev_typenv = lev.lev_env;
+          ev_typsubst = Subst.identity;
           ev_compenv = env;
           ev_stacksize = sz;
           ev_repr =
index d0712cb3c455adc2c29bf70b4067dd30fae40546..7915aede2ef443a58edc23d212721408ca58c794 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: bytepackager.ml,v 1.6 2007/02/23 13:44:51 ertai Exp $ *)
+(* $Id: bytepackager.ml,v 1.6.10.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (* "Package" a set of .cmo files into one .cmo file having the
    original compilation units as sub-modules. *)
@@ -66,9 +66,11 @@ let rename_relocation objfile mapping defined base (rel, ofs) =
 
 (* Record and relocate a debugging event *)
 
-let relocate_debug base ev =
-  ev.ev_pos <- base + ev.ev_pos;
-  events := ev :: !events
+let relocate_debug base prefix subst ev =
+  let ev' = { ev with ev_pos = base + ev.ev_pos;
+                      ev_module = prefix ^ "." ^ ev.ev_module;
+                      ev_typsubst = Subst.compose ev.ev_typsubst subst } in
+  events := ev' :: !events
 
 (* Read the unit information from a .cmo file. *)
 
@@ -110,7 +112,7 @@ let read_member_info file =
    Accumulate relocs, debug info, etc.
    Return size of bytecode. *)
 
-let rename_append_bytecode oc mapping defined ofs objfile compunit =
+let rename_append_bytecode oc mapping defined ofs prefix subst objfile compunit =
   let ic = open_in_bin objfile in
   try
     Bytelink.check_consistency objfile compunit;
@@ -123,7 +125,7 @@ let rename_append_bytecode oc mapping defined ofs objfile compunit =
     Misc.copy_file_chunk ic oc compunit.cu_codesize;
     if !Clflags.debug && compunit.cu_debug > 0 then begin
       seek_in ic compunit.cu_debug;
-      List.iter (relocate_debug ofs) (input_value ic);
+      List.iter (relocate_debug ofs prefix subst) (input_value ic);
     end;
     close_in ic;
     compunit.cu_codesize
@@ -134,20 +136,22 @@ let rename_append_bytecode oc mapping defined ofs objfile compunit =
 (* Same, for a list of .cmo and .cmi files.
    Return total size of bytecode. *)
 
-let rec rename_append_bytecode_list oc mapping defined ofs = function
+let rec rename_append_bytecode_list oc mapping defined ofs prefix subst = function
     [] ->
       ofs
   | m :: rem ->
       match m.pm_kind with
       | PM_intf ->
-          rename_append_bytecode_list oc mapping defined ofs rem
+          rename_append_bytecode_list oc mapping defined ofs prefix subst rem
       | PM_impl compunit ->
           let size =
-            rename_append_bytecode oc mapping defined ofs 
+            rename_append_bytecode oc mapping defined ofs prefix subst
                                    m.pm_file compunit in
+          let id = Ident.create_persistent m.pm_name in
+          let root = Path.Pident (Ident.create_persistent prefix) in
           rename_append_bytecode_list
-            oc mapping (Ident.create_persistent m.pm_name :: defined)
-            (ofs + size) rem
+            oc mapping (id :: defined)
+            (ofs + size) prefix (Subst.add_module id (Path.Pdot (root, Ident.name id, Path.nopos)) subst) rem
 
 (* Generate the code that builds the tuple representing the package module *)
 
@@ -187,7 +191,7 @@ let package_object_files files targetfile targetname coercion =
     let pos_depl = pos_out oc in
     output_binary_int oc 0;
     let pos_code = pos_out oc in
-    let ofs = rename_append_bytecode_list oc mapping [] 0 members in
+    let ofs = rename_append_bytecode_list oc mapping [] 0 targetname Subst.identity members in
     build_global_target oc targetname members mapping ofs coercion;
     let pos_debug = pos_out oc in
     if !Clflags.debug && !events <> [] then
index 540180f0439027a184e13b6f44817fa290aaa867..65112a2132fcb18608c9611cf52b7ec9ca9b2833 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: dll.ml,v 1.13 2006/09/28 21:36:38 xleroy Exp $ *)
+(* $Id: dll.ml,v 1.13.14.1 2009/05/01 01:46:50 garrigue Exp $ *)
 
 (* Handling of dynamically-linked libraries *)
 
@@ -85,13 +85,16 @@ let close_all_dlls () =
    Raise [Not_found] if not found. *)
 
 let find_primitive prim_name =
-  let rec find = function
+  let rec find seen = function
     [] ->
       raise Not_found
   | dll :: rem ->
       let addr = dll_sym dll prim_name in
-      if addr == Obj.magic () then find rem else addr in
-  find !opened_dlls
+      if addr == Obj.magic () then find (dll :: seen) rem else begin
+        if seen <> [] then opened_dlls := dll :: List.rev_append seen rem;
+        addr
+      end in
+  find [] !opened_dlls
 
 (* If linking in core (dynlink or toplevel), synchronize the VM
    table of primitive with the linker's table of primitive
index a1d31df299ffdfde1682df36e5a0d66ec6818c8d..2169ac74dbd92e0a879da8d4766457b246920154 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: instruct.ml,v 1.22 2005/08/25 15:35:16 doligez Exp $ *)
+(* $Id: instruct.ml,v 1.22.20.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 open Lambda
 
@@ -26,6 +26,7 @@ type debug_event =
     ev_kind: debug_event_kind;          (* Before/after event *)
     ev_info: debug_event_info;          (* Extra information *)
     ev_typenv: Env.summary;             (* Typing environment *)
+    ev_typsubst: Subst.t;               (* Substitution over types *)
     ev_compenv: compilation_env;        (* Compilation environment *)
     ev_stacksize: int;                  (* Size of stack frame *)
     ev_repr: debug_event_repr }         (* Position of the representative *)
index 5743af92fe6125ed34be8be21f31c65f360b4920..ce97609fc40864e183944ce1f7ac785a1582cc8a 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: instruct.mli,v 1.22 2005/10/25 15:56:45 doligez Exp $ *)
+(* $Id: instruct.mli,v 1.22.20.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (* The type of the instructions of the abstract machine *)
 
@@ -44,6 +44,7 @@ type debug_event =
     ev_kind: debug_event_kind;          (* Before/after event *)
     ev_info: debug_event_info;          (* Extra information *)
     ev_typenv: Env.summary;             (* Typing environment *)
+    ev_typsubst: Subst.t;               (* Substitution over types *)
     ev_compenv: compilation_env;        (* Compilation environment *)
     ev_stacksize: int;                  (* Size of stack frame *)
     ev_repr: debug_event_repr }         (* Position of the representative *)
index a22c069d91f432e39d800c51618aacf3ee02fe62..ac1c25245a06a3da4e2c1e77c8f12024634c1d76 100644 (file)
@@ -11,7 +11,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile,v 1.64.2.1 2008/11/08 16:29:02 xleroy Exp $
+# $Id: Makefile,v 1.64.2.3 2009/05/13 05:00:48 garrigue Exp $
 
 include Makefile.common
 
@@ -22,14 +22,14 @@ OBJS=$(COMMONOBJS) unix.o main.o
 DOBJS=$(OBJS:.o=.d.o) instrtrace.d.o
 PICOBJS=$(OBJS:.o=.pic.o)
 
-#ifeq ($(SUPPORTS_SHARED_LIBRARIES),true)
+TMP_SHARED_LIBRARIES=$(SUPPORTS_SHARED_LIBRARIES:false=)
+SHARED_LIBRARIES_DEPS=$(TMP_SHARED_LIBRARIES:true=libcamlrun_shared.so)
 
-all:: libcamlrun_shared.so
+all:: $(SHARED_LIBRARIES_DEPS)
 
 install::
-       cp libcamlrun_shared.so $(LIBDIR)/libcamlrun_shared.so
-
-#endif
+       if test -f libcamlrun_shared.so; then \
+         cp libcamlrun_shared.so $(LIBDIR)/libcamlrun_shared.so; fi
 
 ocamlrun$(EXE): libcamlrun.a prims.o
        $(MKEXE) $(BYTECCLINKOPTS) -o ocamlrun$(EXE) \
index 980866a6a0f8fc6c376184d467a0a652296fb2b6..f352f28ae098deb1398f4b08500fb3197851be5f 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: finalise.c,v 1.23 2008/07/28 12:03:55 doligez Exp $ */
+/* $Id: finalise.c,v 1.23.2.1 2009/05/18 09:37:46 doligez Exp $ */
 
 /* Handling of finalised values. */
 
@@ -139,7 +139,7 @@ void caml_final_do_calls (void)
       -- to_do_hd->size;
       f = to_do_hd->item[to_do_hd->size];
       running_finalisation_function = 1;
-      caml_callback (f.fun, f.val + f.offset);
+      caml_callback (f.fun, f.val + f.offset);   /* FIXME PR#4742 */
       running_finalisation_function = 0;
     }
     caml_gc_message (0x80, "Done calling finalisation functions.\n", 0);
index f2372c1cbf45bbcd8c3f3b17b9302d7b24c77b0c..3f60e95dd919f8f4c2cc18f026077942cf0181fb 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: globroots.c,v 1.11 2008/07/14 06:28:27 xleroy Exp $ */
+/* $Id: globroots.c,v 1.11.2.1 2009/03/28 15:26:37 xleroy Exp $ */
 
 /* Registration of global memory roots */
 
@@ -232,6 +232,28 @@ CAMLexport void caml_modify_generational_global_root(value *r, value newval)
     caml_delete_global_root(&caml_global_roots_old, r);
     caml_insert_global_root(&caml_global_roots_young, r);
   }
+  /* PR#4704 */
+  else if (!Is_block(oldval) && Is_block(newval)) {
+    /* The previous value in the root was unboxed but now it is boxed.
+       The root won't appear in any of the root lists thus far (by virtue
+       of the operation of [caml_register_generational_global_root]), so we
+       need to make sure it gets in, or else it will never be scanned. */
+    if (Is_young(newval))
+      caml_insert_global_root(&caml_global_roots_young, r);
+    else if (Is_in_heap(newval))
+      caml_insert_global_root(&caml_global_roots_old, r);
+  }
+  else if (Is_block(oldval) && !Is_block(newval)) {
+    /* The previous value in the root was boxed but now it is unboxed, so
+       the root should be removed. If [oldval] is young, this will happen
+       anyway at the next minor collection, but it is safer to delete it
+       here. */
+    if (Is_young(oldval))
+      caml_delete_global_root(&caml_global_roots_young, r);
+    else if (Is_in_heap(oldval))
+      caml_delete_global_root(&caml_global_roots_old, r);
+  }
+  /* end PR#4704 */
   *r = newval;
 }
 
index ba8a6014915b77c27fca40038da2120c427efebd..f788103cea6b51e0030859d47968ad917690dd79 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: int64_emul.h,v 1.5 2005/09/22 14:21:50 xleroy Exp $ */
+/* $Id: int64_emul.h,v 1.5.18.1 2009/03/28 18:34:19 xleroy Exp $ */
 
 /* Software emulation of 64-bit integer arithmetic, for C compilers
    that do not support it.  */
@@ -96,8 +96,9 @@ static int64 I64_mul(int64 x, int64 y)
 }
 
 #define I64_is_zero(x) (((x).l | (x).h) == 0)
-
 #define I64_is_negative(x) ((int32) (x).h < 0)
+#define I64_is_min_int(x) ((x).l == 0 && (x).h = 0x80000000U)
+#define I64_is_minus_one(x) (((x).l & (x).h) == 0xFFFFFFFFU)
 
 /* Bitwise operations */
 static int64 I64_and(int64 x, int64 y)
index 2341e9989100c89fd719609b9708b9f897ddb731..9fe40cbffd9389f5e2f9df1cceacd488771b9ae5 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: int64_native.h,v 1.5 2005/09/22 14:21:50 xleroy Exp $ */
+/* $Id: int64_native.h,v 1.5.18.1 2009/03/28 18:34:19 xleroy Exp $ */
 
 /* Wrapper macros around native 64-bit integer arithmetic,
    so that it has the same interface as the software emulation
@@ -29,6 +29,9 @@
 #define I64_mul(x,y) ((x) * (y))
 #define I64_is_zero(x) ((x) == 0)
 #define I64_is_negative(x) ((x) < 0)
+#define I64_is_min_int(x) ((x) == ((int64)1 << 63))
+#define I64_is_minus_one(x) ((x) == -1)
+
 #define I64_div(x,y) ((x) / (y))
 #define I64_mod(x,y) ((x) % (y))
 #define I64_udivmod(x,y,quo,rem) \
index f6448c848267062105d197ffbe15a2646b1b5a23..f6c9d70ccf2b9d3a4f6b7d5aca6ee8f13a51bafe 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: ints.c,v 1.51 2008/01/11 16:13:16 doligez Exp $ */
+/* $Id: ints.c,v 1.51.4.2 2009/03/28 18:43:08 xleroy Exp $ */
 
 #include <stdio.h>
 #include <string.h>
@@ -248,23 +248,31 @@ CAMLprim value caml_int32_mul(value v1, value v2)
 
 CAMLprim value caml_int32_div(value v1, value v2)
 {
+  int32 dividend = Int32_val(v1);
   int32 divisor = Int32_val(v2);
   if (divisor == 0) caml_raise_zero_divide();
+  /* PR#4740: on some processors, division crashes on overflow.
+     Implement the same behavior as for type "int". */
+  if (dividend == (1<<31) && divisor == -1) return v1;
 #ifdef NONSTANDARD_DIV_MOD
-  return caml_copy_int32(caml_safe_div(Int32_val(v1), divisor));
+  return caml_copy_int32(caml_safe_div(dividend, divisor));
 #else
-  return caml_copy_int32(Int32_val(v1) / divisor);
+  return caml_copy_int32(dividend / divisor);
 #endif
 }
 
 CAMLprim value caml_int32_mod(value v1, value v2)
 {
+  int32 dividend = Int32_val(v1);
   int32 divisor = Int32_val(v2);
   if (divisor == 0) caml_raise_zero_divide();
+  /* PR#4740: on some processors, modulus crashes if division overflows.
+     Implement the same behavior as for type "int". */
+  if (dividend == (1<<31) && divisor == -1) return caml_copy_int32(0);
 #ifdef NONSTANDARD_DIV_MOD
-  return caml_copy_int32(caml_safe_mod(Int32_val(v1), divisor));
+  return caml_copy_int32(caml_safe_mod(dividend, divisor));
 #else
-  return caml_copy_int32(Int32_val(v1) % divisor);
+  return caml_copy_int32(dividend % divisor);
 #endif
 }
 
@@ -430,15 +438,26 @@ CAMLprim value caml_int64_mul(value v1, value v2)
 
 CAMLprim value caml_int64_div(value v1, value v2)
 {
+  int64 dividend = Int64_val(v1);
   int64 divisor = Int64_val(v2);
   if (I64_is_zero(divisor)) caml_raise_zero_divide();
+  /* PR#4740: on some processors, division crashes on overflow.
+     Implement the same behavior as for type "int". */
+  if (I64_is_min_int(dividend) && I64_is_minus_one(divisor)) return v1;
   return caml_copy_int64(I64_div(Int64_val(v1), divisor));
 }
 
 CAMLprim value caml_int64_mod(value v1, value v2)
 {
+  int64 dividend = Int64_val(v1);
   int64 divisor = Int64_val(v2);
   if (I64_is_zero(divisor)) caml_raise_zero_divide();
+  /* PR#4740: on some processors, division crashes on overflow.
+     Implement the same behavior as for type "int". */
+  if (I64_is_min_int(dividend) && I64_is_minus_one(divisor)) {
+    int64 zero = I64_literal(0,0);
+    return caml_copy_int64(zero);
+  }
   return caml_copy_int64(I64_mod(Int64_val(v1), divisor));
 }
 
@@ -650,25 +669,35 @@ CAMLprim value caml_nativeint_sub(value v1, value v2)
 CAMLprim value caml_nativeint_mul(value v1, value v2)
 { return caml_copy_nativeint(Nativeint_val(v1) * Nativeint_val(v2)); }
 
+#define Nativeint_min_int ((intnat) 1 << (sizeof(intnat) * 8 - 1))
+
 CAMLprim value caml_nativeint_div(value v1, value v2)
 {
+  intnat dividend = Nativeint_val(v1);
   intnat divisor = Nativeint_val(v2);
   if (divisor == 0) caml_raise_zero_divide();
+  /* PR#4740: on some processors, modulus crashes if division overflows.
+     Implement the same behavior as for type "int". */
+  if (dividend == Nativeint_min_int && divisor == -1) return v1;
 #ifdef NONSTANDARD_DIV_MOD
-  return caml_copy_nativeint(caml_safe_div(Nativeint_val(v1), divisor));
+  return caml_copy_nativeint(caml_safe_div(dividend, divisor));
 #else
-  return caml_copy_nativeint(Nativeint_val(v1) / divisor);
+  return caml_copy_nativeint(dividend / divisor);
 #endif
 }
 
 CAMLprim value caml_nativeint_mod(value v1, value v2)
 {
+  intnat dividend = Nativeint_val(v1);
   intnat divisor = Nativeint_val(v2);
   if (divisor == 0) caml_raise_zero_divide();
+  /* PR#4740: on some processors, modulus crashes if division overflows.
+     Implement the same behavior as for type "int". */
+  if (dividend == Nativeint_min_int && divisor == -1) return caml_copy_nativeint(0);
 #ifdef NONSTANDARD_DIV_MOD
-  return caml_copy_nativeint(caml_safe_mod(Nativeint_val(v1), divisor));
+  return caml_copy_nativeint(caml_safe_mod(dividend, divisor));
 #else
-  return caml_copy_nativeint(Nativeint_val(v1) % divisor);
+  return caml_copy_nativeint(dividend % divisor);
 #endif
 }
 
index a1aa40c5448a7aabc86267c49efaca3d3bd1abe0..e268cd065e015478c40ed5b7e9a08b8f7e1cd0cb 100644 (file)
@@ -123,7 +123,11 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
           pp f "@[<2>%a@ when@ %a@ ->@ %a@]"
             o#patt p o#under_pipe#expr w o#under_pipe#expr e ];
 
-    method sum_type f t = pp f "@[<hv0>[ %a ]@]" o#ctyp t;
+    method sum_type f =
+      fun
+      [ <:ctyp<>> -> pp f "[]"
+      | t -> pp f "@[<hv0>[ %a ]@]" o#ctyp t
+      ];
 
     method ident f i =
     let () = o#node f i Ast.loc_of_ident in
index f3beee674da7ab7ae8b3c7283cd7f1a51e72fbf7..dc3f3af3c2c1a491224c8d141ff5146b55af5661 100644 (file)
@@ -1040,6 +1040,7 @@ Very old (no more supported) syntax:
         | "("; t = SELF; "*"; tl = star_ctyp; ")" ->
             <:ctyp< ( $t$ * $tl$ ) >>
         | "("; t = SELF; ")" -> t
+        | "["; "]" -> <:ctyp< [ ] >>
         | "["; t = constructor_declarations; "]" -> <:ctyp< [ $t$ ] >>
         | "["; "="; rfl = row_field; "]" ->
             <:ctyp< [ = $rfl$ ] >>
index ea3f335d08a743910b3c1eb22cb587f01436e9ff..828ee061c5785cdd129502fb6419cd3d1bbb7932 100644 (file)
@@ -372,7 +372,6 @@ module Sig =
  * - Daniel de Rauglaudre: initial version
  * - Nicolas Pouillard: refactoring
  *)
-    
     (** Camlp4 signature repository *)
     (** {6 Basic signatures} *)
     (** Signature with just a type. *)
@@ -1954,12 +1953,17 @@ module Sig =
           
         val register_str_item_filter : Ast.str_item filter -> unit
           
+        val register_topphrase_filter : Ast.str_item filter -> unit
+          
         val fold_interf_filters :
           ('a -> Ast.sig_item filter -> 'a) -> 'a -> 'a
           
         val fold_implem_filters :
           ('a -> Ast.str_item filter -> 'a) -> 'a -> 'a
           
+        val fold_topphrase_filters :
+          ('a -> Ast.str_item filter -> 'a) -> 'a -> 'a
+          
       end
       
     module type DynAst =
@@ -13301,10 +13305,16 @@ module Struct =
               
             let fold_implem_filters f i = Queue.fold f i implem_filters
               
+            let topphrase_filters = Queue.create ()
+              
+            let fold_topphrase_filters f i = Queue.fold f i topphrase_filters
+              
             let register_sig_item_filter f = Queue.add f interf_filters
               
             let register_str_item_filter f = Queue.add f implem_filters
               
+            let register_topphrase_filter f = Queue.add f topphrase_filters
+              
           end
           
       end
@@ -17555,9 +17565,12 @@ module Printers =
       end =
       struct
         module Id =
-          struct let name = "Camlp4.Printers.Null"
-                    let version = Sys.ocaml_version
-                       end
+          struct
+            let name = "Camlp4.Printers.Null"
+              
+            let version = Sys.ocaml_version
+              
+          end
           
         module Make (Syntax : Sig.Syntax) =
           struct
@@ -17820,9 +17833,12 @@ module Printers =
         open Format
           
         module Id =
-          struct let name = "Camlp4.Printers.OCaml"
-                    let version = Sys.ocaml_version
-                       end
+          struct
+            let name = "Camlp4.Printers.OCaml"
+              
+            let version = Sys.ocaml_version
+              
+          end
           
         module Make (Syntax : Sig.Camlp4Syntax) =
           struct
@@ -19254,9 +19270,12 @@ module Printers =
         open Format
           
         module Id =
-          struct let name = "Camlp4.Printers.OCamlr"
-                    let version = Sys.ocaml_version
-                       end
+          struct
+            let name = "Camlp4.Printers.OCamlr"
+              
+            let version = Sys.ocaml_version
+              
+          end
           
         module Make (Syntax : Sig.Camlp4Syntax) =
           struct
@@ -20203,9 +20222,10 @@ module PreCast :
       
   end =
   struct
-    module Id = struct let name = "Camlp4.PreCast"
-                          let version = Sys.ocaml_version
-                             end
+    module Id =
+      struct let name = "Camlp4.PreCast"
+                let version = Sys.ocaml_version
+                   end
       
     type camlp4_token =
       Sig.camlp4_token =
index 0167ceffba2fb7f427962b57d44897d16d8e855c..e5f7586206cc0d7d8611eccc9477f5e63f13a6e5 100644 (file)
@@ -21,9 +21,12 @@ module R =
  * - Nicolas Pouillard: refactoring
  *)
     module Id =
-      struct let name = "Camlp4OCamlRevisedParser"
-                let version = Sys.ocaml_version
-                   end
+      struct
+        let name = "Camlp4OCamlRevisedParser"
+          
+        let version = Sys.ocaml_version
+          
+      end
       
     module Make (Syntax : Sig.Camlp4Syntax) =
       struct
@@ -4393,6 +4396,10 @@ Very old (no more supported) syntax:
                              (fun _ (t : 'constructor_declarations) _
                                 (_loc : Gram.Loc.t) ->
                                 (Ast.TySum (_loc, t) : 'ctyp))));
+                         ([ Gram.Skeyword "["; Gram.Skeyword "]" ],
+                          (Gram.Action.mk
+                             (fun _ _ (_loc : Gram.Loc.t) ->
+                                (Ast.TySum (_loc, Ast.TyNil _loc) : 'ctyp))));
                          ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
                           (Gram.Action.mk
                              (fun _ (t : 'ctyp) _ (_loc : Gram.Loc.t) ->
@@ -8524,9 +8531,12 @@ module Camlp4QuotationCommon =
  * - Nicolas Pouillard: initial version
  *)
     module Id =
-      struct let name = "Camlp4QuotationCommon"
-                let version = Sys.ocaml_version
-                   end
+      struct
+        let name = "Camlp4QuotationCommon"
+          
+        let version = Sys.ocaml_version
+          
+      end
       
     module Make
       (Syntax : Sig.Camlp4Syntax)
@@ -9223,9 +9233,12 @@ module Q =
  * - Nicolas Pouillard: refactoring
  *)
     module Id =
-      struct let name = "Camlp4QuotationExpander"
-                let version = Sys.ocaml_version
-                   end
+      struct
+        let name = "Camlp4QuotationExpander"
+          
+        let version = Sys.ocaml_version
+          
+      end
       
     module Make (Syntax : Sig.Camlp4Syntax) =
       struct
@@ -9262,9 +9275,11 @@ module Rp =
  * - Nicolas Pouillard: refactoring
  *)
     module Id : Sig.Id =
-      struct let name = "Camlp4OCamlRevisedParserParser"
-                let version = Sys.ocaml_version
-                  
+      struct
+        let name = "Camlp4OCamlRevisedParserParser"
+          
+        let version = Sys.ocaml_version
+          
       end
       
     module Make (Syntax : Sig.Camlp4Syntax) =
@@ -10195,7 +10210,8 @@ module G =
     module Id =
       struct let name = "Camlp4GrammarParser"
                 let version = Sys.ocaml_version
-                   end
+                  
+      end
       
     module Make (Syntax : Sig.Camlp4Syntax) =
       struct
@@ -12594,7 +12610,8 @@ module M =
     module Id =
       struct let name = "Camlp4MacroParser"
                 let version = Sys.ocaml_version
-                   end
+                  
+      end
       
     (*
 Added statements:
@@ -13649,7 +13666,8 @@ module D =
     module Id =
       struct let name = "Camlp4DebugParser"
                 let version = Sys.ocaml_version
-                   end
+                  
+      end
       
     module Make (Syntax : Sig.Camlp4Syntax) =
       struct
@@ -13840,9 +13858,12 @@ module L =
  * - Nicolas Pouillard: revised syntax version
  *)
     module Id =
-      struct let name = "Camlp4ListComprenhsion"
-                let version = Sys.ocaml_version
-                   end
+      struct
+        let name = "Camlp4ListComprenhsion"
+          
+        let version = Sys.ocaml_version
+          
+      end
       
     module Make (Syntax : Sig.Camlp4Syntax) =
       struct
@@ -14216,7 +14237,6 @@ module B =
  * - Daniel de Rauglaudre: initial version
  * - Nicolas Pouillard: refactoring
  *)
-    
     open Camlp4
       
     open PreCast.Syntax
@@ -14434,7 +14454,7 @@ Options:
 <file>.ml        Parse this implementation file
 <file>.mli       Parse this interface file
 <file>.%s Load this module inside the Camlp4 core@."
-         (if DynLoader.is_native then "cmx      " else "(cmo|cma)");
+         (if DynLoader.is_native then "cmxs     " else "(cmo|cma)");
        Options.print_usage_list ini_sl;
        (* loop (ini_sl @ ext_sl) where rec loop =
       fun
@@ -14527,11 +14547,11 @@ You should give the -noassert option to the ocaml compiler instead.@."
         ("-loaded-modules", (Arg.Set print_loaded_modules),
          "Print the list of loaded modules.");
         ("-parser", (Arg.String (rewrite_and_load "Parsers")),
-         "<name>  Load the parser Camlp4Parsers/<name>.cmo");
+         "<name>  Load the parser Camlp4Parsers/<name>.cm(o|a|xs)");
         ("-printer", (Arg.String (rewrite_and_load "Printers")),
-         "<name>  Load the printer Camlp4Printers/<name>.cmo");
+         "<name>  Load the printer Camlp4Printers/<name>.cm(o|a|xs)");
         ("-filter", (Arg.String (rewrite_and_load "Filters")),
-         "<name>  Load the filter Camlp4Filters/<name>.cmo");
+         "<name>  Load the filter Camlp4Filters/<name>.cm(o|a|xs)");
         ("-ignore", (Arg.String ignore), "ignore the next argument");
         ("--", (Arg.Unit ignore), "Deprecated, does nothing") ]
       
index 503f555652b198df5254f9912f76df252f4fe135..e736a9237b68752a9ee0d592960e40d4d3d7cf51 100755 (executable)
--- a/configure
+++ b/configure
@@ -13,7 +13,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: configure,v 1.266.2.1 2008/11/07 10:34:16 xleroy Exp $
+# $Id: configure,v 1.266.2.4 2009/05/19 13:23:47 doligez Exp $
 
 configure_options="$*"
 prefix=/usr/local
@@ -305,8 +305,13 @@ case "$bytecc,$host" in
     dllccompopts="-D_WIN32 -DCAML_DLL"
     flexlink="flexlink -chain cygwin -merge-manifest"
     flexdir=`$flexlink -where | dos2unix`
-    iflexdir="-I\"$flexdir\""
-    mkexe="$flexlink -exe"
+    if test -z "$flexdir"; then
+      echo "flexlink not found: native shared libraries won't be available"
+      withsharedlibs=no
+    else
+      iflexdir="-I\"$flexdir\""
+      mkexe="$flexlink -exe"
+    fi
     exe=".exe"
     ostype="Cygwin";;
   gcc*,x86_64-*-linux*)
@@ -617,7 +622,11 @@ case "$host" in
   i[3456]86-*-linux*)           arch=i386; system=linux_`sh ./runtest elf.c`;;
   i[3456]86-*-*bsd*)            arch=i386; system=bsd_`sh ./runtest elf.c`;;
   i[3456]86-*-nextstep*)        arch=i386; system=nextstep;;
-  i[3456]86-*-solaris*)         arch=i386; system=solaris;;
+  i[3456]86-*-solaris*)         if $arch64; then
+                                  arch=amd64; system=solaris
+                                else
+                                  arch=i386; system=solaris
+                                fi;;
   i[3456]86-*-beos*)            arch=i386; system=beos;;
   i[3456]86-*-cygwin*)          arch=i386; system=cygwin;;
   i[3456]86-*-darwin*)          if $arch64; then
@@ -686,6 +695,7 @@ case "$arch,$nativecc,$system,$host_type" in
                        if $arch64; then partialld="ld -r -arch ppc64"; fi;;
   *,gcc*,cygwin,*)     nativecccompopts="$gcc_warnings -U_WIN32";;
   amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";;
+  amd64,gcc*,solaris,*) partialld="ld -r -m elf_x86_64";;
   *,gcc*,*,*)          nativecccompopts="$gcc_warnings";;
 esac
 
@@ -699,6 +709,8 @@ case "$arch,$model,$system" in
                     aspp='gcc -c';;
   amd64,*,macosx)   as='as -arch x86_64'
                     aspp='gcc -arch x86_64 -c';;
+  amd64,*,solaris)  as='as --64'
+                    aspp='gcc -m64 -c';;
   amd64,*,*)        as='as'
                     aspp='gcc -c';;
   arm,*,*)          as='as';
@@ -1103,7 +1115,7 @@ case "$arch,$system" in
     echo "Cannot detect system stack overflow.";;
 esac
 
-x# Determine the target architecture for the "num" library
+# Determine the target architecture for the "num" library
 
 case "$arch" in
   alpha)    bng_arch=alpha; bng_asm_level=1;;
index afac5c0d53525a95acbdcf408404e26c04e36aef..f71fcbef394e35b1cecb723ed37020df201c3372 100644 (file)
@@ -34,32 +34,32 @@ symbols.cmi: ../bytecomp/instruct.cmi
 time_travel.cmi: primitives.cmi 
 trap_barrier.cmi: 
 unix_tools.cmi: ../otherlibs/unix/unix.cmi 
-breakpoints.cmo: symbols.cmi source.cmi primitives.cmi pos.cmi \
-    ../bytecomp/instruct.cmi exec.cmi debugcom.cmi checkpoints.cmi \
-    breakpoints.cmi 
-breakpoints.cmx: symbols.cmx source.cmx primitives.cmx pos.cmx \
-    ../bytecomp/instruct.cmx exec.cmx debugcom.cmx checkpoints.cmx \
-    breakpoints.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 ../otherlibs/unix/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/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 ../typing/ctype.cmi ../utils/config.cmi \
-    checkpoints.cmi breakpoints.cmi command_line.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 \
+    ../typing/ctype.cmi ../utils/config.cmi checkpoints.cmi breakpoints.cmi \
+    command_line.cmi 
 command_line.cmx: unix_tools.cmx ../otherlibs/unix/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/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 ../typing/ctype.cmx ../utils/config.cmx \
-    checkpoints.cmx breakpoints.cmx command_line.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 \
+    ../typing/ctype.cmx ../utils/config.cmx checkpoints.cmx breakpoints.cmx \
+    command_line.cmi 
 debugcom.cmo: primitives.cmi ../utils/misc.cmi int64ops.cmi \
     input_handling.cmi debugcom.cmi 
 debugcom.cmx: primitives.cmx ../utils/misc.cmx int64ops.cmx \
@@ -74,76 +74,70 @@ 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/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/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 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 \
-    debugger_config.cmi debugcom.cmi ../typing/ctype.cmi ../typing/btype.cmi \
-    eval.cmi 
-eval.cmx: ../typing/types.cmx ../bytecomp/symtable.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 \
-    debugger_config.cmx debugcom.cmx ../typing/ctype.cmx ../typing/btype.cmx \
-    eval.cmi 
-events.cmo: primitives.cmi ../parsing/location.cmi ../bytecomp/instruct.cmi \
-    checkpoints.cmi events.cmi 
-events.cmx: primitives.cmx ../parsing/location.cmx ../bytecomp/instruct.cmx \
-    checkpoints.cmx events.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 \
+    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 \
+    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 primitives.cmi ../utils/misc.cmi \
-    ../bytecomp/instruct.cmi events.cmi debugcom.cmi checkpoints.cmi \
-    frames.cmi 
-frames.cmx: symbols.cmx primitives.cmx ../utils/misc.cmx \
-    ../bytecomp/instruct.cmx events.cmx debugcom.cmx checkpoints.cmx \
-    frames.cmi 
-history.cmo: primitives.cmi ../utils/misc.cmi int64ops.cmi \
-    debugger_config.cmi checkpoints.cmi history.cmi 
-history.cmx: primitives.cmx ../utils/misc.cmx int64ops.cmx \
-    debugger_config.cmx checkpoints.cmx history.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: ../otherlibs/unix/unix.cmi primitives.cmi \
     input_handling.cmi 
 input_handling.cmx: ../otherlibs/unix/unix.cmx primitives.cmx \
     input_handling.cmi 
 int64ops.cmo: int64ops.cmi 
 int64ops.cmx: int64ops.cmi 
-lexer.cmo: primitives.cmi parser.cmi lexer.cmi 
-lexer.cmx: primitives.cmx parser.cmx lexer.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 debugger_config.cmi ../typing/ctype.cmi ../utils/config.cmi \
-    loadprinter.cmi 
+    dynlink.cmi ../typing/ctype.cmi ../utils/config.cmi loadprinter.cmi 
 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 debugger_config.cmx ../typing/ctype.cmx ../utils/config.cmx \
-    loadprinter.cmi 
+    dynlink.cmx ../typing/ctype.cmx ../utils/config.cmx loadprinter.cmi 
 main.cmo: unix_tools.cmi ../otherlibs/unix/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 \
+    show_information.cmi question.cmi program_management.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 ../utils/clflags.cmi checkpoints.cmi 
 main.cmx: unix_tools.cmx ../otherlibs/unix/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 \
+    show_information.cmx question.cmx program_management.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 ../utils/clflags.cmx checkpoints.cmx 
-parameters.cmo: primitives.cmi ../utils/misc.cmi envaux.cmi \
+parameters.cmo: primitives.cmi envaux.cmi debugger_config.cmi \
     ../utils/config.cmi parameters.cmi 
-parameters.cmx: primitives.cmx ../utils/misc.cmx envaux.cmx \
+parameters.cmx: primitives.cmx envaux.cmx debugger_config.cmx \
     ../utils/config.cmx parameters.cmi 
-parser.cmo: primitives.cmi parser_aux.cmi ../parsing/longident.cmi \
-    int64ops.cmi input_handling.cmi parser.cmi 
-parser.cmx: primitives.cmx parser_aux.cmi ../parsing/longident.cmx \
-    int64ops.cmx input_handling.cmx parser.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 \
+    input_handling.cmx parser.cmi 
 pattern_matching.cmo: ../typing/typedtree.cmi parser_aux.cmi \
     ../utils/misc.cmi debugger_config.cmi debugcom.cmi ../typing/ctype.cmi \
     pattern_matching.cmi 
@@ -158,49 +152,47 @@ primitives.cmo: ../otherlibs/unix/unix.cmi primitives.cmi
 primitives.cmx: ../otherlibs/unix/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 ../utils/misc.cmi \
+    ../typing/outcometree.cmi ../typing/oprint.cmi \
     ../toplevel/genprintval.cmi debugcom.cmi printval.cmi 
 printval.cmx: ../typing/types.cmx ../bytecomp/symtable.cmx \
     ../typing/printtyp.cmx ../typing/path.cmx parser_aux.cmi \
-    ../typing/outcometree.cmi ../typing/oprint.cmx ../utils/misc.cmx \
+    ../typing/outcometree.cmi ../typing/oprint.cmx \
     ../toplevel/genprintval.cmx debugcom.cmx printval.cmi 
 program_loading.cmo: unix_tools.cmi ../otherlibs/unix/unix.cmi primitives.cmi \
-    parameters.cmi ../utils/misc.cmi input_handling.cmi debugger_config.cmi \
-    program_loading.cmi 
+    parameters.cmi input_handling.cmi debugger_config.cmi program_loading.cmi 
 program_loading.cmx: unix_tools.cmx ../otherlibs/unix/unix.cmx primitives.cmx \
-    parameters.cmx ../utils/misc.cmx input_handling.cmx debugger_config.cmx \
-    program_loading.cmi 
+    parameters.cmx input_handling.cmx debugger_config.cmx program_loading.cmi 
 program_management.cmo: unix_tools.cmi ../otherlibs/unix/unix.cmi \
     time_travel.cmi symbols.cmi question.cmi program_loading.cmi \
-    primitives.cmi parameters.cmi ../utils/misc.cmi int64ops.cmi \
-    ../bytecomp/instruct.cmi input_handling.cmi history.cmi \
-    debugger_config.cmi debugcom.cmi breakpoints.cmi program_management.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 ../otherlibs/unix/unix.cmx \
     time_travel.cmx symbols.cmx question.cmx program_loading.cmx \
-    primitives.cmx parameters.cmx ../utils/misc.cmx int64ops.cmx \
-    ../bytecomp/instruct.cmx input_handling.cmx history.cmx \
-    debugger_config.cmx debugcom.cmx breakpoints.cmx program_management.cmi 
+    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 show_source.cmi printval.cmi primitives.cmi \
+show_information.cmo: symbols.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 show_source.cmx printval.cmx primitives.cmx \
+show_information.cmx: symbols.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 ../utils/misc.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 ../utils/misc.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 ../utils/config.cmi source.cmi 
-source.cmx: primitives.cmx ../utils/misc.cmx ../utils/config.cmx source.cmi 
-symbols.cmo: ../bytecomp/symtable.cmi primitives.cmi ../bytecomp/instruct.cmi \
-    events.cmi debugger_config.cmi debugcom.cmi checkpoints.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 \
+    ../utils/config.cmx source.cmi 
+symbols.cmo: ../bytecomp/symtable.cmi ../bytecomp/instruct.cmi events.cmi \
+    debugger_config.cmi debugcom.cmi checkpoints.cmi \
     ../bytecomp/bytesections.cmi symbols.cmi 
-symbols.cmx: ../bytecomp/symtable.cmx primitives.cmx ../bytecomp/instruct.cmx \
-    events.cmx debugger_config.cmx debugcom.cmx checkpoints.cmx \
+symbols.cmx: ../bytecomp/symtable.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 \
     program_loading.cmi primitives.cmi ../utils/misc.cmi int64ops.cmi \
index fb65c8b438a335caaa1ca81c8a120e214f1a4a1f..2c8d7253ac2c9d2c5899d65e2aaa59ecad848a2c 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: breakpoints.ml,v 1.13 2005/08/23 20:16:43 doligez Exp $ *)
+(* $Id: breakpoints.ml,v 1.13.18.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (******************************* Breakpoints ***************************)
 
@@ -20,7 +20,6 @@ open Debugcom
 open Instruct
 open Primitives
 open Printf
-open Source
 
 (*** Debugging. ***)
 let debug_breakpoints = ref false
@@ -68,7 +67,7 @@ let rec breakpoints_at_pc pc =
    []
   end
     @
-  List.map fst (filter (function (_, {ev_pos = pos}) -> pos = pc) !breakpoints)
+  List.map fst (List.filter (function (_, {ev_pos = pos}) -> pos = pc) !breakpoints)
 
 (* Is there a breakpoint at `pc' ? *)
 let breakpoint_at_pc pc =
@@ -155,7 +154,7 @@ let remove_position pos =
   let count = List.assoc pos !positions in
     decr count;
     if !count = 0 then begin
-      positions := assoc_remove !positions pos;
+      positions := List.remove_assoc pos !positions;
       new_version ()
     end
 
@@ -181,7 +180,7 @@ let remove_breakpoint number =
     let pos = ev.ev_pos in
       Exec.protect
         (function () ->
-           breakpoints := assoc_remove !breakpoints number;
+           breakpoints := List.remove_assoc number !breakpoints;
            remove_position pos;
            printf "Removed breakpoint %d at %d : %s" number ev.ev_pos
                   (Pos.get_desc ev);
@@ -210,7 +209,7 @@ let exec_with_temporary_breakpoint pc funct =
       let count = List.assoc pc !positions in
         decr count;
         if !count = 0 then begin
-          positions := assoc_remove !positions pc;
+          positions := List.remove_assoc pc !positions;
           reset_instr pc;
           Symbols.set_event_at_pc pc
         end
index 475d864633b8732ac6eacc1798b07ca0945e4d32..280fbc01a5bfad621212b029a184f269bb55f52f 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: command_line.ml,v 1.25 2008/07/29 08:31:41 xleroy Exp $ *)
+(* $Id: command_line.ml,v 1.25.2.2 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (************************ Reading and executing commands ***************)
 
@@ -87,7 +87,7 @@ let eol =
   end_of_line Lexer.lexeme
 
 let matching_elements list name instr =
-  filter (function a -> isprefix instr (name a)) !list
+  List.filter (function a -> isprefix instr (name a)) !list
 
 let all_matching_instructions =
   matching_elements instruction_list (fun i -> i.instr_name)
@@ -97,7 +97,7 @@ let all_matching_instructions =
 
 let matching_instructions instr =
   let all = all_matching_instructions instr in
-  let prio = filter (fun i -> i.instr_prio) all in
+  let prio = List.filter (fun i -> i.instr_prio) all in
   if prio = [] then all else prio
 
 let matching_variables =
@@ -143,6 +143,11 @@ let add_breakpoint_after_pc pc =
     end
   in try_add 0
 
+let module_of_longident id =
+  match id with
+  | Some x -> Some (String.concat "." (Longident.flatten x))
+  | None -> None
+
 let convert_module mdle =
   match mdle with
   | Some m ->
@@ -235,14 +240,24 @@ let instr_dir ppf lexbuf =
       if yes_or_no "Reinitialize directory list" then begin
         Config.load_path := !default_load_path;
         Envaux.reset_cache ();
+        Hashtbl.clear Debugger_config.load_path_for;
         flush_buffer_list ()
         end
       end
-    else
-      List.iter (function x -> add_path (expand_path x))
-                (List.rev new_directory);
+    else begin
+      let new_directory' = List.rev new_directory in
+      match new_directory' with
+      | mdl :: for_keyw :: tl when (String.lowercase for_keyw) = "for" && (List.length tl) > 0 ->
+          List.iter (function x -> add_path_for mdl (expand_path x)) tl
+      | _ ->
+          List.iter (function x -> add_path (expand_path x)) new_directory'
+    end;
     let print_dirs ppf l = List.iter (function x -> fprintf ppf "@ %s" x) l in
-    fprintf ppf "@[<2>Directories :%a@]@." print_dirs !Config.load_path
+    fprintf ppf "@[<2>Directories :%a@]@." print_dirs !Config.load_path;
+    Hashtbl.iter
+      (fun mdl dirs ->
+        fprintf ppf "@[<2>Source directories for %s :%a@]@." mdl print_dirs dirs)
+      Debugger_config.load_path_for
 
 let instr_kill ppf lexbuf =
   eol lexbuf;
@@ -562,7 +577,7 @@ let instr_break ppf lexbuf =
             raise Toplevel
         end
     | BA_pos1 (mdle, line, column) ->         (* break @ [MODULE] LINE [COL] *)
-        let module_name = convert_module mdle in
+        let module_name = convert_module (module_of_longident mdle) in
         new_breakpoint
           (try
              let buffer =
@@ -585,7 +600,7 @@ let instr_break ppf lexbuf =
                raise Toplevel)
     | BA_pos2 (mdle, position) ->             (* break @ [MODULE] # POSITION *)
         try
-          new_breakpoint (event_near_pos (convert_module mdle) position)
+          new_breakpoint (event_near_pos (convert_module (module_of_longident mdle)) position)
         with
         | Not_found ->
             eprintf "Can't find any event there.@."
@@ -697,7 +712,7 @@ let instr_list ppf lexbuf =
       | Not_found ->
           ("", -1)
     in
-      let mdle = convert_module mo in
+      let mdle = convert_module (module_of_longident mo) in
       let pos = Lexing.dummy_pos in
         let beginning =
           match beg with
@@ -841,7 +856,7 @@ let info_breakpoints ppf lexbuf =
 
 let info_events ppf lexbuf =
   ensure_loaded ();
-  let mdle = convert_module (opt_identifier_eol Lexer.lexeme lexbuf) in
+  let mdle = convert_module (module_of_longident (opt_longident_eol Lexer.lexeme lexbuf)) in
     print_endline ("Module : " ^ mdle);
     print_endline "   Address  Characters        Kind      Repr.";
     List.iter
index 9af436d51c8705494fc60c776a8dd5cce503b677..d8ed23ded9fd71bed6cebb63e7d3e195d60d4c74 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: debugger_config.ml,v 1.11 2008/07/29 08:31:41 xleroy Exp $ *)
+(* $Id: debugger_config.ml,v 1.11.2.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (**************************** Configuration file ***********************)
 
@@ -62,6 +62,8 @@ let runtime_program = "ocamlrun"
 (* Time history size (for `last') *)
 let history_size = ref 30
 
+let load_path_for = Hashtbl.create 7
+
 (*** Time travel parameters. ***)
 
 (* Step between checkpoints for long displacements.*)
index a3a9b05c97295b0ade1b8ed44cfd26056ae78925..befdba63b116a87653a0fdbe815648205371f28d 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: debugger_config.mli,v 1.5 2002/11/17 16:42:10 xleroy Exp $ *)
+(* $Id: debugger_config.mli,v 1.5.28.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (********************** Configuration file *****************************)
 
@@ -25,6 +25,7 @@ val event_mark_after : string
 val shell : string
 val runtime_program : string
 val history_size : int ref
+val load_path_for : (string, string list) Hashtbl.t
 
 (*** Time travel paramaters. ***)
 
index 65e35ed5b231b72ad044c6e56bad8b563e7b9144..9dec9333efdbd398fa9b87a97da069f2334d89ef 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: dynlink.ml,v 1.2 2006/09/28 21:36:38 xleroy Exp $ *)
+(* $Id: dynlink.ml,v 1.2.14.1 2009/04/02 09:21:20 xclerc Exp $ *)
 
 (* Dynamic loading of .cmo files *)
 
@@ -34,6 +34,7 @@ type error =
   | Corrupted_interface of string
   | File_not_found of string
   | Cannot_open_dll of string
+  | Inconsistent_implementation of string
 
 exception Error of error
 
@@ -96,9 +97,20 @@ let default_available_units () =
 
 (* Initialize the linker tables and everything *)
 
+let inited = ref false
+
 let init () =
-  default_crcs := Symtable.init_toplevel();
-  default_available_units ()
+  if not !inited then begin
+    default_crcs := Symtable.init_toplevel();
+    default_available_units ();
+    inited := true;
+  end
+
+let clear_available_units () = init(); clear_available_units ()
+let allow_only l = init(); allow_only l
+let prohibit l = init(); prohibit l
+let add_available_units l = init(); add_available_units l
+let default_available_units () = init(); default_available_units ()
 
 (* Read the CRC of an interface from its .cmi file *)
 
@@ -186,6 +198,7 @@ let load_compunit ic file_name compunit =
   end
 
 let loadfile file_name =
+  init();
   let ic = open_in_bin file_name in
   try
     let buffer = String.create (String.length Config.cmo_magic_number) in
@@ -213,6 +226,7 @@ let loadfile file_name =
     close_in ic; raise exc
 
 let loadfile_private file_name =
+  init();
   let initial_symtable = Symtable.current_state()
   and initial_crc = !crc_interfaces in
   try
@@ -250,3 +264,8 @@ let error_message = function
       "cannot find file " ^ name ^ " in search path"
   | Cannot_open_dll reason ->
       "error loading shared library: " ^ reason
+  | Inconsistent_implementation name ->
+      "implementation mismatch on " ^ name
+
+let is_native = false
+let adapt_filename f = f
index f349bf37618180bb3ff98cf30141f8348c783e27..bccfab7472ad7aa6dfc106439f3c62789955aae3 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: dynlink.mli,v 1.1 2006/05/11 15:51:31 xleroy Exp $ *)
+(* $Id: dynlink.mli,v 1.1.14.1 2009/04/02 09:21:20 xclerc Exp $ *)
 
-(** Dynamic loading of bytecode object files. *)
+(** Dynamic loading of object files. *)
 
-(** {6 Initialization} *)
+val is_native: bool
+(** [true] if the program is native,
+    [false] if the program is bytecode. *)
 
-val init : unit -> unit
-(** Initialize the [Dynlink] library.
-    Must be called before any other function in this module. *)
-
-(** {6 Dynamic loading of compiled bytecode files} *)
+(** {6 Dynamic loading of compiled files} *)
 
 val loadfile : string -> unit
-(** Load the given bytecode object file ([.cmo] file) or
-    bytecode library file ([.cma] file), and link it with the running program.
+(** In bytecode: load the given bytecode object file ([.cmo] file) or
+    bytecode library file ([.cma] file), and link it with the running 
+    program. In native code: load the given OCaml plugin file (usually
+    [.cmxs]), and link it with the running 
+    program.
     All toplevel expressions in the loaded compilation units
     are evaluated. No facilities are provided to
     access value names defined by the unit. Therefore, the unit
@@ -37,6 +38,10 @@ val loadfile_private : string -> unit
     are hidden (cannot be referenced) from other modules dynamically
     loaded afterwards. *)
 
+val adapt_filename : string -> string
+(** In bytecode, the identity function. In native code, replace the last
+    extension with [.cmxs]. *)
+
 (** {6 Access control} *)
 
 val allow_only: string list -> unit
@@ -68,7 +73,8 @@ val allow_unsafe_modules : bool -> unit
     dynamically linked. A compilation unit is ``unsafe'' if it contains
     declarations of external functions, which can break type safety.
     By default, dynamic linking of unsafe object files is
-    not allowed. *)
+    not allowed. In native code, this function does nothing; object files
+    with external functions are always allowed to be dynamically linked. *)
 
 (** {6 Deprecated, low-level API for access control} *)
 
@@ -77,7 +83,8 @@ val allow_unsafe_modules : bool -> unit
     since the default initialization of allowed units, along with the
     [allow_only] and [prohibit] function, provides a better, safer
     mechanism to control access to program units.  The three functions
-    below are provided for backward compatibility only. *)
+    below are provided for backward compatibility only and are not
+    available in native code. *)
 
 val add_interfaces : string list -> string list -> unit
 (** [add_interfaces units path] grants dynamically-linked object
@@ -97,6 +104,12 @@ val clear_available_units : unit -> unit
 (** Empty the list of compilation units accessible to dynamically-linked
     programs. *)
 
+(** {6 Deprecated, initialization} *)
+
+val init : unit -> unit
+(** @deprecated Initialize the [Dynlink] library. This function is called
+    automatically when needed. *)
+
 (** {6 Error reporting} *)
 
 type linking_error =
@@ -113,6 +126,7 @@ type error =
   | Corrupted_interface of string
   | File_not_found of string
   | Cannot_open_dll of string
+  | Inconsistent_implementation of string
 
 exception Error of error
 (** Errors in dynamic linking are reported by raising the [Error]
index 9905fbc10ddf5b450a8a4767f9fe7d8ae24600e7..d048bb1daeb2bd0c492e745f72f6bc85afbb02c0 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: envaux.ml,v 1.7 2000/03/06 22:11:17 weis Exp $ *)
+(* $Id: envaux.ml,v 1.7.38.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 open Misc
 open Types
@@ -23,7 +23,7 @@ type error =
 exception Error of error
 
 let env_cache =
-  (Hashtbl.create 59 : (Env.summary, Env.t) Hashtbl.t)
+  (Hashtbl.create 59 : ((Env.summary * Subst.t), Env.t) Hashtbl.t)
 
 let reset_cache () =
   Hashtbl.clear env_cache;
@@ -34,45 +34,46 @@ let extract_sig env mty =
     Tmty_signature sg -> sg
   | _ -> fatal_error "Envaux.extract_sig"
 
-let rec env_from_summary sum =
+let rec env_from_summary sum subst =
   try
-    Hashtbl.find env_cache sum
+    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 desc (env_from_summary s)
+          Env.add_value id (Subst.value_description subst desc) (env_from_summary s subst)
       | Env_type(s, id, desc) ->
-          Env.add_type id desc (env_from_summary s)
+          Env.add_type id (Subst.type_declaration subst desc) (env_from_summary s subst)
       | Env_exception(s, id, desc) ->
-          Env.add_exception id desc (env_from_summary s)
+          Env.add_exception id (Subst.exception_declaration subst desc) (env_from_summary s subst)
       | Env_module(s, id, desc) ->
-          Env.add_module id desc (env_from_summary s)
+          Env.add_module id (Subst.modtype subst desc) (env_from_summary s subst)
       | Env_modtype(s, id, desc) ->
-          Env.add_modtype id desc (env_from_summary s)
+          Env.add_modtype id (Subst.modtype_declaration subst desc) (env_from_summary s subst)
       | Env_class(s, id, desc) ->
-          Env.add_class id desc (env_from_summary s)
+          Env.add_class id (Subst.class_declaration subst desc) (env_from_summary s subst)
       | Env_cltype (s, id, desc) ->
-          Env.add_cltype id desc (env_from_summary s)
+          Env.add_cltype id (Subst.cltype_declaration subst desc) (env_from_summary s subst)
       | Env_open(s, path) ->
-          let env = env_from_summary s in
+          let env = env_from_summary s subst in
+          let path' = Subst.module_path subst path in
           let mty =
             try 
-              Env.find_module path env
+              Env.find_module path' env
             with Not_found ->
-              raise (Error (Module_not_found path))
+              raise (Error (Module_not_found path'))
           in
-          Env.open_signature path (extract_sig env mty) env
+          Env.open_signature path' (extract_sig env mty) env
     in
-      Hashtbl.add env_cache sum env;
+      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
+  | Some ev -> env_from_summary ev.Instruct.ev_typenv ev.Instruct.ev_typsubst
 
 (* Error report *)
 
index 4a2e5ae8754f5597a18101b86c04d2e6faa6cc9b..9e0a82dda2633991a8530bb9f61a0a822f69857e 100644 (file)
@@ -11,9 +11,8 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: eval.ml,v 1.30 2007/11/28 22:32:14 weis Exp $ *)
+(* $Id: eval.ml,v 1.30.4.5 2009/04/19 08:42:43 xleroy Exp $ *)
 
-open Debugger_config
 open Misc
 open Path
 open Instruct
@@ -42,7 +41,9 @@ let abstract_type =
 let rec path event = function
     Pident id ->
       if Ident.global id then
-        Debugcom.Remote_value.global (Symtable.get_global_position id)
+        try
+          Debugcom.Remote_value.global (Symtable.get_global_position id)
+        with Symtable.Error _ -> raise(Error(Unbound_identifier id))
       else
         begin match event with
           Some ev ->
@@ -88,8 +89,8 @@ let rec expression event env = function
       end
   | E_result ->
       begin match event with
-        Some {ev_kind = Event_after ty} when !Frames.current_frame = 0 ->
-          (Debugcom.Remote_value.accu(), ty)
+        Some {ev_kind = Event_after ty; ev_typsubst = subst} when !Frames.current_frame = 0 ->
+          (Debugcom.Remote_value.accu(), Subst.type_expr subst ty)
       | _ ->
           raise(Error(No_result))
       end
@@ -178,15 +179,14 @@ let report_error ppf = function
   | Tuple_index(ty, len, pos) ->
       Printtyp.reset_and_mark_loops ty;
       fprintf ppf
-        "@[Cannot extract field number %i from a %i-components \
-           tuple of type@ %a@]@."
+        "@[Cannot extract field number %i from a %i-tuple of type@ %a@]@."
         pos len Printtyp.type_expr ty
   | Array_index(len, pos) ->
       fprintf ppf
-        "@[Cannot extract element number %i from array of length %i@]@." pos len
+        "@[Cannot extract element number %i from an array of length %i@]@." pos len
   | List_index(len, pos) ->
       fprintf ppf
-        "@[Cannot extract element number %i from list of length %i@]@." pos len
+        "@[Cannot extract element number %i from list of length %i@]@." pos len
   | String_index(s, len, pos) ->
       fprintf ppf
         "@[Cannot extract character number %i@ \
index 70b47c0fcccdbf7f71231b7cc5821392e1ebd1f5..de623554cf8bed1f1a6ab81104fac614a73ad0b2 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: events.ml,v 1.6 2005/08/25 15:35:16 doligez Exp $ *)
+(* $Id: events.ml,v 1.6.18.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (********************************* Events ******************************)
 
 open Instruct
-open Primitives
-open Checkpoints
 
 let get_pos ev =
   match ev.ev_kind with
index a2fb14e1567bf1611b914db76ba661d313dffea1..3a43530fbdc2d63a61d2998e6e73b72a0fc12e85 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: frames.ml,v 1.10 2005/08/25 15:35:16 doligez Exp $ *)
+(* $Id: frames.ml,v 1.10.18.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (***************************** Frames **********************************)
 
 open Instruct
-open Primitives
 open Debugcom
-open Checkpoints
 open Events
 open Symbols
 
index 9a8279c10840c72f3796e059f71e0a331b709658..ab9f54a15bea0bf7c6f1d6b96353c169d3400d7c 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: history.ml,v 1.5 2002/10/29 17:53:24 doligez Exp $ *)
+(* $Id: history.ml,v 1.5.28.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 open Int64ops
 open Checkpoints
-open Misc
 open Primitives
 open Debugger_config
 
index 1b87c6c26f3f553739fef0d83d662827eee3a509..480819b755fbd51074516b44fb51dddbb31b822c 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: input_handling.ml,v 1.5 2006/12/09 13:49:10 ertai Exp $ *)
+(* $Id: input_handling.ml,v 1.5.14.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (**************************** Input control ****************************)
 
@@ -30,7 +30,7 @@ let add_file file controller =
 
 (* Remove a file from the list of actives files. *)
 let remove_file file =
-  active_files := assoc_remove !active_files file.io_fd
+  active_files := List.remove_assoc file.io_fd !active_files
 
 (* Change the controller for the given file. *)
 let change_controller file controller =
index 017801b6b1e5a702ac85477fa992ae2ccf57e6fb..4737986be62ee1e46132c1d852b09ab4c543f714 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: lexer.mll,v 1.8 2003/01/03 15:39:54 doligez Exp $ *)
+(* $Id: lexer.mll,v 1.8.28.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 {
 
-open Primitives
 open Parser
 
 }
index 54ec1fdf4ab0ace753a4bd7427bf3c29b2a3fe57..bb861e0ef0136f7fb6801e15deec223ca814907c 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: loadprinter.ml,v 1.19 2004/11/29 02:27:25 garrigue Exp $ *)
+(* $Id: loadprinter.ml,v 1.19.20.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (* Loading and installation of user-defined printer functions *)
 
 open Misc
-open Debugger_config
 open Longident
 open Path
 open Types
index 1d8d4965d58d074e8643d85c84778ef8aa8ec9a2..8b6f3c211b1038717bc4e50ca71bea5dca6d87ca 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: main.ml,v 1.21 2008/07/29 08:31:41 xleroy Exp $ *)
+(* $Id: main.ml,v 1.21.2.2 2009/04/02 09:44:21 xclerc Exp $ *)
 
-open Primitives
-open Misc
 open Input_handling
 open Question
 open Command_line
@@ -47,12 +45,12 @@ let rec protect ppf restart loop =
           !current_checkpoint.c_pid;
         pp_print_flush ppf ();
         stop_user_input ();
-        loop ppf)
+        restart ppf)
   | Toplevel ->
       protect ppf restart (function ppf ->
         pp_print_flush ppf ();
         stop_user_input ();
-        loop ppf)
+        restart ppf)
   | Sys.Break ->
       protect ppf restart (function ppf ->
         fprintf ppf "Interrupted.@.";
@@ -62,7 +60,7 @@ let rec protect ppf restart loop =
             try_select_frame 0;
             show_current_event ppf;
           end);
-        loop ppf)
+        restart ppf)
   | Current_checkpoint_lost ->
       protect ppf restart (function ppf ->
         fprintf ppf "Trying to recover...@.";
@@ -70,7 +68,7 @@ let rec protect ppf restart loop =
         recover ();
         try_select_frame 0;
         show_current_event ppf;
-        loop ppf)
+        restart ppf)
   | Current_checkpoint_lost_start_at (time, init_duration) ->
       protect ppf restart (function ppf ->
         let b =
index 9d38ed7702535385ae85726946c577c95f0c7a60..80dfb4cab55de1830b6d0bed445839c35fae7211 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: parameters.ml,v 1.3 2002/02/14 15:17:10 doligez Exp $ *)
+(* $Id: parameters.ml,v 1.3.28.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (* Miscellaneous parameters *)
 
 open Primitives
 open Config
-open Misc
+open Debugger_config
 
 let program_loaded = ref false
 let program_name = ref ""
@@ -31,5 +31,9 @@ let add_path dir =
   load_path := dir :: except dir !load_path;
   Envaux.reset_cache()
 
+let add_path_for mdl dir =
+  let old = try Hashtbl.find load_path_for mdl with Not_found -> [] in
+  Hashtbl.replace load_path_for mdl (dir :: old)
+
 (* Used by emacs ? *)
 let emacs = ref false
index 3d8b3e20058992bc8637e95ad69e7f1f02e4b3e2..f392677e9121c5ea34d6586949a50616579683b2 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: parameters.mli,v 1.2 1999/11/17 18:57:26 xleroy Exp $ *)
+(* $Id: parameters.mli,v 1.2.40.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (* Miscellaneous parameters *)
 
@@ -21,6 +21,7 @@ val arguments : string ref
 val default_load_path : string list ref
 
 val add_path : string -> unit
+val add_path_for : string -> string -> unit
 
 (* Used by emacs ? *)
 val emacs : bool ref
index 829412b6367d71d9fdd83585747a6c7633378211..750f29631b518199bbf45de63a67baebd1787d41 100644 (file)
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: parser.mly,v 1.7 2002/10/29 17:53:24 doligez Exp $ */
+/* $Id: parser.mly,v 1.7.28.3 2009/04/15 11:09:56 xclerc Exp $ */
 
 %{
 
 open Int64ops
-open Primitives
 open Input_handling
 open Longident
 open Parser_aux
@@ -93,7 +92,7 @@ open Parser_aux
 %type <Parser_aux.break_arg> break_argument_eol
 
 %start list_arguments_eol
-%type <string option * int option * int option> list_arguments_eol
+%type <Longident.t option * int option * int option> list_arguments_eol
 
 %start end_of_line
 %type <unit> end_of_line
@@ -101,6 +100,12 @@ open Parser_aux
 %start longident_eol
 %type <Longident.t> longident_eol
 
+%start opt_longident
+%type <Longident.t option> opt_longident
+
+%start opt_longident_eol
+%type <Longident.t option> opt_longident_eol
+
 %%
 
 /* Raw arguments */
@@ -173,7 +178,15 @@ module_path :
 ;
 
 longident_eol :
-    longident end_of_line      { $1 };
+    longident end_of_line       { $1 };
+
+opt_longident :
+    UIDENT                      { Some (Lident $1) }
+  | module_path DOT UIDENT      { Some (Ldot($1, $3)) }
+  |                             { None };
+
+opt_longident_eol :
+    opt_longident end_of_line   { $1 }; 
 
 identifier :
     LIDENT                      { $1 }
@@ -220,16 +233,16 @@ break_argument_eol :
     end_of_line                                 { BA_none }
   | integer_eol                                 { BA_pc $1 }
   | expression end_of_line                      { BA_function $1 }
-  | AT opt_identifier INTEGER opt_integer_eol   { BA_pos1 ($2, (to_int $3), $4)}
-  | AT opt_identifier SHARP integer_eol         { BA_pos2 ($2, $4) }
+  | AT opt_longident INTEGER opt_integer_eol    { BA_pos1 ($2, (to_int $3), $4)}
+  | AT opt_longident SHARP integer_eol          { BA_pos2 ($2, $4) }
 ;
 
 /* Arguments for list */
 
 list_arguments_eol :
-    opt_identifier integer opt_integer_eol
+    opt_longident integer opt_integer_eol
       { ($1, Some $2, $3) }
-  | opt_identifier_eol
+  | opt_longident_eol
       { ($1, None, None) };
 
 /* End of line */
index ff10352fdef3e7dc77042a4fcd812ae37a87bd97..74da5529a48a8ed4cd5d02e76bfd5fb53bc2f1e1 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: parser_aux.mli,v 1.4 1999/11/17 18:57:26 xleroy Exp $ *)
+(* $Id: parser_aux.mli,v 1.4.40.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (*open Globals*)
 
@@ -28,7 +28,7 @@ type break_arg =
     BA_none                             (* break *)
   | BA_pc of int                        (* break PC *)
   | BA_function of expression           (* break FUNCTION *)
-  | BA_pos1 of string option * int * int option
+  | BA_pos1 of Longident.t option * int * int option
                                         (* break @ [MODULE] LINE [POS] *)
-  | BA_pos2 of string option * int      (* break @ [MODULE] # OFFSET *)
+  | BA_pos2 of Longident.t option * int (* break @ [MODULE] # OFFSET *)
 
index db1185ba03d68ae4f0e185758ec28eecaf9ab1a5..96dbb03a3077f15941e3ac9d11993de26071ec85 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: primitives.ml,v 1.6 2002/10/29 17:53:24 doligez Exp $ *)
+(* $Id: primitives.ml,v 1.6.28.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (*********************** Basic functions and types *********************)
 
@@ -36,26 +36,6 @@ let index a l =
   | b::l -> if a = b then i else index_rec (i + 1) l
  in index_rec 0 l
 
-(* Remove an element from an association list *)
-let assoc_remove lst elem =
-  let rec remove =
-    function
-      [] -> []
-    | ((a, _) as c::t) ->
-      if a = elem then t
-      else c::(remove t)
-  in remove lst
-
-(* Nth element of a list. *)
-let rec list_nth p0 p1 =
-  match (p0,p1) with
-    ([], _) ->
-      invalid_arg "list_nth"
-  | ((a::_), 0) ->
-      a
-  | ((_::l), n) ->
-      list_nth l (n - 1)
-
 (* Return the `n' first elements of `l' *)
 (* ### n l -> l' *)
 let rec list_truncate =
@@ -87,44 +67,8 @@ let list_replace x y =
         else a::(repl l)
   in repl
 
-(* Filter `list' according to `predicate'. *)
-(* ### predicate list -> list' *)
-let filter p =
-  let rec filter2 =
-    function
-      [] ->
-        []
-    | a::l ->
-        if p a then
-          a::(filter2 l)
-        else
-          filter2 l
-  in filter2
-
-(* Find the first element `element' of `list' *)
-(* so that `predicate element' holds. *)
-(* ### predicate list -> element *)
-let find p =
-  let rec find2 =
-    function
-      [] ->
-        raise Not_found
-    | a::l ->
-        if p a then a
-        else find2 l
-  in find2
-
 (*** Operations on strings. ***)
 
-(* Return the position of the first occurence of char `c' in string `s' *)
-(* Raise `Not_found' if `s' does not contain `c'. *)
-(* ### c s -> pos *)
-let string_pos s c =
-  let i = ref 0 and l = String.length s in
-    while !i < l && String.get s !i != c do i := !i + 1 done;
-    if !i = l then raise Not_found;
-    !i
-
 (* Remove blanks (spaces and tabs) at beginning and end of a string. *)
 let is_space = function
   | ' ' | '\t' -> true | _ -> false
index 587c5a2019c9416314cbdc75fa773c359e632425..adf0ce95cbfe692fec8cf7b2d416c10d17cd7012 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: primitives.mli,v 1.2 1999/11/17 18:57:26 xleroy Exp $ *)
+(* $Id: primitives.mli,v 1.2.40.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (********************* Basic functions and types ***********************)
 
@@ -29,12 +29,6 @@ val except : 'a -> 'a list -> 'a list
 (* Position of an element in a list. Head of list has position 0. *)
 val index : 'a -> 'a list -> int
 
-(* Remove on element from an association list. *)
-val assoc_remove : ('a * 'b) list -> 'a -> ('a * 'b) list
-
-(* Nth element of a list. *)
-val list_nth : 'a list -> int -> 'a
-
 (* Return the `n' first elements of `l'. *)
 (* ### n l -> l' *)
 val list_truncate : int -> 'a list -> 'a list
@@ -47,23 +41,8 @@ val list_truncate2 : int -> 'a list -> 'a list * 'a list
 (* ### x y l -> l' *)
 val list_replace : 'a -> 'a -> 'a list -> 'a list
 
-(* Filter `list' according to `predicate'. *)
-(* ### predicate list -> list' *)
-val filter : ('a -> bool) -> 'a list -> 'a list
-
-(* Find the first element `element' of `list' *)
-(* so that `predicate element' holds. *)
-(* Raise `Not_found' if no such element. *)
-(* ### predicate list -> element *)
-val find : ('a -> bool) -> 'a list -> 'a
-
 (*** Operations on strings. ***)
 
-(* Return the position of the first occurence of char `c' in string `s' *)
-(* Raise `Not_found' if `s' does not contain `c'. *)
-(* ### c s -> pos *)
-val string_pos : string -> char -> int
-
 (* Remove blanks (spaces and tabs) at beginning and end of a string. *)
 val string_trim : string -> string
 
index b6244f2e6f9ccdb03a8e20b8f7a12bab25c9a1c1..e984b415914a8e088636fc29cdc8ef7096d8bfee 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: printval.ml,v 1.21 2002/02/13 11:09:17 ddr Exp $ *)
+(* $Id: printval.ml,v 1.21.28.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (* To print values *)
 
-open Misc
-open Obj
 open Format
 open Parser_aux
 open Path
index a820a09c873b57adb09a088dfd791cb3a24cd0a5..4d5d368c26561babb0924ee7b25d0fd7e48080b6 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: program_loading.ml,v 1.8 2008/07/29 08:31:41 xleroy Exp $ *)
+(* $Id: program_loading.ml,v 1.8.2.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (* Program loading *)
 
 open Unix
-open Misc
 open Debugger_config
 open Parameters
 open Input_handling
index 1a83e60a5a2de7bf6ecd8467e9472f0527afd45b..660ef292fe6a7bf54de2b8396427551ecf262801 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: program_management.ml,v 1.13 2008/07/29 08:31:41 xleroy Exp $ *)
+(* $Id: program_management.ml,v 1.13.2.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (* Manage the loading of the program *)
 
@@ -19,13 +19,10 @@ open Int64ops
 open Unix
 open Unix_tools
 open Debugger_config
-open Misc
-open Instruct
 open Primitives
 open Parameters
 open Input_handling
 open Question
-open Debugcom
 open Program_loading
 open Time_travel
 
index 28dc179a5ff0160d9a26928b58492dacfd4c4e6b..165fbf35850f6ac98c139bd5799793ad55fdd48f 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: show_information.ml,v 1.13 2005/08/25 15:35:16 doligez Exp $ *)
+(* $Id: show_information.ml,v 1.13.18.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 open Instruct
 open Format
-open Primitives
 open Debugcom
 open Checkpoints
 open Events
index aa1aa9cfe7111495b40699b394146495b502d5fa..1189b5061c5224f9590f0bff1156993a376862e8 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: show_source.ml,v 1.14 2006/12/09 13:49:10 ertai Exp $ *)
+(* $Id: show_source.ml,v 1.14.14.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 open Debugger_config
 open Instruct
-open Misc
 open Parameters
 open Primitives
 open Printf
index fec96b9f151a744b8e45448bafdd9b030879b1cc..644fe845c9703c6470bd0796c0b24fa44db4b741 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: source.ml,v 1.8 2006/12/09 13:49:10 ertai Exp $ *)
+(* $Id: source.ml,v 1.8.14.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (************************ Source management ****************************)
 
@@ -23,17 +23,37 @@ let source_extensions = [".ml"]
 (*** Conversion function. ***)
 
 let source_of_module pos mdle =
+  let is_submodule m m' =
+    let len' = String.length m' in
+    try
+      (String.sub m 0 len') = m' && (String.get m len') = '.'
+    with
+      Invalid_argument _ -> false in
+  let path =
+    Hashtbl.fold
+      (fun mdl dirs acc ->
+        if is_submodule mdle mdl then
+          dirs
+        else
+          acc)
+      Debugger_config.load_path_for
+      !Config.load_path in
   let fname = pos.Lexing.pos_fname in
   if fname = "" then
+    let innermost_module =
+      try
+        let dot_index = String.rindex mdle '.' in
+        String.sub mdle (succ dot_index) (pred ((String.length mdle) - dot_index))
+      with Not_found -> mdle in
     let rec loop =
       function
       | [] -> raise Not_found
       | ext :: exts ->
-          try find_in_path_uncap !Config.load_path (mdle ^ ext)
+          try find_in_path_uncap path (innermost_module ^ ext)
           with Not_found -> loop exts
     in loop source_extensions
   else if Filename.is_implicit fname then
-    find_in_path !Config.load_path fname
+    find_in_path path fname
   else
     fname
 
index 9834b6f5c91faead30808ec795921b51fc3cf643..4b22d8952f9cecafc712a4e87201e63a2639a8b8 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: symbols.ml,v 1.18 2005/08/25 15:35:16 doligez Exp $ *)
+(* $Id: symbols.ml,v 1.18.18.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (* Handling of symbol tables (globals and events) *)
 
@@ -92,7 +92,7 @@ let read_symbols bytecode_file =
           modules := md :: !modules;
           Hashtbl.add all_events_by_module md sorted_evl;
           let real_evl =
-            Primitives.filter
+            List.filter
               (function
                  {ev_kind = Event_pseudo} -> false
                | _                        -> true)
index 8917bd5e0c6a5cbde762d2fb739a63aae4c886c7..0d0202468311ee8cbc96b34b82a7bdd791459fa1 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: time_travel.ml,v 1.21 2006/12/09 16:23:37 ertai Exp $ *)
+(* $Id: time_travel.ml,v 1.21.14.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (**************************** Time travel ******************************)
 
@@ -384,7 +384,7 @@ let kill_all_checkpoints () =
 (* --- Assume that the checkpoint is valid. *)
 let forget_process fd pid =
   let checkpoint =
-    find (function c -> c.c_pid = pid) (!current_checkpoint::!checkpoints)
+    List.find (function c -> c.c_pid = pid) (!current_checkpoint::!checkpoints)
   in
     Printf.eprintf "Lost connection with process %d" pid;
     let kont =
index 1e15362253b7b21137e6836d77ac00adb97781a5..c9f233bb96eb9f641f60a3444dc80daebe467165 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: unix_tools.ml,v 1.9 2008/07/29 08:31:41 xleroy Exp $ *)
+(* $Id: unix_tools.ml,v 1.9.2.1 2009/04/02 09:44:21 xclerc Exp $ *)
 
 (****************** Tools for Unix *************************************)
 
@@ -22,7 +22,7 @@ open Primitives
 (*** Convert a socket name into a socket address. ***)
 let convert_address address =
   try
-    let n = string_pos address ':' in
+    let n = String.index address ':' in
       let host = String.sub address 0 n
       and port = String.sub address (n + 1) (String.length address - n - 1)
       in
@@ -90,7 +90,7 @@ let search_in_path name =
 let rec expand_path ch =
   let rec subst_variable ch =
     try
-      let pos = string_pos ch '$' in
+      let pos = String.index ch '$' in
         if (pos + 1 < String.length ch) && (ch.[pos + 1] = '$') then
           (String.sub ch 0 (pos + 1))
             ^ (subst_variable
@@ -121,7 +121,7 @@ let rec expand_path ch =
       in
         if ch.[0] = '~' then
           try
-            match string_pos ch '/' with
+            match String.index ch '/' with
               1 ->
                 (let tail = String.sub ch 2 (String.length ch - 2)
                  in
index 7459f66b6d396f1ec0bc3a314f88d7fd2d368f29..7496845242c6220fd167a716a1e15f0043a3da07 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: main.ml,v 1.71.2.1 2008/10/15 08:48:51 xleroy Exp $ *)
+(* $Id: main.ml,v 1.71.2.2 2009/01/14 13:19:32 doligez Exp $ *)
 
 open Config
 open Clflags
@@ -154,9 +154,13 @@ let main () =
     Arg.parse Options.list anonymous usage;
     if
       List.length (List.filter (fun x -> !x)
-                    [make_archive;make_package;compile_only;output_c_object]) > 1
+                      [make_archive;make_package;compile_only;output_c_object])
+        > 1
     then
-      fatal "Please specify at most one of -pack, -a, -c, -output-obj";
+      if !print_types then
+        fatal "Option -i is incompatible with -pack, -a, -output-obj"
+      else
+        fatal "Please specify at most one of -pack, -a, -c, -output-obj";
 
     if !make_archive then begin
       Compile.init_path();
index 5f97b9c1ccbb62f1e4218a774f46d58f86a51c3b..8087d74720536dcec3a16de297136e4ddd9ebc74 100644 (file)
@@ -1,4 +1,4 @@
-\" $Id: ocaml.m,v 1.10 2008/09/15 14:05:30 doligez Exp $
+\" $Id: ocaml.m,v 1.10.2.1 2009/01/13 15:17:09 doligez Exp $
 
 .TH OCAML 1
 
@@ -54,7 +54,7 @@ exits after the execution of the last phrase.
 The following command-line options are recognized by
 .BR ocaml (1).
 .TP
-.BI -I \ directory
+.BI \-I \ directory
 Add the given directory to the list of directories searched for
 source and compiled files. By default, the current directory is
 searched first, then the standard library directory. Directories added
index 2c9479527cd5d1865ce86afd05cad65649af56bd..6e9d40d6d3fb0f76b0a68ba19a6da1f32976aa8f 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: myocamlbuild.ml,v 1.23.2.2 2008/10/23 15:29:11 ertai Exp $ *)
+(* $Id: myocamlbuild.ml,v 1.23.2.5 2009/05/05 13:40:18 ertai Exp $ *)
 
 open Ocamlbuild_plugin
 open Command
@@ -131,6 +131,7 @@ let ocamlc_solver =
                     "stdlib/std_exit.cmx"; "stdlib/std_exit"-.-C.o] in
   let byte_deps = ["ocamlc"; "stdlib/stdlib.cma"; "stdlib/std_exit.cmo"] in
   fun () ->
+    if Pathname.exists "../ocamlcomp.sh" then S[A"../ocamlcomp.sh"] else
     if List.for_all Pathname.exists native_deps then
       S[A"./ocamlc.opt"; A"-nostdlib"]
     else if List.for_all Pathname.exists byte_deps then
@@ -141,7 +142,8 @@ Command.setup_virtual_command_solver "OCAMLC" ocamlc_solver;;
 Command.setup_virtual_command_solver "OCAMLCWIN" (convert_for_windows_shell ocamlc_solver);;
 
 let ocamlopt_solver () =
-  S[if Pathname.exists "ocamlopt.opt" && Pathname.exists ("stdlib/stdlib.cmxa")
+  S[if Pathname.exists "../ocamlcompopt.sh" then S[A"../ocamlcompopt.sh"] else
+    if Pathname.exists "ocamlopt.opt" && Pathname.exists ("stdlib/stdlib.cmxa")
     then A"./ocamlopt.opt"
     else S[ocamlrun; A"./ocamlopt"];
     A"-nostdlib"];;
@@ -341,9 +343,11 @@ copy_rule' "lex/main.byte" "lex/ocamllex";;
 copy_rule' "lex/main.native" "lex/ocamllex.opt";;
 copy_rule' "debugger/main.byte" "debugger/ocamldebug";;
 copy_rule' "ocamldoc/odoc.byte" "ocamldoc/ocamldoc";;
-copy_rule' "ocamldoc/odoc_opt.native" "ocamldoc/ocamldoc.opt";;
+copy_rule' "ocamldoc/odoc.native" "ocamldoc/ocamldoc.opt";;
 copy_rule' "tools/ocamlmklib.byte" "tools/ocamlmklib";;
 copy_rule' "otherlibs/dynlink/extract_crc.byte" "otherlibs/dynlink/extract_crc";;
+copy_rule' "myocamlbuild_config.mli" "ocamlbuild/ocamlbuild_Myocamlbuild_config.mli";;
+copy_rule' "myocamlbuild_config.ml" "ocamlbuild/ocamlbuild_Myocamlbuild_config.ml";;
 
 copy_rule' ~insert:`bottom "%" "%.exe";;
 
index 84dcc47beb6fe68ee4522a53ae540b0908a7a19e..36bf9ee9f1098a7539a716c13c17b58ea1f94cc2 100644 (file)
@@ -24,6 +24,7 @@ ifdef O
 OCAMLBUILD_OPTIONS := $(OCAMLBUILD_OPTIONS) $(O)
 endif
 
+ifeq ($(wildcard ./ocamlbuild_Myocamlbuil*_config.ml),./ocamlbuild_Myocamlbuild_config.ml)
 ifeq ($(wildcard ./boot/oc*build),./boot/ocamlbuild)
 OCAMLBUILD=INSTALL_LIB=$(INSTALL_LIB) INSTALL_BIN=$(INSTALL_BIN) $(OCAMLBUILDCMD) -build-dir $(BUILDDIR) -no-links $(OCAMLBUILD_OPTIONS)
 LIBS=ocamlbuildlib ocamlbuildlightlib
@@ -35,6 +36,8 @@ all:
        $(OCAMLBUILD) $(BYTE) $(NATIVE)
 byte:
        $(OCAMLBUILD) $(BYTE)
+native:
+       $(OCAMLBUILD) $(NATIVE)
 profile:
        $(OCAMLBUILD) $(LIBS:=.p.cmxa) $(PROGRAMS:=.p.native)
 debug:
@@ -52,6 +55,13 @@ all byte native: ocamlbuild.byte.start
        cp $(BUILDDIR)/ocamlbuild.native boot/ocamlbuild
        $(MAKE) $(MFLAGS) $(MAKECMDGOALS) OCAMLBUILD_OPTIONS="-nothing-should-be-rebuilt -verbose -1"
 endif
+else
+all byte native:
+       @echo "Please copy the myocamlbuild_config.ml of the OCaml source distribution"
+       @echo "  as ocamlbuild_Myocamlbuild_config.ml"
+       @echo
+       @echo "$$ cp ../myocamlbuild_config.ml ocamlbuild_Myocamlbuild_config.ml"
+endif
 
 ocamlbuild.byte.start:
        ./start.sh
index 19cb9142cdf9534a936d3e05378bca150abea73d..d31944c1c04cc0ac1a081e886596ca9a185acfc2 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: bool.ml,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Bool *)
 
index 1f4a92e684637262e0c2773524a18039cd8c401e..59ead55a4835b1e0000f59ca90330c88a0952fbc 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: bool.mli,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Bool *)
 
index 077e2ac989a4f1addc966492ed51eb4b8e974c2d..40f4022a944019ea61f7191117648918d027d130 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: command.ml,v 1.8 2008/07/25 14:28:56 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* Command *)
 
index 389d6f3b299e1f978b70d51ffc3eb17dbb720556..48e7fdc277682ff29a528935972f2f94be74ed57 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: command.mli,v 1.6 2008/07/25 14:25:20 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* Command *)
 
index f57a6f0c22464ddd782ee9e5303f081f6c33e67b..c4903caea0c53dab49c0bb6c39ac130c8b5cce7e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: configuration.ml,v 1.2 2007/11/28 16:03:48 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Log
index c27edc32499e5c640d66331488c96d87e61a6586..8ee2f42bb8f380109088a20fd1200f668221ef5d 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: configuration.mli,v 1.3 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* Configuration *)
 
index 5bcd87635cb2c3fd3785ccc489f631fc01e24eaf..0d2e925d9c84ada16af0343f3c248ecc9bdde563 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: discard_printf.ml,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 let rec greedy _ = greedy
 
index 737ebdb2d6a3e24d745282b5278c494fdb30d56e..255f5d1aa8ab3b26c1f9ce6055f29e063a44a624 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: discard_printf.mli,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* Discard_printf *)
 
index 326ab16b34b2cf27630ef18dc99bac017e3cf191..8178afece1c5a91586f80a63ca8dbf9d69a6819d 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: display.ml,v 1.3.4.1 2008/11/06 15:40:39 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Display *)
 open My_std;;
index de47ca5a481742bacbf0273363d3fed347d26c4b..fd0b066d2eee5dbf50d9c19b41d7ad2d7fae18cc 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: display.mli,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Display *)
 
index 21a81ae7542951d604b143771cdc31bf475e2015..4d4bbac0277e077bc89b4519df21fcf7bc428c79 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: fda.ml,v 1.4 2007/11/22 18:29:31 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* FDA *)
 
index 9716034589d19c9f70217b9f8fe207616a8a02a5..c86d68572154bd16fce9dda1c570eb137fbdff7c 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: fda.mli,v 1.2 2007/02/08 16:53:39 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Fda *)
 
index 1696b3237db98342fd2d5b8cab7fcc7c74826035..bdf4fc6f86ac5d508d1f38b90aa48d647f5f86b0 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: flags.ml,v 1.2 2007/02/26 17:05:30 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open Command
 open Bool (* FIXME remove me *)
index 8901b709ab27365c4906170ef25893c91657af6a..941a75b77404eb344a83c37d1fc5b16af22e32d4 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: flags.mli,v 1.2 2007/02/26 17:05:30 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 val of_tags : Tags.t -> Command.spec
 val of_tag_list : Tags.elt list -> Command.spec
index 5a3bb1e8c7b83d2cd82797849c6b474dfc6bc9cc..6ecffedc4f361ccda93432349484d361f7b2732e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: glob.ml,v 1.5 2008/07/25 14:38:31 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Glob *)
 open My_std;;
index 102dd81aa26da5566680d0908173315c14dc60d3..f047c5b6d225009d11dc11dfd9b350057fc7d027 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: glob.mli,v 1.2 2007/11/21 21:02:15 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Glob *)
 
index ff4a60d209434f461835bcc9692812df96e241fc..a4efaeddbeee2a4443f44d80b70428c982d32723 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: glob_ast.ml,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Glob_ast *)
 
index 15783d784179878fa49f8454344f23d4c987f9b1..9c7786245649c00699e13929217ca2ceaba477bd 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: glob_ast.mli,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Glob_ast *)
 
index eea41c22d726e1cf392e5186ccf3aed546b7aa15..245870ecad36b6e7d17c8222ec1df9112fb03c09 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: glob_lexer.mli,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 open Glob_ast
 
index 586161561a7ee795305d5b52336a00ef9dce3c1c..99c30168d4ffe4175df4fb202d217c68823739e7 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: glob_lexer.mll,v 1.4 2007/11/21 21:03:14 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Glob *)
 {
index 0697ef47a4523c153626603e33c656b3d6dac928..e7fd50d501c6edb90c67aba9d61cd19b7935b840 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: hooks.ml,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 type message =
   | Before_hygiene
index eb0f6b64501da448568be75b8995aad98906bf1f..aced084dde0711fd4cf90333a50f2790a8fdf137 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: hooks.mli,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 type message =
   | Before_hygiene
index 7b0a135ca3ce54d1f306778563d4564bfd28aefc..f6101e915ca744560d33b0e4746c2af2cf60fbaf 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: hygiene.ml,v 1.5 2007/11/22 18:29:32 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Hygiene *)
 open My_std
index b1e18d99d5338c7c35b3036853b313474cfcb705..3342038203626362075aa07efd8f4ead7a97e352 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: hygiene.mli,v 1.3 2007/02/22 15:56:23 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Hygiene *)
 
index a9b7ed432219304f1c5c941409152d9f4db61eed..472a3cacd6399dbe4417c45dd0a19d2ea9c978f9 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: lexers.mli,v 1.5 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 exception Error of string
 
index 2a6a2dbd728d7c1367fd8be86898d6117f1baa4c..67fa1e601dc974300f6764a2042f5c4ce0c5bdf7 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: lexers.mll,v 1.7 2008/07/25 14:24:29 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 {
 exception Error of string
index 088995452cce38b670a9a1aa2568d32e8f3194ca..2fd2b2b1cfa2bee0622b3d911995443c90dab786 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: log.ml,v 1.3 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 
index 6e1c80ed317f215bb21e007eb0c15311db179ea8..8f4167bfef27e245b093d2ac08b5bbc066280fc4 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: log.mli,v 1.3 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* Log *)
 
index 38dc396fc3a8a04a616ac6699dd439e683d827ad..7b48b4201bf89a63b0df866f353f6f616ba2179d 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: main.ml,v 1.21.4.1 2008/11/06 15:40:39 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 open My_std
 open Log
index 95e469a1ce7f70979b95929ab335b8278ea553b2..c401be7d62602738ff7e8932f6f4659c18c45796 100644 (file)
@@ -9,6 +9,6 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: main.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 val main : unit -> unit
index 77966a0d3f24e451cd62cc3523ff26f47ab65bfd..b011f1540b0874d62ceb6cfa93dd6a7c5b31f683 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: opentracer.ml,v 1.1 2007/02/07 08:59:15 ertai Exp $ *)
+
 open My_std
 
 module type TRACER = sig
index bb809da80f660bf310475272d630c44f842df77d..b5abd1186c5582fba809df3d8f63931a8a6a8ea3 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: my_std.ml,v 1.10 2008/10/01 08:36:26 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open Format
 
index 790f7de6cdc1e0cb563f9528700c2e2690332f09..9346725ba271d28f93eeb7b0d6f918daff0eca3c 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: my_std.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* My_std *)
 
index 29f2f5ac8a8b3bb9638201857ca88312b07509b3..89e9431ee0a60ab25cade57b855ec666ef03dc12 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: my_unix.ml,v 1.5 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Format
index 670903b2e817a8849de7834eb9c34ad60606b04c..b1acd3a62d3a167fb266c98b0c7de619ddd6a1b7 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: my_unix.mli,v 1.4 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 type file_kind =
 | FK_dir
index a54ce15694a3c131d4bede12ab866381a95c7ea9..5563dddd2b5832f120cfeed87a5082e6f2e1b7e0 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_arch.ml,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Command
index 356bcf2cc451e83123721c20ed6607cb58805ff1..ffdc4eddc8cdf99359b16bb45ae097ae305e1e7d 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_arch.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 
 include Signatures.ARCH
index 93adf5ab5f0272623cc26fa00914c64d845bfe3a..1d736c09de460c93e4508f6307d94c3eddd907e7 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_compiler.ml,v 1.10 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Format
index 06353766bfce47a0a31a525c647874f9ebfb010c..72d37022bf8b7a7e58626f5b636d43c8953a4a7e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_compiler.mli,v 1.2 2007/02/12 10:26:08 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 
 val forpack_flags : string -> Tags.t -> Command.spec
index 8d9ee167c55fd45e0981a53cc66e783735bd29eb..666b1842b93d35f0c882615bc2571ac8d5f5a3e9 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_dependencies.ml,v 1.3 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Log
index 89082327501a3edc321eb66e727a34ef9aeec2b6..68bc427cc2b450f4aee8a3836a4673241e4cda1d 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_dependencies.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (** Ocaml dependencies *)
 
index d90850102267e77a5947d2ea846f196e28023880..e5ad0a2297333d2de0f7ede8acb3bb3d8f753723 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_specific.ml,v 1.23.2.1 2008/10/22 11:23:57 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Format
@@ -441,18 +441,6 @@ flag ["ocaml"; "doc"; "docfile"; "extension:tex"] (A"-latex");;
 flag ["ocaml"; "doc"; "docfile"; "extension:ltx"] (A"-latex");;
 flag ["ocaml"; "doc"; "docfile"; "extension:texi"] (A"-texi");;
 
-(** Ocamlbuild plugin for it's own building *)
-let install_lib = lazy (try Sys.getenv "INSTALL_LIB" with Not_found -> !*stdlib_dir/"ocamlbuild" (* not My_std.getenv since it's lazy*)) in
-let install_bin = lazy (My_std.getenv ~default:"/usr/local/bin" "INSTALL_BIN") in
-rule "ocamlbuild_where.ml"
-  ~prod:"%ocamlbuild_where.ml"
-  begin fun env _ ->
-    Echo(
-      ["let bindir = ref \""; String.escaped !*install_bin; "\";;\n";
-       "let libdir = ref (try Filename.concat (Sys.getenv \"OCAMLLIB\") \"ocamlbuild\" with Not_found -> \"";
-         String.escaped !*install_lib; "\");;\n"],
-      env "%ocamlbuild_where.ml")
-  end;;
 ocaml_lib "ocamlbuildlib";;
 ocaml_lib "ocamlbuildlightlib";;
 
index be502625afb3bd74fc0ed718a332a00e934119b9..42e512c744149e920ef1349bfb000bf3b7757ac7 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_specific.mli,v 1.2 2007/02/26 16:27:45 ertai Exp $ *)
+
 
 (* Original author: Nicolas Pouillard *)
 
index 6fa70e6b7ccab986da42f297e94a60c998d38f78..74a27a87b5bfb906a158e87ae817411c8116515e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_tools.ml,v 1.12 2008/07/25 15:06:47 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Pathname.Operators
index 8b30e6a402d8cba887f1456770531e244f824214..542573de1fc0a1dcf8cd243d65bb37b282dab143 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_tools.mli,v 1.7 2008/07/25 15:06:47 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 
 val ocamldoc_c : Tags.t -> string -> string -> Command.t
index 43aacd1534ccfa9777e396da86d9a291668b0a19..d42c884b7819b71e762179024c7eb43998ee9730 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_utils.ml,v 1.8 2008/07/25 14:49:03 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Format
index 8abc2233e00b72db7c168426dba92d630f5cc616..09329bdd3c252627e8d5b6cc75234f2439c40814 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocaml_utils.mli,v 1.6 2008/07/25 14:26:13 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 val stdlib_dir : Pathname.t Lazy.t
 val module_name_of_filename : Pathname.t -> string
index f0792d4223a27ea3f05eff2a8874c7a389857590..d3b82518729b55ccd6e88365300b793617c14e8a 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuild.ml,v 1.3 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 Ocamlbuild_unix_plugin.setup ();
 Ocamlbuild_pack.Main.main ()
index 9cddf473a422c854dfbc825f909ad568a5e116a1..3f466934e1d2296cb3681f184e83ce6f6cfb02bb 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuild.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (** Nothing to export for now *)
 
index c432c19fa8b17be42dfa19429bffdb984a532752..587f4210e5b7463dd7b9e9de3c4ef12ba2c6576f 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuild_executor.ml,v 1.4 2007/11/28 17:21:59 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Ocamlbuild_executor *)
 
index d8f7816966d55dfc2b2a71890e0cbfb089b07576..fc25badc45d4ff6cbac731970793e5b2a2f15dec 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuild_executor.mli,v 1.4 2007/11/28 17:21:59 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Ocamlbuild_executor *)
 
index acc3aa6a38f3b5b048cc5382032aa1f4fcc3cf49..92b16c7c97bb165e1d3ab2ad819e44515af0ea19 100644 (file)
@@ -23,6 +23,7 @@ Fda
 Ocaml_specific
 Ocaml_arch
 Ocamlbuild_where
+Ocamlbuild_Myocamlbuild_config
 Lexers
 Glob
 Bool
index 44e29dca136d1219224fe18af8db8c4693d757cd..930ba17c249dea46585c42d4d3c287cfd6244377 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuild_plugin.ml,v 1.11 2008/07/25 14:42:28 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 
 open Ocamlbuild_pack
index 59bbbee78fb7554add4ec41ea6b7683af5150381..1e4efff4f80f428872a2083e0f3d4f0a208ea812 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuild_unix_plugin.ml,v 1.3 2008/07/31 07:36:12 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open Format
 open Ocamlbuild_pack
index 682a9ad40c909bd04144a8b275d3f83823cd9c71..24269e5a87384a243cad25c881532c37975a0fc0 100644 (file)
@@ -9,6 +9,6 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuild_unix_plugin.mli,v 1.2 2007/11/22 18:34:22 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 val setup : unit -> unit
diff --git a/ocamlbuild/ocamlbuild_where.ml b/ocamlbuild/ocamlbuild_where.ml
new file mode 100644 (file)
index 0000000..1703a53
--- /dev/null
@@ -0,0 +1,5 @@
+let bindir = ref Ocamlbuild_Myocamlbuild_config.bindir;;
+let libdir = ref begin
+  try Filename.concat (Sys.getenv "OCAMLLIB") "ocamlbuild"
+  with Not_found -> Ocamlbuild_Myocamlbuild_config.libdir
+end;;
index e71809f1b9f07ded3cfd97fc9731a03a90b2ebf1..eb4c0727b01e6f53ac08568e78e5024a313c6592 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuild_where.mli,v 1.2 2007/10/08 14:19:34 doligez Exp $ *)
+
 
 (* Original author: Nicolas Pouillard *)
 
index 24eb35a3a27002991d39d2e558cd898ef6d25f96..7fabd81dc768839c2aed58a7a93765d5d444af57 100644 (file)
@@ -9,6 +9,6 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuildlight.ml,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 Ocamlbuild_pack.Main.main ();;
index ae07af39b4a41b8c7b05753084b4c965c4c39a99..38ffd9796358f365898d43eefc409d16bd0f0b5c 100644 (file)
@@ -9,6 +9,6 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlbuildlight.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* Nothing *)
index b3a03c5119bb053461dcd14e311f8ece110d63cd..7e9bd5b37ac0609844ade82f2ece86cbc50e2712 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: options.ml,v 1.16 2008/07/25 14:49:03 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 
 let version = "ocamlbuild "^(Sys.ocaml_version);;
index 985500534709bd7ce0e46744d9864d456b3975c2..7e07748bd220cd15dd658e2dbb9d9da8519228ce 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: options.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 
 include Signatures.OPTIONS with type command_spec = Command.spec
index 584c3fd90cea5467545e5abd7598709e641f221b..7ec8f24cf32a6f8829f321bbcd52cea6703c5a69 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: pathname.ml,v 1.6 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Format
index 0a7acae681e4b3142c02da3cf2d2a1a64475480d..1ba9badc580b71b56e63975bea9f38f34a66c385 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: pathname.mli,v 1.4 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 include Signatures.PATHNAME
 val link_to_dir : t -> t -> bool
index 043a6fcaaad9666403b0238adde3154364148ab8..97d76af0872e1dff9364a17453e0ff2861784df3 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: plugin.ml,v 1.4.4.1 2008/11/06 15:40:39 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Format
index e5494f6bedd436f28c509c32758eb72ea2453455..863de8dfc558d3a6bc575ec745ba9972d6647e46 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: plugin.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* Plugin *)
 
index 41cca6f13bfd50837bffff51a67536a840fe83ee..1b576004fba0ab2e078631c4de9215ad4e71556c 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ppcache.ml,v 1.3 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Command
index 5cd30f2da96738b9c50203cbddb8de5cdb60e0ff..d59015f57a5024c881134d938ffb7b32e2f9d1d1 100644 (file)
@@ -9,6 +9,6 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ppcache.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* nothing to export *)
index 9ec177314fa02f430375cb46e06cc27f942ea751..e9c5d503060ce62f61dd630b934f930ced58b72e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: report.ml,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Report *)
 
index a0385f9a47d12fa3e20fabca7f1a36759bb6844b..16785d701a605d785a4e5e922ad51d5d6ecf1a9d 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: report.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Report *)
 
index 6326bdaf09308315d262ba6e99ded945b801321b..e0bb74ba80b9096d1b1ef96d210f4fe829c08878 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: resource.ml,v 1.9 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Format
index d80186ca40e1c140d0afef7011d50c89b363ae6f..4822768b52c649958e8240bd07387d02f25f24bd 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: resource.mli,v 1.7 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 
index 3d6a110ce91ebb39780f3edc6bfbd1c37e927370..bf217e7d5e6692ef8e6a1cc51ae00b8e4428c30d 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: rule.ml,v 1.20 2008/07/25 14:50:47 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Format
index 2afba6bc0ee76ca8d59dcba453289664490ee75d..9be718e2b1d30482c90e683f5f333b9a83d844dd 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: rule.mli,v 1.12 2008/07/25 14:50:47 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Resource
index 1e2664d44d5ce6be78bcb2035791b64138c4de8c..6c84963903af9c2a08fd04367546a48a58eaf764 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: shell.ml,v 1.4 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 
index ae1bbe5b20b12ca39757b5ad67aa1aeccb30c572..d393c7b3e77c14baa367806010ca51ee8c7ae79a 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: shell.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 val is_simple_filename : string -> bool
 val quote_filename_if_needed : string -> string
index 479e3e5ac94576762167ac372647d44c1b887b1f..4304d749ff532370370e44c9a6e54d853d4070d8 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: signatures.mli,v 1.28 2008/07/25 14:42:28 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (** This module contains all module signatures that the user
     could use to build an ocamlbuild plugin. *)
index 7a9de141ebf6df4639261259cf4e36b717c4caf8..896628db1719b1136799850fae62e7e8fab15bc9 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: slurp.ml,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Slurp *)
 open My_std
index 6a4eece4fa4bbb9e89a6ee8dd426f76e391b9616..a3a141d8ebc1d056ab22f17165f570ca3698177e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: slurp.mli,v 1.1 2007/02/07 08:59:15 ertai Exp $ *)
+
 (* Original author: Berke Durak *)
 (* Slurp *)
 
index ae48be040aaf5f3b877778d88397c510aa610269..1f4f4ef03b75fff71402ab01607218d4c1729056 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: solver.ml,v 1.8 2008/07/25 14:50:47 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 open My_std
 open Log
index 18ca8aeeccb0380c98280dd11df6d9fe13849ef6..b2ec49525550caa819ebf44fc553ba332bedec3a 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: solver.mli,v 1.1 2007/02/07 08:59:15 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 type backtrace = private
   | Leaf of Pathname.t
index 331967cfb009fe3a71b8bc5ee5b7fbc3f5b7222a..742e81ad9f392af83f2936d759c57f5d7c6aac7a 100755 (executable)
@@ -12,7 +12,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: start.sh,v 1.6 2008/01/11 16:13:16 doligez Exp $
+
 
 set -e
 set -x
index 358bb661e5eef0b006c3c4eaaa8fb05ba4291e3a..8cef44138265e0332d7dce274b3127d5d2c85025 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: std_signatures.mli,v 1.1 2007/02/07 08:59:15 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (** Some signatures from the standard library. *)
 
index e9dc20d87b51fa6070cc979bfdc9f877ef34a636..811657accd82ddb675d87e0593bc7c2f97c131ac 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: tags.ml,v 1.2 2007/02/22 15:56:23 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 include Set.Make(String)
 
index 51a154ee7ed85ed135e071c2ec1d5e182a97ab41..dadf9afabf35cb321dd58f1ce342e6ab54bfc05e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: tags.mli,v 1.1 2007/02/07 08:59:15 ertai Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 
 include Signatures.TAGS
index 458d59a2c360fdc7d790b4e15862bd07f8a1d98c..587c2c759553af4eab403c863db3791e86c7f84b 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: tools.ml,v 1.4 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* Tools *)
 
index 2bc0854eba5f49aad5b29580d85464384206ac94..6c4b6f3ee75e271f3656dd9b75864ba54f3fd63f 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: tools.mli,v 1.3 2008/01/11 16:13:16 doligez Exp $ *)
+
 (* Original author: Nicolas Pouillard *)
 (* Tools *)
 
index f0b3e1ab981c223ceb70bb4710f13a2432e9106d..c5cfab00eb485f240b5beda6b37b0e7b312b2f9f 100644 (file)
@@ -146,14 +146,6 @@ odoc_name.cmx: ../typing/path.cmx odoc_misc.cmx ../typing/ident.cmx \
     odoc_name.cmi 
 odoc_ocamlhtml.cmo: 
 odoc_ocamlhtml.cmx: 
-odoc_opt.cmo: ../typing/typedtree.cmi odoc_texi.cmo odoc_messages.cmo \
-    odoc_man.cmo odoc_latex.cmo odoc_info.cmi odoc_html.cmo odoc_global.cmi \
-    odoc_dot.cmo odoc_args.cmi odoc_analyse.cmi ../utils/misc.cmi \
-    ../utils/config.cmi ../utils/clflags.cmi 
-odoc_opt.cmx: ../typing/typedtree.cmx odoc_texi.cmx odoc_messages.cmx \
-    odoc_man.cmx odoc_latex.cmx odoc_info.cmx odoc_html.cmx odoc_global.cmx \
-    odoc_dot.cmx odoc_args.cmx odoc_analyse.cmx ../utils/misc.cmx \
-    ../utils/config.cmx ../utils/clflags.cmx 
 odoc_parameter.cmo: ../typing/types.cmi odoc_types.cmi 
 odoc_parameter.cmx: ../typing/types.cmx odoc_types.cmx 
 odoc_parser.cmo: odoc_types.cmi odoc_comments_global.cmi odoc_parser.cmi 
index 0878a79594e8e04866fae3111e3c3c5b4fded8e7..66f9fddcb4c02f19917d96942e0296288621e550 100644 (file)
@@ -9,7 +9,7 @@
 #(*                                                                     *)
 #(***********************************************************************)
 
-# $Id: Makefile,v 1.66 2008/01/11 16:13:16 doligez Exp $
+# $Id: Makefile,v 1.66.4.1 2009/04/09 13:56:38 guesdon Exp $
 
 include ../config/Makefile
 
@@ -111,16 +111,17 @@ CMOFILES= odoc_config.cmo \
 CMXFILES= $(CMOFILES:.cmo=.cmx)
 CMIFILES= $(CMOFILES:.cmo=.cmi)
 
-EXECMOFILES=$(CMOFILES)\
-       odoc_dag2html.cmo\
-       odoc_to_text.cmo\
-       odoc_ocamlhtml.cmo\
-       odoc_html.cmo\
-       odoc_man.cmo\
+EXECMOFILES=$(CMOFILES) \
+       odoc_dag2html.cmo \
+       odoc_to_text.cmo \
+       odoc_ocamlhtml.cmo \
+       odoc_html.cmo \
+       odoc_man.cmo \
        odoc_latex_style.cmo \
-       odoc_latex.cmo\
-       odoc_texi.cmo\
-       odoc_dot.cmo
+       odoc_latex.cmo \
+       odoc_texi.cmo \
+       odoc_dot.cmo \
+       odoc.cmo
 
 EXECMXFILES= $(EXECMOFILES:.cmo=.cmx)
 EXECMIFILES= $(EXECMOFILES:.cmo=.cmi)
@@ -199,10 +200,10 @@ libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI)
 debug:
        make OCAMLPP=""
 
-$(OCAMLDOC): $(EXECMOFILES) odoc.cmo
-       $(OCAMLC) -o $@ -linkall unix.cma str.cma dynlink.cma $(LINKFLAGS) $(OCAMLCMOFILES) $(EXECMOFILES) odoc.cmo
-$(OCAMLDOC_OPT): $(EXECMXFILES) odoc_opt.cmx
-       $(OCAMLOPT) -o $@ unix.cmxa str.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES) odoc_opt.cmx
+$(OCAMLDOC): $(EXECMOFILES)
+       $(OCAMLC) -o $@ -linkall unix.cma str.cma dynlink.cma $(LINKFLAGS) $(OCAMLCMOFILES) $(EXECMOFILES)
+$(OCAMLDOC_OPT): $(EXECMXFILES)
+       $(OCAMLOPT) -o $@ unix.cmxa str.cmxa dynlink.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES)
 
 $(OCAMLDOC_LIBCMA): $(LIBCMOFILES)
        $(OCAMLC) -a -o $@ $(LINKFLAGS) $(OCAMLCMOFILES) $(LIBCMOFILES)
@@ -211,7 +212,7 @@ $(OCAMLDOC_LIBCMXA): $(LIBCMXFILES)
 
 manpages: stdlib_man/Pervasives.3o
 
-dot: $(EXECMOFILES) odoc.cmo
+dot: $(EXECMOFILES)
        $(OCAMLDOC_RUN) -dot -dot-reduce -o ocamldoc.dot $(INCLUDES) \
        odoc*.ml
 
index 0b6e916c30c812f3043e1375df15e1ea0ccbaf52..009bfbd163621d56cd46ee150cd385c56f9778b3 100644 (file)
@@ -9,7 +9,7 @@
 #(*                                                                     *)
 #(***********************************************************************)
 
-# $Id: Makefile.nt,v 1.27 2007/11/06 15:16:56 frisch Exp $
+# $Id: Makefile.nt,v 1.27.4.1 2009/04/09 13:56:38 guesdon Exp $
 
 include ../config/Makefile
 
@@ -115,6 +115,7 @@ EXECMOFILES=$(CMOFILES)\
        odoc_latex.cmo\
        odoc_texi.cmo\
        odoc_dot.cmo\
+       odoc.cmo
 
 
 EXECMXFILES= $(EXECMOFILES:.cmo=.cmx)
@@ -186,10 +187,10 @@ libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI)
 debug: 
        make OCAMLPP=""
 
-$(OCAMLDOC): $(EXECMOFILES) odoc.cmo
-       $(OCAMLC) -o $@ -linkall unix.cma str.cma dynlink.cma $(LINKFLAGS) $(OCAMLCMOFILES) $(EXECMOFILES) odoc.cmo
-$(OCAMLDOC_OPT): $(EXECMXFILES) odoc_opt.cmx
-       $(OCAMLOPT) -o $@ unix.cmxa str.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES) odoc_opt.cmx
+$(OCAMLDOC): $(EXECMOFILES) 
+       $(OCAMLC) -o $@ -linkall unix.cma str.cma dynlink.cma $(LINKFLAGS) $(OCAMLCMOFILES) $(EXECMOFILES)
+$(OCAMLDOC_OPT): $(EXECMXFILES)
+       $(OCAMLOPT) -o $@ unix.cmxa str.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES)
 
 $(OCAMLDOC_LIBCMA): $(LIBCMOFILES)
        $(OCAMLC) -a -o $@ $(LINKFLAGS) $(OCAMLCMOFILES) $(LIBCMOFILES)
index 472e93bdc350a1ad80374ce32641aa0606902ce2..97c70f3f47d4cdc9a12d5756f4d9dedb8c833f9e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc.ml,v 1.9 2006/09/20 11:14:36 doligez Exp $ *)
+(* $Id: odoc.ml,v 1.9.14.1 2009/04/09 13:56:38 guesdon Exp $ *)
 
 (** Main module for bytecode. *)
 
@@ -25,17 +25,18 @@ let print_DEBUG s = print_string s ; print_newline ()
 
 (* we check if we must load a module given on the command line *)
 let arg_list = Array.to_list Sys.argv
-let (cmo_or_cma_opt, paths) =
+let (cm_opt, paths) =
   let rec iter (f_opt, inc) = function
       [] | _ :: [] -> (f_opt, inc)
     | "-g" :: file :: q when
         ((Filename.check_suffix file "cmo") or
-         (Filename.check_suffix file "cma")) &
+         (Filename.check_suffix file "cma") or
+           (Filename.check_suffix file "cmxs")) &
         (f_opt = None) ->
-          iter (Some file, inc) q
-    | "-i" :: dir :: q ->
-        iter (f_opt, inc @ [dir]) q
-    | _ :: q ->
+      iter (Some file, inc) q
+  | "-i" :: dir :: q ->
+      iter (f_opt, inc @ [dir]) q
+  | _ :: q ->
         iter (f_opt, inc) q
   in
   iter (None, []) arg_list
@@ -63,12 +64,11 @@ let get_real_filename name =
      )
 
 let _ =
-  match cmo_or_cma_opt with
+  match cm_opt with
     None ->
       ()
   | Some file ->
-      (* initializations for dynamic loading *)
-      Dynlink.init ();
+      let file = Dynlink.adapt_filename file in
       Dynlink.allow_unsafe_modules true;
       try
         let real_file = get_real_filename file in
@@ -147,4 +147,4 @@ let _ =
     exit 0
 
 
-(* eof $Id: odoc.ml,v 1.9 2006/09/20 11:14:36 doligez Exp $ *)
+(* eof $Id: odoc.ml,v 1.9.14.1 2009/04/09 13:56:38 guesdon Exp $ *)
index f82458a97369f577757cb4989cebbdf8e26a52d9..d9ba9324c5008d1659258cee8ef800ba96a10fb0 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* cvsid $Id: odoc_args.ml,v 1.22 2008/07/25 13:28:23 guesdon Exp $ *)
+(* cvsid $Id: odoc_args.ml,v 1.22.2.1 2009/04/09 13:56:38 guesdon Exp $ *)
 
 (** Command-line arguments. *)
 
@@ -24,8 +24,6 @@ type source_file =
 
 let include_dirs = Clflags.include_dirs
 
-let bytecode_mode = ref true
-
 class type doc_generator =
     object
       method generate : Odoc_module.t_module list -> unit
@@ -254,10 +252,8 @@ let options = ref [
   "-dot", Arg.Unit (fun () -> set_doc_generator !default_dot_generator), M.generate_dot ;
   "-customdir", Arg.Unit (fun () -> Printf.printf "%s\n" Odoc_config.custom_generators_path; exit 0),
   M.display_custom_generators_dir ;
-  "-i", Arg.String (fun s -> if !bytecode_mode then () else (prerr_endline (M.option_not_in_native_code "-i"); exit 1)),
-  M.add_load_dir ;
-  "-g", Arg.String (fun s -> if !bytecode_mode then () else (prerr_endline (M.option_not_in_native_code "-g"); exit 1)),
-  M.load_file ^
+  "-i", Arg.String (fun s -> ()), M.add_load_dir ;
+  "-g", Arg.String (fun s -> ()), M.load_file ^
   "\n\n *** HTML options ***\n";
 
 (* html only options *)
index bd34ec5272e2d4d53709b7638ebb4cc19dc231e0..f2fd6b3927afab975a27ae8beecdcaf727de1f5f 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_args.mli,v 1.17 2008/07/25 13:28:23 guesdon Exp $ *)
+(* $Id: odoc_args.mli,v 1.17.2.1 2009/04/09 13:56:38 guesdon Exp $ *)
 
 (** Analysis of the command line arguments. *)
 
@@ -22,10 +22,6 @@ type source_file =
 (** The include_dirs in the OCaml compiler. *)
 val include_dirs : string list ref
 
-(** Indicate if we are in bytecode mode or not.
-   (For the [ocamldoc] command).*)
-val bytecode_mode : bool ref
-
 (** The class type of documentation generators. *)
 class type doc_generator =
   object method generate : Odoc_module.t_module list -> unit end
index f288da10da1533e5dab4eb607e82ee39bcf477f3..cadca59ad1a9b5be99be35eb7440371bbf115b6b 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_messages.ml,v 1.32 2008/07/25 13:28:23 guesdon Exp $ *)
+(* $Id: odoc_messages.ml,v 1.32.2.1 2009/04/09 13:56:38 guesdon Exp $ *)
 
 (** The messages of the application. *)
 
@@ -24,7 +24,6 @@ let message_version = software^" "^config_version
 let usage = "Usage : "^(Sys.argv.(0))^" [options] <files>\n"
 let options_are = "Options are :"
 let option_version = "\tPrint version and exit"
-let bytecode_only = "(bytecode version only)"
 let latex_only = "(LaTeX only)"
 let texi_only = "(TeXinfo only)"
 let latex_texi_only = "(LaTeX and TeXinfo only)"
@@ -41,8 +40,8 @@ let option_intf ="<file>\tConsider <file> as a .mli file"
 let option_text ="<file>\tConsider <file> as a .txt file"
 let display_custom_generators_dir = "\tDisplay custom generators standard directory and exit"
 let add_load_dir = "<dir>\tAdd the given directory to the search path for custom\n"^
-  "\t\tgenerators "^bytecode_only
-let load_file = "<file.cm[o|a]>\n\t\tLoad file defining a new documentation generator\n\t\t"^bytecode_only
+  "\t\tgenerators"
+let load_file = "<file.cm[o|a|xs]>\n\t\tLoad file defining a new documentation generator"
 let nolabels = "\tIgnore non-optional labels in types"
 let werr = "\tTreat ocamldoc warnings as errors"
 let hide_warnings = "\n\t\tdo not print ocamldoc warnings"
index edcaf8924f9b97fd507e19df122a2171acb5365d..a84597471ca3ae13071f93dcf5ebcf7d5b04af40 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_name.ml,v 1.10 2006/07/06 07:19:06 pouillar Exp $ *)
+(* $Id: odoc_name.ml,v 1.10.14.1 2009/03/12 18:21:08 doligez Exp $ *)
 
 (** Representation of element names. *)
 
@@ -35,12 +35,13 @@ type t = string
 
 let parens_if_infix name =
   match name with
-    "" -> ""
-  | s -> 
-      if List.mem s.[0] infix_chars then 
-        "("^s^")" 
-      else 
-        s
+  | "" -> ""
+  | s when s.[0] = '*' || s.[String.length s - 1] = '*' -> "( " ^ s ^ " )"
+  | s when List.mem s.[0] infix_chars -> "(" ^ s ^ ")"
+  | "or" | "mod" | "land" | "lor" | "lxor" | "lsl" | "lsr" | "asr" ->
+     "(" ^ name ^ ")"
+  | _ -> name
+;;
 
 let cut name =
   match name with
diff --git a/ocamldoc/odoc_opt.ml b/ocamldoc/odoc_opt.ml
deleted file mode 100644 (file)
index 791db14..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-(***********************************************************************)
-(*                             OCamldoc                                *)
-(*                                                                     *)
-(*            Maxence Guesdon, projet Cristal, INRIA Rocquencourt      *)
-(*                                                                     *)
-(*  Copyright 2001 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: odoc_opt.ml,v 1.6 2006/09/20 11:14:37 doligez Exp $ *)
-
-(** Main module for native version.*)
-
-open Config
-open Clflags
-open Misc
-open Format
-open Typedtree
-
-let _ = Odoc_args.bytecode_mode := false
-
-
-let html_generator = new Odoc_html.html
-let default_latex_generator = new Odoc_latex.latex
-let default_texi_generator = new Odoc_texi.texi
-let default_man_generator = new Odoc_man.man
-let default_dot_generator = new Odoc_dot.dot
-let _ = Odoc_args.parse
-    (html_generator :> Odoc_args.doc_generator)
-    (default_latex_generator :> Odoc_args.doc_generator)
-    (default_texi_generator :> Odoc_args.doc_generator)
-    (default_man_generator :> Odoc_args.doc_generator)
-    (default_dot_generator :> Odoc_args.doc_generator)
-
-let loaded_modules =
-  List.flatten
-    (List.map
-       (fun f ->
-         Odoc_info.verbose (Odoc_messages.loading f);
-         try
-           let l = Odoc_analyse.load_modules f in
-           Odoc_info.verbose Odoc_messages.ok;
-           l
-         with Failure s ->
-           prerr_endline s ;
-           incr Odoc_global.errors ;
-           []
-       )
-       !Odoc_args.load
-    )
-
-let modules = Odoc_analyse.analyse_files ~init: loaded_modules !Odoc_args.files
-
-let _ =
-  match !Odoc_args.dump with
-    None -> ()
-  | Some f ->
-      try Odoc_analyse.dump_modules f modules
-      with Failure s ->
-        prerr_endline s ;
-        incr Odoc_global.errors
-
-let _ =
-  match !Odoc_args.doc_generator with
-    None ->
-      ()
-  | Some gen ->
-      Odoc_info.verbose Odoc_messages.generating_doc;
-      gen#generate modules;
-      Odoc_info.verbose Odoc_messages.ok
-
-let _ =
-  if !Odoc_global.errors > 0 then
-  (
-   prerr_endline (Odoc_messages.errors_occured !Odoc_global.errors) ;
-   exit 1
-  )
-  else
-    exit 0
index 68fd200a2bd193c2082cf5cf79a62f71bee9f917..71fe0ba14f4d25fc2bd8137516151c9d9693de16 100644 (file)
@@ -11,7 +11,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile,v 1.26 2007/11/06 15:16:56 frisch Exp $
+# $Id: Makefile,v 1.26.4.1 2009/03/31 11:33:25 xleroy Exp $
 
 # Makefile for the ndbm library
 
@@ -21,6 +21,7 @@ CAMLOBJS=dbm.cmo
 COBJS=cldbm.o
 EXTRACFLAGS=$(DBM_INCLUDES)
 LINKOPTS=$(DBM_LINK)
+LDOPTS=-ldopt "$(DBM_LINK)"
 
 include ../Makefile
 
index e2fe5f16e95779aea5463f651f356a46d883d229..5aec48c45fedf01c0675be1709ffb48c02caaead 100644 (file)
@@ -32,7 +32,7 @@ $(LIBNAME).cma: $(SUPPORT) ../Widgets.src
        $(MAKE) superclean
        cd ../labltk; $(MAKE)
        cd ../camltk; $(MAKE)
-       $(MKLIB) -ocamlc '$(CAMLC)' -o $(LIBNAME) \
+       $(MKLIB) -ocamlc '$(CAMLCB)' -o $(LIBNAME) \
           -I ../labltk -I ../camltk $(TKOBJS) \
           -ccopt "\"$(TK_LINK)\""
 
@@ -40,7 +40,7 @@ $(LIBNAME).cmxa: $(SUPPORT:.cmo=.cmx) ../Widgets.src
        $(MAKE) superclean
        cd ../labltk; $(MAKE) opt
        cd ../camltk; $(MAKE) opt
-       $(MKLIB) -ocamlopt '$(CAMLOPT)' -o $(LIBNAME) -oc $(LIBNAME) \
+       $(MKLIB) -ocamlopt '$(CAMLOPTB)' -o $(LIBNAME) -oc $(LIBNAME) \
           -I ../labltk -I ../camltk $(TKOBJS:.cmo=.cmx) \
           -ccopt "\"$(TK_LINK)\""
 
index 215804826e6549c94064731ff569d323f6a51fc2..56f6fd1377c705ab4ad74eca9f791b13fa6646c0 100644 (file)
@@ -13,8 +13,10 @@ INSTALLDIR=$(LIBDIR)/$(LIBNAME)
 ## Tools from the Objective Caml distribution
 
 CAMLRUN=$(TOPDIR)/boot/ocamlrun
-CAMLC=$(CAMLRUN) $(TOPDIR)/ocamlc -nostdlib -I $(TOPDIR)/stdlib 
-CAMLOPT=$(CAMLRUN) $(TOPDIR)/ocamlopt -nostdlib -I $(TOPDIR)/stdlib 
+CAMLC=$(TOPDIR)/ocamlcomp.sh
+CAMLOPT=$(TOPDIR)/ocamlcompopt.sh
+CAMLCB=$(CAMLRUN) $(TOPDIR)/ocamlc
+CAMLOPTB=$(CAMLRUN) $(TOPDIR)/ocamlopt
 CAMLCOMP=$(CAMLC) -c -warn-error A
 CAMLYACC=$(TOPDIR)/boot/ocamlyacc -v
 CAMLLEX=$(CAMLRUN) $(TOPDIR)/boot/ocamllex
index 574069ea5cbfe29b3e1b38a386a05bb4cde04be2..c297438819ab4c4c4ef47e0ac09695bc6b490a53 100644 (file)
@@ -14,10 +14,10 @@ OBJS=tkanim.cmo
 COBJS= cltkaniminit.$(O) tkAnimGIF.$(O)
 
 tkanim.cma: $(OBJS)
-       $(MKLIB) -ocamlc '$(CAMLC)' -o tkanim $(OBJS)
+       $(MKLIB) -ocamlc '$(CAMLCB)' -o tkanim $(OBJS)
 
 tkanim.cmxa: $(OBJS:.cmo=.cmx)
-       $(MKLIB) -ocamlopt '$(CAMLOPT)' -o tkanim $(OBJS:.cmo=.cmx)
+       $(MKLIB) -ocamlopt '$(CAMLOPTB)' -o tkanim $(OBJS:.cmo=.cmx)
 
 libtkanim.$(A): $(COBJS)
        $(MKLIB) -o tkanim $(COBJS)
index dd8c33647f05cc15182f1e39736d18ee1ff6a198..8c47f7bc324375a51925fee5dea797c3b611c19c 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: big_int.ml,v 1.24 2008/08/03 09:04:40 xleroy Exp $ *)
+(* $Id: big_int.ml,v 1.24.2.1 2009/05/18 13:08:03 xleroy Exp $ *)
 
 open Int_misc
 open Nat
@@ -367,8 +367,8 @@ let big_int_of_int64 i =
       else if i > 0L then (1, i)
       else (-1, Int64.neg i) in
     let res = create_nat 2 in
-    set_digit_nat_native res 0 (Int64.to_nativeint i);
-    set_digit_nat_native res 1 (Int64.to_nativeint (Int64.shift_right i 32));
+    set_digit_nat_native res 0 (Int64.to_nativeint absi);
+    set_digit_nat_native res 1 (Int64.to_nativeint (Int64.shift_right absi 32));
     { sign = sg; abs_value = res }
   end
 
index f3080e5d1db483f74af21a8adf523f8a3bada7ab..c9026a3f82a2c5763caf0960146b6ec65e25527a 100644 (file)
@@ -750,6 +750,16 @@ test 2 eq_big_int
   (big_int_of_int64 9223372036854775807L, big_int_of_string "9223372036854775807");;
 test 3 eq_big_int
   (big_int_of_int64 (-9223372036854775808L), big_int_of_string "-9223372036854775808");;
+test 4 eq_big_int (*PR#4792*)
+  (big_int_of_int64 (Int64.of_int32 Int32.min_int), big_int_of_string "-2147483648");;
+test 5 eq_big_int
+  (big_int_of_int64 1234L, big_int_of_string "1234");;
+test 6 eq_big_int
+  (big_int_of_int64 0x1234567890ABCDEFL, big_int_of_string "1311768467294899695");;
+test 7 eq_big_int
+  (big_int_of_int64 (-1234L), big_int_of_string "-1234");;
+test 8 eq_big_int
+  (big_int_of_int64 (-0x1234567890ABCDEFL), big_int_of_string "-1311768467294899695");;
 
 testing_function "int64_of_big_int";;
 
index 1e1fb51e2b2dc4287e1a6baf369726ead034503e..a84535292dd809ee416defce4e9242c900da2d4c 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: str.ml,v 1.22 2008/08/01 12:27:13 xleroy Exp $ *)
+(* $Id: str.ml,v 1.22.2.1 2008/12/12 08:54:15 xleroy Exp $ *)
 
 (** String utilities *)
 
@@ -96,7 +96,7 @@ module Charset =
 type re_syntax =
     Char of char
   | String of string
-  | CharClass of Charset.t
+  | CharClass of Charset.t * bool  (* true = complemented, false = normal *)
   | Seq of re_syntax list
   | Alt of re_syntax * re_syntax
   | Star of re_syntax
@@ -156,7 +156,7 @@ let displ dest from = dest - from - 1
 let rec is_nullable = function
     Char c -> false
   | String s -> s = ""
-  | CharClass cl -> false
+  | CharClass(cl, cmpl) -> false
   | Seq rl -> List.for_all is_nullable rl
   | Alt (r1, r2) -> is_nullable r1 || is_nullable r2
   | Star r -> true
@@ -175,7 +175,7 @@ let rec is_nullable = function
 let rec first = function
     Char c -> Charset.singleton c
   | String s -> if s = "" then Charset.full else Charset.singleton s.[0]
-  | CharClass cl -> cl
+  | CharClass(cl, cmpl) -> if cmpl then Charset.complement cl else cl
   | Seq rl -> first_seq rl
   | Alt (r1, r2) -> Charset.union (first r1) (first r2)
   | Star r -> Charset.full
@@ -197,12 +197,13 @@ and first_seq = function
 (* Transform a Char or CharClass regexp into a character class *)
 
 let charclass_of_regexp fold_case re =
-  let cl =
+  let (cl1, compl) =
     match re with
-      Char c -> Charset.singleton c
-    | CharClass cl -> cl
+    | Char c -> (Charset.singleton c, false)
+    | CharClass(cl, compl) -> (cl, compl)
     | _ -> assert false in
-  if fold_case then Charset.fold_case cl else cl
+  let cl2 = if fold_case then Charset.fold_case cl1 else cl1 in
+  if compl then Charset.complement cl2 else cl2
 
 (* The case fold table: maps characters to their lowercase equivalent *)
 
@@ -289,9 +290,10 @@ let compile fold_case re =
           else
             emit_instr op_STRING (cpool_index s)
       end
-  | CharClass cl ->
-      let cl' = if fold_case then Charset.fold_case cl else cl in
-      emit_instr op_CHARCLASS (cpool_index cl')
+  | CharClass(cl, compl) ->
+      let cl1 = if fold_case then Charset.fold_case cl else cl in
+      let cl2 = if compl then Charset.complement cl1 else cl1 in
+      emit_instr op_CHARCLASS (cpool_index cl2)
   | Seq rl ->
       emit_seq_code rl
   | Alt(r1, r2) ->
@@ -492,10 +494,11 @@ let parse s =
   and regexp3 i =
     match s.[i] with
       '\\' -> regexpbackslash (i+1)
-    | '['  -> let (c, j) = regexpclass0 (i+1) in (CharClass c, j)
+    | '['  -> let (c, compl, j) = regexpclass0 (i+1) in
+              (CharClass(c, compl), j)
     | '^'  -> (Bol, i+1)
     | '$'  -> (Eol, i+1)
-    | '.'  -> (CharClass dotclass, i+1)
+    | '.'  -> (CharClass(dotclass, false), i+1)
     | c    -> (Char c, i+1)
   and regexpbackslash i =
     if i >= len then (Char '\\', i) else
@@ -520,8 +523,8 @@ let parse s =
           (Char c, i + 1)
   and regexpclass0 i =
     if i < len && s.[i] = '^'
-    then let (c, j) = regexpclass1 (i+1) in (Charset.complement c, j)
-    else regexpclass1 i
+    then let (c, j) = regexpclass1 (i+1) in (c, true, j)
+    else let (c, j) = regexpclass1 i in (c, false, j)
   and regexpclass1 i =
     let c = Charset.make_empty() in
     let j = regexpclass2 c i i in
index 4a94dc6718e1d1722e7ed781efe26e39e887df92..89a0b524088937bcf3c2e054b69e20a91f1d43ed 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: posix.c,v 1.58 2008/09/27 10:46:55 xleroy Exp $ */
+/* $Id: posix.c,v 1.58.2.2 2009/03/28 17:35:59 xleroy Exp $ */
 
 /* Thread interface for POSIX 1003.1c threads */
 
@@ -111,6 +111,9 @@ static pthread_mutex_t caml_runtime_mutex = PTHREAD_MUTEX_INITIALIZER;
 /* Condition signaled when caml_runtime_busy becomes 0 */
 static pthread_cond_t caml_runtime_is_free = PTHREAD_COND_INITIALIZER;
 
+/* Whether the ``tick'' thread is already running */
+static int caml_tick_thread_running = 0;
+
 /* The key used for storing the thread descriptor in the specific data
    of the corresponding Posix thread. */
 static pthread_key_t thread_descriptor_key;
@@ -332,8 +335,6 @@ static void * caml_thread_tick(void * arg)
 static void caml_thread_reinitialize(void)
 {
   caml_thread_t thr, next;
-  pthread_t tick_pthread;
-  pthread_attr_t attr;
   struct channel * chan;
 
   /* Remove all other threads (now nonexistent)
@@ -353,24 +354,21 @@ static void caml_thread_reinitialize(void)
   pthread_cond_init(&caml_runtime_is_free, NULL);
   caml_runtime_waiters = 0;     /* no other thread is waiting for the RTS */
   caml_runtime_busy = 1;        /* normally useless */
+  /* Tick thread is not currently running in child process, will be
+     re-created at next Thread.create */
+  caml_tick_thread_running = 0;
   /* Reinitialize all IO mutexes */
   for (chan = caml_all_opened_channels;
        chan != NULL;
        chan = chan->next) {
     if (chan->mutex != NULL) pthread_mutex_init(chan->mutex, NULL);
   }
-  /* Fork a new tick thread */
-  pthread_attr_init(&attr);
-  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-  pthread_create(&tick_pthread, &attr, caml_thread_tick, NULL);
 }
 
 /* Initialize the thread machinery */
 
 value caml_thread_initialize(value unit)   /* ML */
 {
-  pthread_t tick_pthread;
-  pthread_attr_t attr;
   value mu = Val_unit;
   value descr;
 
@@ -395,6 +393,7 @@ value caml_thread_initialize(value unit)   /* ML */
     curr_thread->descr = descr;
     curr_thread->next = curr_thread;
     curr_thread->prev = curr_thread;
+    curr_thread->backtrace_last_exn = Val_unit;
 #ifdef NATIVE_CODE
     curr_thread->exit_buf = &caml_termination_jmpbuf;
 #endif
@@ -415,12 +414,6 @@ value caml_thread_initialize(value unit)   /* ML */
     caml_channel_mutex_lock = caml_io_mutex_lock;
     caml_channel_mutex_unlock = caml_io_mutex_unlock;
     caml_channel_mutex_unlock_exn = caml_io_mutex_unlock_exn;
-    /* Fork the tick thread */
-    pthread_attr_init(&attr);
-    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-    caml_pthread_check(
-        pthread_create(&tick_pthread, &attr, caml_thread_tick, NULL),
-        "Thread.init");
     /* Set up fork() to reinitialize the thread machinery in the child
        (PR#4577) */
     pthread_atfork(NULL, NULL, caml_thread_reinitialize);
@@ -488,6 +481,7 @@ value caml_thread_new(value clos)          /* ML */
 {
   pthread_attr_t attr;
   caml_thread_t th;
+  pthread_t tick_pthread;
   value mu = Val_unit;
   value descr;
   int err;
@@ -526,12 +520,12 @@ value caml_thread_new(value clos)          /* ML */
     th->prev = curr_thread;
     curr_thread->next->prev = th;
     curr_thread->next = th;
-    /* Fork the new thread */
+    /* Create the new thread */
     pthread_attr_init(&attr);
     pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
     err = pthread_create(&th->pthread, &attr, caml_thread_start, (void *) th);
     if (err != 0) {
-      /* Fork failed, remove thread info block from list of threads */
+      /* Creation failed, remove thread info block from list of threads */
       th->next->prev = curr_thread;
       curr_thread->next = th->next;
 #ifndef NATIVE_CODE
@@ -541,6 +535,16 @@ value caml_thread_new(value clos)          /* ML */
       caml_pthread_check(err, "Thread.create");
     }
   End_roots();
+  /* Create the tick thread if not already done.  
+     Because of PR#4666, we start the tick thread late, only when we create
+     the first additional thread in the current process*/
+  if (! caml_tick_thread_running) {
+    caml_tick_thread_running = 1;
+    pthread_attr_init(&attr);
+    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+    err = pthread_create(&tick_pthread, &attr, caml_thread_tick, NULL);
+    caml_pthread_check(err, "Thread.create");
+  }
   return descr;
 }
 
index 851c4f8552f82435d885ed362dc613311fa311a7..26d08a22bd65590e1f39f34bdd29dedb06674e7e 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: unix.mli,v 1.89 2008/09/04 13:53:43 doligez Exp $ *)
+(* $Id: unix.mli,v 1.89.2.1 2009/03/28 16:58:56 xleroy Exp $ *)
 
 (** Interface to the Unix system *)
 
@@ -900,7 +900,8 @@ type socket_domain =
     PF_UNIX                     (** Unix domain *)
   | PF_INET                     (** Internet domain (IPv4) *)
   | PF_INET6                    (** Internet domain (IPv6) *)
-(** The type of socket domains. *)
+(** The type of socket domains.  Not all platforms support
+    IPv6 sockets (type [PF_INET6]).  *)
 
 type socket_type =
     SOCK_STREAM                 (** Stream socket *)
index 5fe65256cb0b9b553e3e9e04d77c5a45dea98585..9a7ced3c08cabf9a21e5b04d20ddefd9decfa39c 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: pipe.c,v 1.7 2001/12/07 13:40:45 xleroy Exp $ */
+/* $Id: pipe.c,v 1.7.28.1 2009/03/28 15:30:08 xleroy Exp $ */
 
 #include <mlvalues.h>
 #include <memory.h>
@@ -19,7 +19,8 @@
 #include "unixsupport.h"
 #include <fcntl.h>
 
-#define SIZEBUF 1024
+/* PR#4749: pick a size that matches that of I/O buffers */
+#define SIZEBUF 4096
 
 CAMLprim value unix_pipe(value unit)
 {
index d9a6e461c7c2d34cbdf37c5152f02981511107e9..d5f9b52fe04ddabe698a67d6b5e4710e2170d71d 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: stat.c,v 1.3 2006/09/21 13:57:34 xleroy Exp $ */
+/* $Id: stat.c,v 1.3.14.1 2009/03/28 16:39:50 xleroy Exp $ */
 
 #include <errno.h>
 #include <mlvalues.h>
@@ -107,9 +107,5 @@ CAMLprim value unix_fstat_64(value handle)
 
   ret = _fstati64(win_CRT_fd_of_filedescr(handle), &buf);
   if (ret == -1) uerror("fstat", Nothing);
-  if (buf.st_size > Max_long) {
-    win32_maperr(ERROR_ARITHMETIC_OVERFLOW);
-    uerror("fstat", Nothing);
-  }
   return stat_aux(1, &buf);
 }
index ae2d527de3c05920a7138616669994e15bb1f757..792b424fe5457127bd514b4f8286fc45a9951b5c 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: unixsupport.c,v 1.21 2007/02/07 14:45:46 doligez Exp $ */
+/* $Id: unixsupport.c,v 1.21.12.1 2009/05/19 12:32:36 xleroy Exp $ */
 
 #include <stddef.h>
 #include <mlvalues.h>
@@ -108,6 +108,7 @@ static struct error_entry win_error_table[] = {
   { ERROR_NO_PROC_SLOTS, 0, EAGAIN},
   { ERROR_DRIVE_LOCKED, 0, EACCES},
   { ERROR_BROKEN_PIPE, 0, EPIPE},
+  { ERROR_NO_DATA, 0, EPIPE},
   { ERROR_DISK_FULL, 0, ENOSPC},
   { ERROR_INVALID_TARGET_HANDLE, 0, EBADF},
   { ERROR_INVALID_HANDLE, 0, EINVAL},
index 6f4128c57ffc4c1635cb98adcab69d20f58e14c8..1a41375eb96e13be1eb41cb2c8fdee5dc2bb862a 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: format.ml,v 1.74 2008/09/08 12:30:19 weis Exp $ *)
+(* $Id: format.ml,v 1.74.2.1 2009/04/29 18:33:31 weis Exp $ *)
 
 (* A pretty-printing facility and definition of formatters for ``parallel''
    (i.e. unrelated or independent) pretty-printing on multiple out channels. *)
@@ -1040,9 +1040,9 @@ let get_buffer_out b =
   s
 ;;
 
-(* [ppf] is supposed to be a pretty-printer that outputs in buffer [b]:
-   to extract contents of [ppf] as a string we flush [ppf] and get the string
-   out of [b]. *)
+(* [ppf] is supposed to be a pretty-printer that outputs to buffer [b]:
+   to extract the contents of [ppf] as a string we flush [ppf] and get the
+   string out of [b]. *)
 let string_out b ppf =
   pp_flush_queue ppf false;
   get_buffer_out b
@@ -1311,7 +1311,10 @@ let kbprintf k b =
   mkprintf false (fun _ -> formatter_of_buffer b) k
 ;;
 
-let bprintf b = kbprintf ignore b;;
+let bprintf b =
+  let k ppf = pp_flush_queue ppf false in
+  kbprintf k b
+;;
 
 let ksprintf k =
   let b = Buffer.create 512 in
index fe0893cd51c02887e81385400a968b9d578c7752..877b0f9ec31f75a14b1caa1c406b560783cdea08 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: map.mli,v 1.33 2005/10/25 18:34:07 doligez Exp $ *)
+(* $Id: map.mli,v 1.33.18.1 2009/03/21 16:35:48 xleroy Exp $ *)
 
 (** Association tables over ordered types.
 
@@ -73,9 +73,7 @@ module type S =
     (** [iter f m] applies [f] to all bindings in map [m].
        [f] receives the key as first argument, and the associated value
        as second argument.  The bindings are passed to [f] in increasing
-       order with respect to the ordering over the type of the keys.
-       Only current bindings are presented to [f]:
-       bindings hidden by more recent bindings are not passed to [f]. *)
+       order with respect to the ordering over the type of the keys. *)
 
     val map: ('a -> 'b) -> 'a t -> 'b t
     (** [map f m] returns a map with same domain as [m], where the
index 1f048c7643001999b776e208cdc198c8d055ae7b..476a04da6b01ddf2d00959f38e0e5f15a671c0d6 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: parsing.ml,v 1.19 2008/08/06 09:38:21 xleroy Exp $ *)
+(* $Id: parsing.ml,v 1.19.2.1 2009/01/13 15:17:51 doligez Exp $ *)
 
 (* The parsing engine *)
 
@@ -180,9 +180,15 @@ let peek_val env n =
   Obj.magic env.v_stack.(env.asp - n)
 
 let symbol_start_pos () =
-  if env.rule_len > 0
-  then env.symb_start_stack.(env.asp - env.rule_len + 1)
-  else env.symb_end_stack.(env.asp)
+  let rec loop i =
+    if i <= 0 then env.symb_end_stack.(env.asp)
+    else begin
+      let st = env.symb_start_stack.(env.asp - i + 1) in
+      let en = env.symb_end_stack.(env.asp - i + 1) in
+      if st <> en then st else loop (i - 1)
+    end
+  in
+  loop env.rule_len
 ;;
 let symbol_end_pos () = env.symb_end_stack.(env.asp);;
 let rhs_start_pos n = env.symb_start_stack.(env.asp - (env.rule_len - n));;
index e2699a755003ec769a8765873a547de64af83984..935db8de8ac91a82ae64a11f13c2bbd55cf08e23 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: pervasives.mli,v 1.113 2008/10/06 13:33:21 doligez Exp $ *)
+(* $Id: pervasives.mli,v 1.113.2.2 2009/04/30 09:05:57 weis Exp $ *)
 
 (** The initially opened module.
 
@@ -24,6 +24,7 @@
    name, without prefixing them by [Pervasives].
 *)
 
+
 (** {6 Exceptions} *)
 
 external raise : exn -> 'a = "%raise"
@@ -42,7 +43,6 @@ exception Exit
 
 (** {6 Comparisons} *)
 
-
 external ( = ) : 'a -> 'a -> bool = "%equal"
 (** [e1 = e2] tests for structural equality of [e1] and [e2].
    Mutable structures (e.g. references and arrays) are equal
@@ -100,8 +100,7 @@ val max : 'a -> 'a -> 'a
 
 external ( == ) : 'a -> 'a -> bool = "%eq"
 (** [e1 == e2] tests for physical equality of [e1] and [e2].
-   On integers and characters, physical equality is identical to structural
-   equality. On mutable structures, [e1 == e2] is true if and only if
+   On mutable structures, [e1 == e2] is true if and only if
    physical modification of [e1] also affects [e2].
    On non-mutable structures, the behavior of [(==)] is
    implementation-dependent; however, it is guaranteed that
@@ -113,7 +112,6 @@ external ( != ) : 'a -> 'a -> bool = "%noteq"
 
 (** {6 Boolean operations} *)
 
-
 external not : bool -> bool = "%boolnot"
 (** The boolean negation. *)
 
@@ -186,10 +184,8 @@ val min_int : int
 (** The smallest representable integer. *)
 
 
-
 (** {7 Bitwise operations} *)
 
-
 external ( land ) : int -> int -> int = "%andint"
 (** Bitwise logical and. *)
 
@@ -250,10 +246,10 @@ external ( /. ) : float -> float -> float = "%divfloat"
 (** Floating-point division. *)
 
 external ( ** ) : float -> float -> float = "caml_power_float" "pow" "float"
-(** Exponentiation *)
+(** Exponentiation. *)
 
 external sqrt : float -> float = "caml_sqrt_float" "sqrt" "float"
-(** Square root *)
+(** Square root. *)
 
 external exp : float -> float = "caml_exp_float" "exp" "float"
 (** Exponential. *)
@@ -265,47 +261,57 @@ external log10 : float -> float = "caml_log10_float" "log10" "float"
 (** Base 10 logarithm. *)
 
 external cos : float -> float = "caml_cos_float" "cos" "float"
-(** See {!Pervasives.atan2}. *)
+(** [cos a] returns the cosine of angle [a] measured in radians. *)
 
 external sin : float -> float = "caml_sin_float" "sin" "float"
-(** See {!Pervasives.atan2}. *)
+(** [sin a] returns the sine of angle [a] measured in radians. *)
 
 external tan : float -> float = "caml_tan_float" "tan" "float"
-(** See {!Pervasives.atan2}. *)
+(** [tan a] returns the tangent of angle [a] measured in radians. *)
 
 external acos : float -> float = "caml_acos_float" "acos" "float"
-(** See {!Pervasives.atan2}. *)
+(** [acos f] returns the arc cosine of [f]. The return angle is measured
+    in radians. *)
 
 external asin : float -> float = "caml_asin_float" "asin" "float"
-(** See {!Pervasives.atan2}. *)
+(** [asin f] returns the arc sine of [f]. The return angle is measured
+    in radians. *)
 
 external atan : float -> float = "caml_atan_float" "atan" "float"
-(** See {!Pervasives.atan2}. *)
+(** [atan f] returns the arc tangent of [f]. The return angle is measured
+    in radians. *)
 
 external atan2 : float -> float -> float = "caml_atan2_float" "atan2" "float"
-(** The usual trigonometric functions. *)
+(** [atan2 y x] returns the principal value of the arc tangent of
+     [y / x], using the signs of both arguments to determine the quadrant of the
+     result. The return angle is measured in radians. *)
 
 external cosh : float -> float = "caml_cosh_float" "cosh" "float"
-(** See {!Pervasives.tanh}. *)
+(** [cosh a] returns the hyperbolic cosine of angle [a] measured
+    in radians. *)
 
 external sinh : float -> float = "caml_sinh_float" "sinh" "float"
-(** See {!Pervasives.tanh}. *)
+(** [sinh a] returns the hyperbolic sine of angle [a] measured
+    in radians. *)
 
 external tanh : float -> float = "caml_tanh_float" "tanh" "float"
-(** The usual hyperbolic trigonometric functions. *)
+(** [tanh f] returns the hyperbolic tangent of angle [a] measured
+    in radians. *)
 
 external ceil : float -> float = "caml_ceil_float" "ceil" "float"
-(** See {!Pervasives.floor}. *)
+(** Round the given float to an integer value.
+   [ceil f] returns the least integer value greater than or
+   equal to [f].
+   See also {!Pervasives.floor}. *)
 
 external floor : float -> float = "caml_floor_float" "floor" "float"
 (** Round the given float to an integer value.
    [floor f] returns the greatest integer value less than or
    equal to [f].
-   [ceil f] returns the least integer value greater than or
-   equal to [f]. *)
+   See also {!Pervasives.ceil}. *)
 
 external abs_float : float -> float = "%absfloat"
-(** Return the absolute value of the argument. *)
+(** [abs_float f] returns the absolute value of [f]. *)
 
 external mod_float : float -> float -> float = "caml_fmod_float" "fmod" "float"
 (** [mod_float a b] returns the remainder of [a] with respect to
@@ -442,7 +448,6 @@ external float_of_string : string -> float = "caml_float_of_string"
    if the given string is not a valid representation of a float. *)
 
 
-
 (** {6 Pair operations} *)
 
 external fst : 'a * 'b -> 'a = "%field0"
@@ -544,8 +549,8 @@ val read_float : unit -> float
    The result is unspecified if the line read is not a valid
    representation of a floating-point number. *)
 
-(** {7 General output functions} *)
 
+(** {7 General output functions} *)
 
 type open_flag =
     Open_rdonly      (** open for reading. *)
@@ -771,6 +776,7 @@ val set_binary_mode_in : in_channel -> bool -> unit
    This function has no effect under operating systems that
    do not distinguish between text mode and binary mode. *)
 
+
 (** {7 Operations on large files} *)
 
 module LargeFile :
@@ -789,6 +795,7 @@ module LargeFile :
   regular integers (type [int]), these alternate functions allow
   operating on files whose sizes are greater than [max_int]. *)
 
+
 (** {6 References} *)
 
 type 'a ref = { mutable contents : 'a }
@@ -853,7 +860,6 @@ val ( ^^ ) :
 
 (** {6 Program termination} *)
 
-
 val exit : int -> 'a
 (** Terminate the process, returning the given status code
    to the operating system: usually 0 to indicate no errors,
index b6e4c2dd7584a451a3de0e999f3e4aa15a455f99..920afdb44f2a44ef1755ef1f6150a0a28283ee6b 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: printf.ml,v 1.58 2008/09/27 20:50:01 weis Exp $ *)
+(* $Id: printf.ml,v 1.58.2.2 2009/04/29 19:02:05 weis Exp $ *)
 
 external format_float: string -> float -> string
   = "caml_format_float"
@@ -142,7 +142,8 @@ let extract_format fmt start stop widths =
       | ('*', []) ->
         assert false (* should not happen *)
       | (c, _) ->
-        Buffer.add_char b c; fill_format (succ i) widths in
+        Buffer.add_char b c;
+        fill_format (succ i) widths in
   fill_format start (List.rev widths);
   Buffer.contents b
 ;;
@@ -156,6 +157,15 @@ let extract_format_int conv fmt start stop widths =
    | _ -> sfmt
 ;;
 
+let extract_format_float conv fmt start stop widths =
+   let sfmt = extract_format fmt start stop widths in
+   match conv with
+   | 'F' ->
+     sfmt.[String.length sfmt - 1] <- 'f';
+     sfmt
+   | _ -> sfmt
+;;
+
 (* Returns the position of the next character following the meta format
    string, starting from position [i], inside a given format [fmt].
    According to the character [conv], the meta format string is
@@ -297,7 +307,7 @@ let ac_of_format fmt =
 
 let count_arguments_of_format fmt =
   let ac = ac_of_format fmt in
-  ac.ac_rglr + ac.ac_skip + ac.ac_rdrs
+  ac.ac_rglr
 ;;
 
 let list_iter_i f l =
@@ -417,6 +427,31 @@ let get_index spec n =
   | Spec_index p -> p
 ;;
 
+(* Format a float argument as a valid Caml lexem. *)
+let format_float_lexem =
+  let valid_float_lexem sfmt s =
+    let l = String.length s in
+    if l = 0 then "nan" else
+      let add_dot sfmt s =
+        if s.[0] = ' ' || s.[0] = '+' || s.[0] = '0'
+        then String.sub s 1 (l - 1) ^ "."
+        else String.sub s 0 (l - 1) ^ "." in
+
+      let rec loop i =
+        if i >= l then add_dot sfmt s else
+        match s.[i] with
+        | '.' -> s
+        | _ -> loop (i + 1) in
+
+      loop 0 in
+
+   (fun sfmt x ->
+    let s = format_float sfmt x in
+    match classify_float x with
+    | FP_normal | FP_subnormal | FP_zero -> valid_float_lexem sfmt s
+    | FP_nan | FP_infinite -> s)
+;;
+
 (* Decode a format string and act on it.
    [fmt] is the [printf] format string, and [pos] points to a [%] character in
    the format string.
@@ -485,9 +520,11 @@ let scan_format fmt args n pos cont_s cont_a cont_t cont_f cont_m =
       let (x : float) = get_arg spec n in
       let s = format_float (extract_format fmt pos i widths) x in
       cont_s (next_index spec n) s (succ i)
-    | 'F' ->
+    | 'F' as conv ->
       let (x : float) = get_arg spec n in
-      cont_s (next_index spec n) (string_of_float x) (succ i)
+      let s =
+        format_float_lexem (extract_format_float conv fmt pos i widths) x in
+      cont_s (next_index spec n) s (succ i)
     | 'B' | 'b' ->
       let (x : bool) = get_arg spec n in
       cont_s (next_index spec n) (string_of_bool x) (succ i)
index 0d6b637ac82fb0425f921b029b4ea4c857a475a3..7ec4f83dc4087a117d0a95e2e9aa6d2f200f8ee1 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: scanf.ml,v 1.80 2008/09/27 20:45:05 weis Exp $ *)
+(* $Id: scanf.ml,v 1.80.2.2 2009/04/29 18:27:37 weis Exp $ *)
 
 (* The run-time library for scanners. *)
 
@@ -782,8 +782,7 @@ let scan_String max ib =
     | '\n', true
     | ' ', false ->
       skip_spaces false (Scanning.ignore_char ib max)
-    | '\\', false -> loop false max
-    | c, false -> loop false (Scanning.store_char ib c max)
+    | c, false -> loop false max
     | _, _ -> loop false (scan_backslash_char (max - 1) ib) in
   loop true max
 ;;
@@ -1272,22 +1271,29 @@ let scanf fmt = bscanf Scanning.stdib fmt;;
 
 let bscanf_format ib fmt f =
   let fmt = Sformat.unsafe_to_string fmt in
-  let fmt1 = ignore (scan_String max_int ib); token_string ib in
+  let fmt1 =
+    ignore (scan_String max_int ib);
+    token_string ib in
   if not (compatible_format_type fmt1 fmt) then
     format_mismatch fmt1 fmt else
   f (string_to_format fmt1)
 ;;
 
-let sscanf_format s fmt f = bscanf_format (Scanning.from_string s) fmt f;;
+let sscanf_format s fmt = bscanf_format (Scanning.from_string s) fmt;;
 
-let quote_string s =
-  let b = Buffer.create (String.length s + 2) in
+let string_to_String s =
+  let l = String.length s in
+  let b = Buffer.create (l + 2) in
   Buffer.add_char b '\"';
-  Buffer.add_string b s;
+  for i = 0 to l - 1 do
+    let c = s.[i] in
+    if c = '\"' then Buffer.add_char b '\\';
+    Buffer.add_char b c;
+  done;
   Buffer.add_char b '\"';
   Buffer.contents b
 ;;
 
 let format_from_string s fmt =
-  sscanf_format (quote_string s) fmt (fun x -> x)
+  sscanf_format (string_to_String s) fmt (fun x -> x)
 ;;
index eb6ec2c855815a521e1a37cdea36e0fe8eaad00d..d84f765c4bb1d6e44dd975c80f7eb5219bd1e5b3 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ctype.ml,v 1.216.2.1 2008/10/08 13:07:13 doligez Exp $ *)
+(* $Id: ctype.ml,v 1.216.2.5 2009/05/19 05:51:03 garrigue Exp $ *)
 
 (* Operations on core types *)
 
@@ -385,23 +385,32 @@ let closed_schema ty =
 exception Non_closed of type_expr * bool
 
 let free_variables = ref []
+let really_closed = ref None
 
 let rec free_vars_rec real ty =
   let ty = repr ty in
   if ty.level >= lowest_level then begin
     ty.level <- pivot_level - ty.level;
-    begin match ty.desc with
-      Tvar ->
+    begin match ty.desc, !really_closed with
+      Tvar, _ ->
         free_variables := (ty, real) :: !free_variables
+    | Tconstr (path, tl, _), Some env ->
+        begin try
+          let (_, body) = Env.find_type_expansion path env in
+          if (repr body).level <> generic_level then
+            free_variables := (ty, real) :: !free_variables
+        with Not_found -> ()
+        end;
+        List.iter (free_vars_rec true) tl
 (* Do not count "virtual" free variables
     | Tobject(ty, {contents = Some (_, p)}) ->
         free_vars_rec false ty; List.iter (free_vars_rec true) p
 *)
-    | Tobject (ty, _) ->
+    | Tobject (ty, _), _ ->
         free_vars_rec false ty
-    | Tfield (_, _, ty1, ty2) ->
+    | Tfield (_, _, ty1, ty2), _ ->
         free_vars_rec true ty1; free_vars_rec false ty2
-    | Tvariant row ->
+    | Tvariant row, _ ->
         let row = row_repr row in
         iter_row (free_vars_rec true) row;
         if not (static_row row) then free_vars_rec false row.row_more
@@ -410,15 +419,17 @@ let rec free_vars_rec real ty =
     end;
   end
 
-let free_vars ty =
+let free_vars ?env ty =
   free_variables := [];
+  really_closed := env;
   free_vars_rec true ty;
   let res = !free_variables in
   free_variables := [];
+  really_closed := None;
   res
 
-let free_variables ty =
-  let tl = List.map fst (free_vars ty) in
+let free_variables ?env ty =
+  let tl = List.map fst (free_vars ?env ty) in
   unmark_type ty;
   tl
 
@@ -2030,7 +2041,7 @@ let rec moregen inst_nongen type_pairs env t1 t2 =
         with Not_found ->
           TypePairs.add type_pairs (t1', t2') ();
           match (t1'.desc, t2'.desc) with
-            (Tvar, _) when may_instantiate inst_nongen t1 ->
+            (Tvar, _) when may_instantiate inst_nongen t1' ->
               moregen_occur env t1'.level t2;
               link_type t1' t2
           | (Tarrow (l1, t1, u1, _), Tarrow (l2, t2, u2, _)) when l1 = l2
@@ -3172,10 +3183,11 @@ let cyclic_abbrev env id ty =
   in check_cycle [] ty
 
 (* Normalize a type before printing, saving... *)
-let rec normalize_type_rec env ty =
+(* Cannot use mark_type because deep_occur uses it too *)
+let rec normalize_type_rec env visited ty =
   let ty = repr ty in
-  if ty.level >= lowest_level then begin
-    mark_type_node ty;
+  if not (TypeSet.mem ty !visited) then begin
+    visited := TypeSet.add ty !visited;
     begin match ty.desc with
     | Tvariant row ->
       let row = row_repr row in
@@ -3204,11 +3216,15 @@ let rec normalize_type_rec env ty =
         begin match !nm with
         | None -> ()
         | Some (n, v :: l) ->
-            let v' = repr v in
+           if deep_occur ty (newgenty (Ttuple l)) then
+             (* The abbreviation may be hiding something, so remove it *)
+             set_name nm None
+           else let v' = repr v in
             begin match v'.desc with
             | Tvar|Tunivar ->
                 if v' != v then set_name nm (Some (n, v' :: l))
-            | Tnil -> log_type ty; ty.desc <- Tconstr (n, l, ref Mnil)
+            | Tnil ->
+               log_type ty; ty.desc <- Tconstr (n, l, ref Mnil)
             | _ -> set_name nm None
             end
         | _ ->
@@ -3221,12 +3237,11 @@ let rec normalize_type_rec env ty =
         log_type ty; fi.desc <- fi'.desc
     | _ -> ()
     end;
-    iter_type_expr (normalize_type_rec env) ty
+    iter_type_expr (normalize_type_rec env visited) ty
   end
 
 let normalize_type env ty =
-  normalize_type_rec env ty;
-  unmark_type ty
+  normalize_type_rec env (ref TypeSet.empty) ty
 
 
                               (*************************)
@@ -3267,8 +3282,8 @@ let rec nondep_type_rec env id ty =
                  (recursive type), so one cannot just take its
                  description.
                *)
-            with Cannot_expand ->
-              raise Not_found
+            with Cannot_expand | Unify _ -> (* expand_abbrev failed *)
+              raise Not_found               (* cf. PR4775 for Unify *)
             end
           else
             Tconstr(p, List.map (nondep_type_rec env id) tl, ref Mnil)
index d8c3d60fdc7f3120f1da915be5fd1026897118ca..9444d820cb477468a15671060959f3b4dbe297e9 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ctype.mli,v 1.55.4.1 2008/10/16 03:05:26 garrigue Exp $ *)
+(* $Id: ctype.mli,v 1.55.4.2 2009/02/13 05:05:36 garrigue Exp $ *)
 
 (* Operations on core types *)
 
@@ -224,7 +224,8 @@ val closed_schema: type_expr -> bool
         (* Check whether the given type scheme contains no non-generic
            type variables *)
 
-val free_variables: type_expr -> type_expr list
+val free_variables: ?env:Env.t -> type_expr -> type_expr list
+        (* If env present, then check for incomplete definitions too *)
 val closed_type_decl: type_declaration -> type_expr option
 type closed_class_failure =
     CC_Method of type_expr * bool * string * type_expr
index 508ea1e48131e75c35b89eb698dc71ae3d472312..06c0ec69462bcdddbf1576f707670951b3d7a12a 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: env.ml,v 1.66 2008/10/06 13:53:54 doligez Exp $ *)
+(* $Id: env.ml,v 1.66.2.1 2009/04/28 05:11:54 garrigue Exp $ *)
 
 (* Environment handling *)
 
@@ -92,19 +92,29 @@ let empty = {
   cltypes = Ident.empty;
   summary = Env_empty }
 
-let diff_keys tbl1 tbl2 =
+let diff_keys is_local tbl1 tbl2 =
   let keys2 = Ident.keys tbl2 in
   List.filter
     (fun id ->
-      match Ident.find_same id tbl2 with Pident _, _ ->
-        (try ignore (Ident.find_same id tbl1); false with Not_found -> true)
-      | _ -> false)
+      is_local (Ident.find_same id tbl2) &&
+      try ignore (Ident.find_same id tbl1); false with Not_found -> true)
     keys2
 
+let is_ident = function
+    Pident _ -> true
+  | Pdot _ | Papply _ -> false
+
+let is_local (p, _) = is_ident p
+
+let is_local_exn = function
+    {cstr_tag = Cstr_exception p} -> is_ident p
+  | _ -> false
+
 let diff env1 env2 =
-  diff_keys env1.values env2.values @
-  diff_keys env1.modules env2.modules @
-  diff_keys env1.classes env2.classes
+  diff_keys is_local env1.values env2.values @
+  diff_keys is_local_exn env1.constrs env2.constrs @
+  diff_keys is_local env1.modules env2.modules @
+  diff_keys is_local env1.classes env2.classes
 
 (* Forward declarations *)
 
index 452e72767c53cc484e86f1f7b2d999cd92ffd494..2f06f12224963fc39e529bda54bab055d6e20ac2 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: includeclass.ml,v 1.8 2006/04/05 02:28:13 garrigue Exp $ *)
+(* $Id: includeclass.ml,v 1.8.16.1 2009/04/19 08:42:43 xleroy Exp $ *)
 
 (* Inclusion checks for the class language *)
 
@@ -47,7 +47,7 @@ let include_err ppf =
       fprintf ppf "@[%a@]"
       (Printtyp.unification_error false trace
         (function ppf ->
-          fprintf ppf "One type parameter has type"))
+          fprintf ppf "A type parameter has type"))
         (function ppf ->
           fprintf ppf "but is expected to have type")
   | CM_Class_type_mismatch (cty1, cty2) ->
@@ -58,7 +58,7 @@ let include_err ppf =
       fprintf ppf "@[%a@]"
       (Printtyp.unification_error false trace
         (function ppf ->
-          fprintf ppf "One parameter has type"))
+          fprintf ppf "A parameter has type"))
         (function ppf ->
           fprintf ppf "but is expected to have type")
   | CM_Val_type_mismatch (lab, trace) ->
@@ -92,7 +92,7 @@ let include_err ppf =
   | CM_Public_method lab ->
       fprintf ppf "@[The public method %s cannot become private" lab
   | CM_Virtual_method lab ->
-      fprintf ppf "@[The virtual method %s  cannot become concrete" lab
+      fprintf ppf "@[The virtual method %s cannot become concrete" lab
   | CM_Private_method lab ->
       fprintf ppf "The private method %s cannot become public" lab
 
index 7ea21eb2a8cbdbabd7d1d16443eaa8a9e1d51ee0..48e9821bef7fd0cec06f7dd3e44416ca1175f0e7 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: parmatch.ml,v 1.76 2008/07/15 18:11:46 mauny Exp $ *)
+(* $Id: parmatch.ml,v 1.76.2.2 2009/03/16 04:24:05 garrigue Exp $ *)
 
 (* Detection of partial matches and unused match cases. *)
 
@@ -113,13 +113,18 @@ and compats ps qs = match ps,qs with
 
 exception Empty (* Empty pattern *)
 
+(* May need a clean copy, cf. PR#4745 *)
+let clean_copy ty =
+  if ty.level = Btype.generic_level then ty
+  else Subst.type_expr Subst.identity ty
+
 let get_type_path ty tenv =
-  let ty = Ctype.repr (Ctype.expand_head tenv ty) in
+  let ty = Ctype.repr (Ctype.expand_head tenv (clean_copy ty)) in
   match ty.desc with
   | Tconstr (path,_,_) -> path
   | _ -> fatal_error "Parmatch.get_type_path"
 
-let get_type_descr ty tenv =
+let rec get_type_descr ty tenv =
   match (Ctype.repr ty).desc with
   | Tconstr (path,_,_) -> Env.find_type path tenv
   | _ -> fatal_error "Parmatch.get_type_descr"
@@ -129,7 +134,7 @@ let rec get_constr tag ty tenv =
   | {type_kind=Type_variant constr_list} ->
       Datarepr.find_constr_by_tag tag constr_list
   | {type_manifest = Some _} ->
-      get_constr tag (Ctype.expand_head_once tenv ty) tenv
+      get_constr tag (Ctype.expand_head_once tenv (clean_copy ty)) tenv
   | _ -> fatal_error "Parmatch.get_constr"
 
 let find_label lbl lbls =
@@ -142,7 +147,7 @@ let rec get_record_labels ty tenv =
   match get_type_descr ty tenv with
   | {type_kind = Type_record(lbls, rep)} -> lbls
   | {type_manifest = Some _} ->
-      get_record_labels (Ctype.expand_head_once tenv ty) tenv
+      get_record_labels (Ctype.expand_head_once tenv (clean_copy ty)) tenv
   | _ -> fatal_error "Parmatch.get_record_labels"
 
 
index 6df3fb021d566e77099d5a9d891143687674b320..dc3fb2123ed5ffd2cc29aa5ac0a225234623248e 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: subst.ml,v 1.52 2008/01/11 16:13:16 doligez Exp $ *)
+(* $Id: subst.ml,v 1.52.4.1 2009/04/02 09:06:32 xclerc Exp $ *)
 
 (* Substitutions *)
 
@@ -294,3 +294,12 @@ and signature_component s comp newid =
 and modtype_declaration s = function
     Tmodtype_abstract -> Tmodtype_abstract
   | Tmodtype_manifest mty -> Tmodtype_manifest(modtype s mty)
+
+(* Composition of substitutions:  
+     apply (compose s1 s2) x = apply s2 (apply s1 x) *)
+
+let compose s1 s2 =
+  { types = Tbl.map (fun id p -> type_path s2 p) s1.types;
+    modules = Tbl.map (fun id p -> module_path s2 p) s1.modules;
+    modtypes = Tbl.map (fun id mty -> modtype s2 mty) s1.modtypes;
+    for_saving = false }
index 4bf6c21244923759d8c049ff30de7c71d9347d46..bf9f0652facdf21ee711b9264f93d94789865ce7 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: subst.mli,v 1.13 2008/01/11 16:13:16 doligez Exp $ *)
+(* $Id: subst.mli,v 1.13.4.1 2009/04/02 09:06:33 xclerc Exp $ *)
 
 (* Substitutions *)
 
@@ -52,3 +52,7 @@ val cltype_declaration: t -> cltype_declaration -> cltype_declaration
 val modtype: t -> module_type -> module_type
 val signature: t -> signature -> signature
 val modtype_declaration: t -> modtype_declaration -> modtype_declaration
+
+(* Composition of substitutions:  
+     apply (compose s1 s2) x = apply s2 (apply s1 x) *)
+val compose: t -> t -> t
index e26f777c0e5455ebead566da92e788997c445f06..b18a0aa0b18c995a4e4c8c169f94f63ec4f2de2b 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: typeclass.ml,v 1.93 2008/02/29 14:21:22 doligez Exp $ *)
+(* $Id: typeclass.ml,v 1.93.4.1 2009/04/19 08:42:43 xleroy Exp $ *)
 
 open Misc
 open Parsetree
@@ -1574,12 +1574,12 @@ let report_error ppf = function
       fprintf ppf
         "@[The type of self cannot be coerced to@ \
            the type of the current class:@ %a.@.\
-           Some occurences are contravariant@]"
+           Some occurrences are contravariant@]"
         Printtyp.type_scheme ty
   | Non_collapsable_conjunction (id, clty, trace) ->
       fprintf ppf
         "@[The type of this class,@ %a,@ \
-           contains non-collapsable conjunctive types in constraints@]"
+           contains non-collapsible conjunctive types in constraints@]"
         (Printtyp.class_declaration id) clty;
       Printtyp.report_unification_error ppf trace
         (fun ppf -> fprintf ppf "Type")
@@ -1589,11 +1589,11 @@ let report_error ppf = function
         (function ppf ->
            fprintf ppf "This object is expected to have type")
         (function ppf ->
-           fprintf ppf "but has actually type")
+           fprintf ppf "but actually has type")
   | Mutability_mismatch (lab, mut) ->
       let mut1, mut2 =
         if mut = Immutable then "mutable", "immutable"
         else "immutable", "mutable" in
       fprintf ppf
-        "@[The instance variable is %s,@ it cannot be redefined as %s@]"
+        "@[The instance variable is %s;@ it cannot be redefined as %s@]"
         mut1 mut2
index ade0e5c627ada6eff98c946b92a483f43fcb85f8..55e112b9001f8416d3e2cd02e60b9720a83a7549 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: typecore.ml,v 1.199 2008/07/29 15:42:44 doligez Exp $ *)
+(* $Id: typecore.ml,v 1.199.2.3 2009/04/19 09:21:08 xleroy Exp $ *)
 
 (* Typechecking for the core language *)
 
@@ -1263,10 +1263,11 @@ let rec type_exp env sexp =
             begin match arg.exp_desc, !self_coercion, (repr ty').desc with
               Texp_ident(_, {val_kind=Val_self _}), (path,r) :: _,
               Tconstr(path',_,_) when Path.same path path' ->
+                (* prerr_endline "self coercion"; *)
                 r := sexp.pexp_loc :: !r;
                 force ()
-            | _ when free_variables arg.exp_type = []
-                  && free_variables ty' = [] ->
+            | _ when free_variables ~env arg.exp_type = []
+                  && free_variables ~env ty' = [] ->
                 if not gen && (* first try a single coercion *)
                   let snap = snapshot () in
                   let ty, b = enlarge_type env ty' in
@@ -1282,6 +1283,7 @@ let rec type_exp env sexp =
                     Location.prerr_warning sexp.pexp_loc
                       (Warnings.Not_principal "this ground coercion");
                 with Subtype (tr1, tr2) ->
+                  (* prerr_endline "coercion failed"; *)
                   raise(Error(sexp.pexp_loc, Not_subtype(tr1, tr2)))
                 end;
             | _ ->
@@ -2105,7 +2107,7 @@ let report_error ppf = function
   | Constructor_arity_mismatch(lid, expected, provided) ->
       fprintf ppf
        "@[The constructor %a@ expects %i argument(s),@ \
-        but is here applied to %i argument(s)@]"
+        but is applied here to %i argument(s)@]"
        longident lid expected provided
   | Label_mismatch(lid, trace) ->
       report_unification_error ppf trace
@@ -2113,13 +2115,13 @@ let report_error ppf = function
            fprintf ppf "The record field label %a@ belongs to the type"
                    longident lid)
         (function ppf ->
-           fprintf ppf "but is here mixed with labels of type")
+           fprintf ppf "but is mixed here with labels of type")
   | Pattern_type_clash trace ->
       report_unification_error ppf trace
         (function ppf ->
            fprintf ppf "This pattern matches values of type")
         (function ppf ->
-           fprintf ppf "but is here used to match values of type")
+           fprintf ppf "but a pattern was expected which matches values of type")
   | Multiply_bound_variable name ->
       fprintf ppf "Variable %s is bound several times in this matching" name
   | Orpat_vars id ->
@@ -2130,15 +2132,15 @@ let report_error ppf = function
         (function ppf ->
            fprintf ppf "This expression has type")
         (function ppf ->
-           fprintf ppf "but is here used with type")
+           fprintf ppf "but an expression was expected of type")
   | Apply_non_function typ ->
       begin match (repr typ).desc with
         Tarrow _ ->
-          fprintf ppf "This function is applied to too many arguments,@ ";
+          fprintf ppf "This function is applied to too many arguments;@ ";
           fprintf ppf "maybe you forgot a `;'"
       | _ ->
           fprintf ppf
-            "This expression is not a function, it cannot be applied"
+            "This expression is not a function; it cannot be applied"
       end
   | Apply_wrong_label (l, ty) ->
       let print_label ppf = function
@@ -2148,7 +2150,7 @@ let report_error ppf = function
       in
       reset_and_mark_loops ty;
       fprintf ppf
-        "@[<v>@[<2>Expecting function has type@ %a@]@.\
+        "@[<v>@[<2>The function applied to this argument has type@ %a@]@.\
           This argument cannot be applied %a@]"
         type_expr ty print_label l
   | Label_multiply_defined lid ->
@@ -2176,14 +2178,14 @@ let report_error ppf = function
   | Unbound_class cl ->
       fprintf ppf "Unbound class %a" longident cl
   | Virtual_class cl ->
-      fprintf ppf "One cannot create instances of the virtual class %a"
+      fprintf ppf "Cannot instantiate the virtual class %a"
         longident cl
   | Unbound_instance_variable v ->
       fprintf ppf "Unbound instance variable %s" v
   | Instance_variable_not_mutable v ->
       fprintf ppf "The instance variable %s is not mutable" v
   | Not_subtype(tr1, tr2) ->
-      report_subtyping_error ppf tr1 "is not a subtype of type" tr2
+      report_subtyping_error ppf tr1 "is not a subtype of" tr2
   | Outside_class ->
       fprintf ppf "This object duplication occurs outside a method definition"
   | Value_multiply_overridden v ->
@@ -2214,8 +2216,8 @@ let report_error ppf = function
       end
   | Abstract_wrong_label (l, ty) ->
       let label_mark = function
-        | "" -> "but its first argument is not labeled"
-        |  l -> sprintf "but its first argument is labeled ~%s" l in
+        | "" -> "but its first argument is not labelled"
+        |  l -> sprintf "but its first argument is labelled ~%s" l in
       reset_and_mark_loops ty;
       fprintf ppf "@[<v>@[<2>This function should have type@ %a@]@,%s@]"
       type_expr ty (label_mark l)
index 6e5702cf0004180b09cdff3eea141f540fc48135..ee2f9cd22e98a02ea9fa45591d2f7607011cc386 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: typedecl.ml,v 1.82 2008/08/07 09:29:22 xleroy Exp $ *)
+(* $Id: typedecl.ml,v 1.82.2.2 2009/04/19 08:42:43 xleroy Exp $ *)
 
 (**** Typing of type definitions ****)
 
@@ -509,14 +509,13 @@ let compute_variance_decl env check decl (required, loc) =
           compute_variance env tvl true cn cn ty)
         ftl
   end;
-  let priv = decl.type_private
-  and required =
+  let required =
     List.map (fun (c,n as r) -> if c || n then r else (true,true))
       required
   in
   List.iter2
     (fun (ty, co, cn, ct) (c, n) ->
-      if ty.desc <> Tvar || priv = Private then begin
+      if ty.desc <> Tvar then begin
         co := c; cn := n; ct := n;
         compute_variance env tvl2 c n n ty
       end)
@@ -535,6 +534,7 @@ let compute_variance_decl env check decl (required, loc) =
       incr pos;
       if !co && not c || !cn && not n
       then raise (Error(loc, Bad_variance (!pos, (!co,!cn), (c,n))));
+      if decl.type_private = Private then (c,n,n) else
       let ct = if decl.type_kind = Type_abstract then ct else cn in
       (!co, !cn, !ct))
     tvl0 required
@@ -848,12 +848,12 @@ let report_error ppf = function
         (function ppf ->
            fprintf ppf "This type constructor expands to type")
         (function ppf ->
-           fprintf ppf "but is here used with type")
+           fprintf ppf "but is used here with type")
   | Null_arity_external ->
       fprintf ppf "External identifiers must be functions"
   | Missing_native_external ->
       fprintf ppf "@[<hv>An external function with more than 5 arguments \
-                   requires second stub function@ \
+                   requires second stub function@ \
                    for native-code compilation@]"
   | Unbound_type_var (ty, decl) ->
       fprintf ppf "A type variable is unbound in this type declaration";
@@ -910,16 +910,24 @@ let report_error ppf = function
         | (false,true)  -> "contravariant"
         | (false,false) -> "unrestricted"
       in
+      let suffix n =
+        let teen = (n mod 100)/10 = 1 in
+        match n mod 10 with
+        | 1 when not teen -> "st"
+        | 2 when not teen -> "nd"
+        | 3 when not teen -> "rd"
+        | _ -> "th"
+      in
       if n < 1 then
         fprintf ppf "%s@ %s@ %s"
           "In this definition, a type variable"
           "has a variance that is not reflected"
-          "by its occurence in type parameters."
+          "by its occurrence in type parameters."
       else
         fprintf ppf "%s@ %s@ %s %d%s %s %s,@ %s %s"
           "In this definition, expected parameter"
           "variances are not satisfied."
-          "The" n (match n with 1 -> "st" | 2 -> "nd" | 3 -> "rd" | _ -> "th")
+          "The" n (suffix n)
           "type parameter was expected to be" (variance v2)
           "but it is" (variance v1)
   | Unavailable_type_constructor p ->
index fa3f0c895aaa219dbbe033fc3fa5b0b4cbe88ae4..dc9165f7515478d38c25a6deac5458cdc3014512 100644 (file)
@@ -556,7 +556,7 @@ let report_error ppf = function
         Printtyp.type_expr ty
   | Variant_tags (lab1, lab2) ->
       fprintf ppf
-        "Variant tags `%s@ and `%s have same hash value.@ Change one of them."
+        "Variant tags `%s@ and `%s have the same hash value.@ Change one of them."
         lab1 lab2
   | Invalid_variable_name name ->
       fprintf ppf "The type variable name %s is not allowed in programs" name
index 6afd41068c777ef1b5742e36aa9cad00ea53c4e3..ee8e66a0d18e2d61e47da5eba1e8e866f4912e39 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: config.mlbuild,v 1.3 2007/11/27 12:22:59 ertai Exp $ *)
+(* $Id: config.mlbuild,v 1.3.4.4 2009/05/19 14:41:21 doligez Exp $ *)
+
+(***********************************************************************)
+(**                                                                   **)
+(**               WARNING WARNING WARNING                             **)
+(**                                                                   **)
+(** When you change this file, you must make the parallel change      **)
+(** in config.mlp                                                     **)
+(**                                                                   **)
+(***********************************************************************)
+
 
 (* The main OCaml version string has moved to ../VERSION *)
 let version = Sys.ocaml_version
@@ -40,10 +50,8 @@ let standard_runtime =
   else C.bindir^"/ocamlrun"
 let ccomp_type = C.ccomptype
 let bytecomp_c_compiler = sf "%s %s %s" C.bytecc C.bytecccompopts C.sharedcccompopts
-let bytecomp_c_linker = if windows then "flexlink" else sf "%s %s" C.bytecc C.bytecclinkopts
 let bytecomp_c_libraries = C.bytecclibs
 let native_c_compiler = sf "%s %s" C.nativecc C.nativecccompopts
-let native_c_linker = if windows then "flexlink" else sf "%s %s" C.nativecc C.nativecclinkopts
 let native_c_libraries = C.nativecclibs
 let native_pack_linker = C.packld
 let ranlib = C.ranlibcmd
@@ -54,8 +62,8 @@ let mkmaindll = C.mkmaindll
 
 let exec_magic_number = "Caml1999X008"
 and cmi_magic_number = "Caml1999I011"
-and cmo_magic_number = "Caml1999O006"
-and cma_magic_number = "Caml1999A007"
+and cmo_magic_number = "Caml1999O007"
+and cma_magic_number = "Caml1999A008"
 and cmx_magic_number = "Caml1999Y011"
 and cmxa_magic_number = "Caml1999Z010"
 and ast_impl_magic_number = "Caml1999M012"
@@ -102,10 +110,8 @@ let print_config oc =
   p "standard_runtime" standard_runtime;
   p "ccomp_type" ccomp_type;
   p "bytecomp_c_compiler" bytecomp_c_compiler;
-  p "bytecomp_c_linker" bytecomp_c_linker;
   p "bytecomp_c_libraries" bytecomp_c_libraries;
   p "native_c_compiler" native_c_compiler;
-  p "native_c_linker" native_c_linker;
   p "native_c_libraries" native_c_libraries;
   p "native_pack_linker" native_pack_linker;
   p "ranlib" ranlib;
index c6fa0e6ef8bf8ae2e9bdf06d3b02d82be55044bd..ce6bc7d5d87700d9c50b2583519160e50b48d670 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: config.mlp,v 1.208 2008/04/16 06:50:31 frisch Exp $ *)
+(* $Id: config.mlp,v 1.208.2.2 2009/05/18 09:38:16 doligez Exp $ *)
+
+(***********************************************************************)
+(**                                                                   **)
+(**               WARNING WARNING WARNING                             **)
+(**                                                                   **)
+(** When you change this file, you must make the parallel change      **)
+(** in config.mlbuild                                                 **)
+(**                                                                   **)
+(***********************************************************************)
+
 
 (* The main OCaml version string has moved to ../VERSION *)
 let version = Sys.ocaml_version
@@ -41,8 +51,8 @@ let mkmaindll = "%%MKMAINDLL%%"
 
 let exec_magic_number = "Caml1999X008"
 and cmi_magic_number = "Caml1999I011"
-and cmo_magic_number = "Caml1999O006"
-and cma_magic_number = "Caml1999A007"
+and cmo_magic_number = "Caml1999O007"
+and cma_magic_number = "Caml1999A008"
 and cmx_magic_number = "Caml1999Y011"
 and cmxa_magic_number = "Caml1999Z010"
 and ast_impl_magic_number = "Caml1999M012"
index 4e32f47b38287fae42bb6938a43d788cbc65bc53..eaa9f14045fd3aeb961340ad80753f1bcac106e4 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: tbl.ml,v 1.13 2004/11/25 13:28:27 doligez Exp $ *)
+(* $Id: tbl.ml,v 1.13.22.1 2009/04/02 09:06:33 xclerc Exp $ *)
 
 type ('a, 'b) t =
     Empty
@@ -95,6 +95,10 @@ let rec iter f = function
   | Node(l, v, d, r, _) ->
       iter f l; f v d; iter f r
 
+let rec map f = function
+    Empty -> Empty
+  | Node(l, v, d, r, h) -> Node(map f l, v, f v d, map f r, h)
+
 open Format
 
 let print print_key print_data ppf tbl =
index f17a8856e61396f24b2b59dde28dc588eb019944..ee840dd41fcb8e71cfd344cd6f305f42f525e4c9 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: tbl.mli,v 1.7 2000/04/21 08:13:22 weis Exp $ *)
+(* $Id: tbl.mli,v 1.7.44.1 2009/04/02 09:06:33 xclerc Exp $ *)
 
 (* Association tables from any ordered type to any type.
    We use the generic ordering to compare keys. *)
@@ -23,6 +23,7 @@ val find: 'a -> ('a, 'b) t -> 'b
 val mem: 'a -> ('a, 'b) t -> bool
 val remove: 'a -> ('a,  'b) t -> ('a, 'b) t
 val iter: ('a -> 'b -> 'c) -> ('a, 'b) t -> unit
+val map: ('a -> 'b -> 'c) -> ('a, 'b) t -> ('a, 'c) t
 
 open Format