Commit Graph

9370 Commits (0f6f367ad4c2210bdf393ac60dbc0b6f7b8c796d)

Author SHA1 Message Date
Alain Frisch 0f6f367ad4 Change the representation of exception slots: instead of being represented as 'string ref', they are now blocks
of size 2, with tag = Object_tag, the first field being the pointer to the string, and second one being a unique id, generated
from the same sequence as for object values.  Special case for predefined exceptions, represented with a negative id.

The unique id generator is moved from camlinternalOO to the C runtime system.

Also fix some bugs.



git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14239 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-23 14:28:31 +00:00
Alain Frisch fe3afbdce8 Revert bad(?) commit.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14238 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-18 15:15:10 +00:00
Alain Frisch a96fb5be45 Fix Out_of_memory/Stack_overflow.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14237 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-18 15:14:20 +00:00
Alain Frisch fc3a6d4be0 Also adapt the native system.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14236 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-18 14:15:27 +00:00
Alain Frisch d802a51be6 #6203: change representation of exception values created with a constant constructor: the value is now equal to the exception slot. This avoids some allocation when the constructor is called and an extra indirection on matching against the constructor.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14235 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-18 13:00:58 +00:00
Alain Frisch 804007bfc5 Support for AMD64, Intel syntax (i.e. MVSC 64 port).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14234 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-15 14:13:26 +00:00
Alain Frisch 4df8c363e8 Fix testsuite.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14233 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-15 13:12:52 +00:00
Alain Frisch f2597364a2 Support the two variants on i386, intel syntax (i.e. Win32 msvc port).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14232 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-15 13:09:01 +00:00
Alain Frisch 784b0b3d6e Support the two variants on i386.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14231 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-15 12:38:11 +00:00
Alain Frisch 0efe8df107 Adapt sparc backend (stacktraces not supported anyway).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14230 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-15 12:07:23 +00:00
Alain Frisch 0773bfa849 Support raise_notrace under powerpc (not tested). Do not distinguish raise/reraise for now.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14229 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-15 12:06:41 +00:00
Alain Frisch 3f3599f0ee Support raise_notrace under arm/arm64 (not tested). Do not distinguish raise/reraise for now.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14228 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-15 12:03:47 +00:00
Alain Frisch ae9a78b10d Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14227 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-14 14:38:18 +00:00
Alain Frisch 164c307ae3 Support for raise variants in ocamlopt. Only amd64 for now.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14226 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-14 14:33:27 +00:00
Alain Frisch 0915cb5b5f Rename raise_nostack -> raise_notrace. Expose it in Pervasives.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14225 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-14 13:52:14 +00:00
Alain Frisch c4513e1011 Recognize reraises in handlers.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14224 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-14 13:21:53 +00:00
Alain Frisch f31325cbaf #6203, #5935: variants of raise. 'reraise' is currently only inserted by the compiler when an handler does not catch the exception. The default 'raise' always start with a fresh backtrace. There is also 'raise_nostack' which does not trigger the stack trace recording. Bytecode only for now.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14223 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-14 12:31:50 +00:00
Alain Frisch 5dabafb940 Branch to experiment with variants of the raise primitive.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14222 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-14 12:12:24 +00:00
Alain Frisch 349f151c0d Fix testsuite.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14221 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-10 12:29:31 +00:00
Alain Frisch 01aaf23e20 #6205: add Hint before spellchecking suggestion.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14220 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-10 08:45:40 +00:00
Alain Frisch f1bc74bcc8 #5445: interpret warning attribute on expressions, and as floating signature/structure items.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-04 08:18:50 +00:00
Alain Frisch 1b73112593 Allow floating attribute in the toplevel. Also allow the empty structure (;;) as a toplevel phrase.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14213 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-04 07:54:31 +00:00
Alain Frisch 62f365c225 #6195: use ocamlcommon.cma to link ocamldoc, instead of explicit list of compiler modules.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14209 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-02 14:23:10 +00:00
Alain Frisch c955798936 Keep attributes with module type declarations. Warning on reference to deprecated module type.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14206 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-01 15:14:04 +00:00
Alain Frisch 5554eb13e9 Fix #6193 (Incorrect warning 12 for character ranges).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14205 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-01 11:40:21 +00:00
Jacques Garrigue 2d5bd02021 bootstrap camlp4
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14203 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-01 01:32:58 +00:00
Alain Frisch cc31694f7c Keep attributes on module declarations.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14195 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 17:05:39 +00:00
Alain Frisch c0778758c1 Keep attributes/locs for class type declarations and class declarations in Types. Renaming cty -> csig prefix for class signatures to be coherent with Typedtree.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14194 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 15:04:03 +00:00
Alain Frisch ef38d679df Fix.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14193 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 13:28:28 +00:00
Alain Frisch 8bf3d1cda9 Fix tests.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14192 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 13:26:56 +00:00
Alain Frisch 645dcf25e5 Keep location and attributes in type, label and constructor declarations. Deprecated warning when a deprecated type or constructor is referenced.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14191 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 10:54:55 +00:00
Alain Frisch 6873f39817 Keep attributes on value declarations in .cmi files (but clear all the location fields, except if -keep-locs is used, of course). Use this to report a warning when a value marked as [@@deprecated] is referenced (#5854)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14188 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 15:24:11 +00:00
Alain Frisch f55565753e Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14187 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 09:06:45 +00:00
Alain Frisch e1b2a8b193 Get rid of recursion closing functions, being more explicit on the recursion does not hurt.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14186 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:49:46 +00:00
Alain Frisch 13dd4d972d Adapt one more example.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14185 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:36:31 +00:00
Alain Frisch 9e09513778 Adapt one more example.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14184 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:34:06 +00:00
Alain Frisch d4230ffaa8 Adapt one more example.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14183 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:27:00 +00:00
Alain Frisch 7994b4db28 Functions to close the open recursion in Ast_mapper.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14182 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:24:38 +00:00
Alain Frisch a2735f80c5 Adapt js example.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14181 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:11:46 +00:00
Alain Frisch 91b2f18ef8 Cleanup ppx API.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14180 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:03:49 +00:00
Alain Frisch 48edce920b Switch to a record-based API for Ast_mapper, so that it can be used within the compiler itself (where objects are banned). The class-based version will be shipped as part of the ppx_tools package. Only the ifdef example has been adapted in experimental/frisch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14178 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-25 15:14:38 +00:00
Alain Frisch eddb6e86d9 Typo (#6190).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14177 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-25 07:16:21 +00:00
Wojciech Meyer 86f0519755 build: typo on config/Makefile.mingw64, msvc and msvc64.
(Patch by Adrien Nader!)

While trying to come up with the previous commit, I noticed that the
various Windows config files had diverged: all but config/Makefile.mingw
were lacking a '%' in a pattern and this prevents the pattern from matching
anything.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14176 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-22 22:33:23 +00:00
Wojciech Meyer 6e4c597bb1 build: ocamlmklib on Windows expect a Windows-style path, not a UNIX one.
(Patch by Adrien Nader!)

Rev 14168 (build: replace ocamlcomp*.sh.) broke "make world" (but
surprisingly, not "world.opt") because the argument to ocamlmklib's -ocamlc
has to be a Windows path, i.e. C:\...\ocamlc. Instead it gave a UNIX one,
i.e. /home/foo/ocaml/ocamlc.

Call cygpath in otherlibs/Makefile.nt to fix that.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14175 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-22 22:33:05 +00:00
Gabriel Scherer 5e9a3c5f9d bootstrap ocamlbuild again (needed for the cross-compilation patches)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14174 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-22 10:52:33 +00:00
Wojciech Meyer aa7e283b1b build: don't use make's -C; it's not available everywhere.
(Patch by Adrien Nader!)

-C doesn't work on at least openbsd's make so don't use it.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14173 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-21 12:02:49 +00:00
Wojciech Meyer 0cc184754c build: fix "make clean" failure when ./configure hasn't been run again.
(Patch by Adrien Nader!)

The "make clean" rules were relying on the $(ROOTDIR) variable.
However this variable is only defined when ./configure runs. This broke the
usual "make clean ; ./configure && make world.opt":
  < use old trunk >
  ./configure            # config/Makefile doesn't define ROOTDIR
  make world.opt
  < move to new trunk >
  make clean             # Fails early and doesn't clean all files
  ./configure            # config/Makefile now defines ROOTDIR
  make world.opt         # This fails because of left-over files

An easy solution was to run "make clean" again after configure but this is
not how everyone does and in particular, this is not how the jenkins build
bot seem to do.

The recipes for "make clean" should never rely on values defined by
configure for this exact reason.
As a simple solution, only run the commands that rely on $(ROOTDIR) if
$(ROOTDIR) is set.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14172 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-21 12:02:48 +00:00
Wojciech Meyer 49a8d15728 build: skip $(IFLEXDIR) in mk_shell_and_ocamlbuild_config.sh.
(Patch by Adrien Nader!)

On Windows, IFLEXDIR is defined as -I"$(FLEXDIR)". The new
mk_shell_and_ocamlbuild_config script outputs:
  echo IFLEXDIR="\"$(IFLEXDIR)\""

However, becauses $(IFLEXDIR) contains quotation marks, this becomes:
  echo IFLEXDIR="\"-I"$(FLEXDIR)"\""

This unquotes $(FLEXDIR) and breaks the program.

Simply exclude IFLEXDIR from the variables that are handled by the
script. This is actually what the previous scripts were doing: the
exclude list was .*FLEXDIR and matched both IFLEXDIR and FLEXDIR while
the one I made only had \<FLEXDIR\> in it.

I've tried to handle it but there are at least three competing languages
and quoting rules: makefile (both gnu make and several bsd makes), shell
script and ocaml.
There's no human way to do string processing given the portability
constraints: both gnu make and pmake (and its descendants) have powerful
string processing functions but they're not the same.
The only sane way would be to store the configuration in a more evolved
language that is portable, has arrays and powerful string handling
routines in standard like C or awk. From there it would be possible to
output make, shell script and OCaml code easily.

One day. Maybe.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14171 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-21 10:24:34 +00:00
Alain Frisch b414d57b0e Simplify type_structure.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14170 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-20 16:19:54 +00:00
Wojciech Meyer 0f04aeefa1 build: remove warning 32 (unused variable) in tools.
(Patch by Adrien Nader!)

Among other files, myocamlbuild_config.ml is built in this directory.
This file defines many variables, most of which are not used and
therefore trigger this warning which is then turned into an error
through -warn-error A.
build: remove warning 32 (unused variable) in tools.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14169 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-20 00:22:40 +00:00