Commit Graph

732 Commits (c4e8117c2bf2b17e60c5d141456a3628d150513c)

Author SHA1 Message Date
Damien Doligez 031cffd155 merge branch 4.02 from release 4.02.0 to release 4.02.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-15 13:34:58 +00:00
Alain Frisch e3ad818fb5 Reintegrate-merge constructors_with_record5 branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15556 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-14 15:51:30 +00:00
Gabriel Scherer 97cff22e45 ocamldep support for -open
Adding an `open_module` function to the Depend interface instead of
directly mutating `free_structure_names` makes the approach robust to
eventual improvement to ocamldep's handling of `open` (for example, in
presence of .cmi for the opened units it could add their submodules
to the set of bound vars). This only goes so far, however, as the
overall imperative style would not nicely support proper local
handling of `let open M in e`.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15468 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 20:31:34 +00:00
Gabriel Scherer dfcccc7999 minor refactoring in ocamldep.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15467 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 20:31:32 +00:00
Alain Frisch 378a967cb7 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15190 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-04 16:11:12 +00:00
Damien Doligez a18bc7950b merge changes of version/4.02 from r15121 to r15155
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-29 17:14:00 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Gabriel Scherer d02c8fbc55 new -opaque flag: ocamlopt creates .cmx without cross-module info
(Patch by Pierre Chambart and Gabriel Scherer)
(Ack'ed by Damien Doligez)

This enables a form of incremental compilation for ocamlopt: if
A depends on B, and B is compiled with `ocamlopt -opaque`, then minor
implementation changes in B that do not affect the module interface
will not require recompilation of A.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15105 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-18 13:28:34 +00:00
Gabriel Scherer 1a87dee8e3 tools/objinfo: workaround change in binutils' <bfd.h>
(Report and fix by Christopher Zimmerman)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15089 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-15 13:19:23 +00:00
Alain Frisch 50f47df33a Sync with trunk. Rebinding of inlined extension constructors with free variables is not yet supported.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15069 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 16:07:55 +00:00
Alain Frisch 047e09748c Cherry-pick 15062,15063,15064 from 4.02 (#6497).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 09:46:34 +00:00
Damien Doligez cf6714ead2 PR#6142: add cmt file support to ocamlobjinfo
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15028 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-24 18:08:40 +00:00
Damien Doligez 6ba26a91f2 allow long lines up to 132 chars in ocamldoc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15018 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-21 20:41:52 +00:00
Damien Doligez 9ac64ba6a4 PR#6406: Expose OCaml version in C headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15017 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-21 20:39:38 +00:00
Damien Doligez d1b1fbee66 still debugging the ci-build script (take 3)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14962 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-05 09:57:20 +00:00
Damien Doligez 499092e0ba still debugging the ci-build script
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14961 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-05 09:37:57 +00:00
Damien Doligez 837ed62b9e debugging the ci-build script
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14960 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-05 09:19:17 +00:00
Damien Doligez 43701240df ci-build: go to the right directory before parsing command-line options
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14945 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-02 20:52:44 +00:00
Damien Doligez 2c67f4f755 tools/ci-build: add possibility of changing directory on unix-like architectures
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14940 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-02 11:30:11 +00:00
Damien Doligez 45473851e8 add option -patch1 to ci-build script
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14939 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-02 11:27:24 +00:00
Damien Doligez c82c004286 ci-build: fix wrong variable name
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14851 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 18:56:14 +00:00
Damien Doligez 5d7864a8d4 ci-build: do not change directory for Unix slaves
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14803 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 14:46:59 +00:00
Damien Doligez 6d688eadc1 add missing instructions to ci-build for msvc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14802 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 14:26:25 +00:00
Damien Doligez d0368bc2c5 update distclean target
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14801 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 14:03:04 +00:00
Damien Doligez aebb9e144d fix missing archs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14798 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 13:46:19 +00:00
Damien Doligez 4736382a39 add universal CI build script
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14796 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 12:19:20 +00:00
Alain Frisch 68ae2cc74b Enable warning 27 in tools/ and fix occurrences. It's good to mark in depend and untypeast parts which are explicitly ignored.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14794 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 10:41:21 +00:00
Jacques Garrigue ccce272966 commit o_and_opens.diff
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14787 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 00:17:05 +00:00
Jacques Garrigue 1ce29d9bfc re-commit Leo's weak-dependencies pull request
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14755 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 00:34:20 +00:00
Fabrice Le Fessant b1943e1ac7 Remove FIRST_UNIMPLEMENTED_OP from interp.c
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14748 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 13:59:25 +00:00
Alain Frisch 0f1fb19cbe #6318: Extend match...with with exception cases. (Patch by Jeremy Yallop, backend part by A. Frisch).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14743 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:49:37 +00:00
Alain Frisch 0b3423ef2c #6387: also allow attributes on methods in object types (< m [@foo] : int; ..>).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14741 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:21:45 +00:00
Jacques Garrigue fc24112e25 change -trans-mod to -no-alias-deps, and update message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14738 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 02:05:30 +00:00
Jacques Garrigue b56dc4b3df PR#5584: merge open extensible types, extension-patch-4.0.2
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 23:08:45 +00:00
Alain Frisch 0f1bb864df Add support for floating attributes in class structures and class signatures. (Patch by Leo White.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14736 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 20:42:34 +00:00
Jacques Garrigue 95104b3924 revert commit 14719
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14723 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 06:19:55 +00:00
Mark Shinwell 521ac0213a weak dependencies with -trans-mod (github/ocamllabs/weak-depends 45e980a,21856a7,merge)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14719 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-01 12:50:20 +00:00
Alain Frisch b791d666d8 #6387: allow attributes on variants in polymorphic variant types.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14712 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30 08:19:55 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Xavier Leroy 558f40e344 New back-end optimization pass: common subexpression elimination (CSE).
(Reuses results of previous computations instead of recomputing them.)
(Cherry-picked from branch backend-optim.)
Tested on amd64/linux and i386/linux.
Other back-ends compile (after assorted updates) but are untested.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14688 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-26 10:40:22 +00:00
Xavier Leroy 29b34438e0 - Constant ropagation for float and int32/int64/nativeint arithmetic.
Constant propagation for floats can be turned off with option
  -no-float-const-prop, for codes that change FP rounding modes at
  run-time.
- Clambda / C-- / Mach: represent float constants as FP numbers of type 
  float rather than literals of type string.
- Tested for AMD64; other archs need testing.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14673 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 08:41:13 +00:00
Alain Frisch dfce13de92 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14661 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 15:40:51 +00:00
Alain Frisch 3b6c0c88a5 Make Parsetree more uniform by keeping locations in all records which have attributes.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14659 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 15:28:20 +00:00
Alain Frisch eb617b5fe7 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14657 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 14:33:41 +00:00
Alain Frisch 6fe5dd7cf4 Turn more sig/str items into records. Patch from Leo White.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14597 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 11:26:00 +00:00
Alain Frisch 6346154d4b Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14587 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-14 11:52:29 +00:00
Damien Doligez 7303ac34ca fix some of the whitespace problems in the source
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14582 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12 10:17:02 +00:00
Damien Doligez 8ebe119817 test reference files are now exempt from all rules
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14580 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12 07:22:18 +00:00
Alain Frisch 1d4e1364bd Keep inlined records in Typedtree and Types. Synthesize record types when inserting in the environment and module components, as for labels and constructors. Following features are not supported: inline record for exceptions, GADTs, polymorphic fields.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 14:53:30 +00:00
Gabriel Scherer 7d51d487ef [minor] make tools/Makefile.shared msvc-friendly
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14547 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 12:09:25 +00:00
Gabriel Scherer de4f4cf8b3 PR#6358: obey DESTDIR in install targets
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14536 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 07:06:17 +00:00
Gabriel Scherer 2b9f94b69b PR#6270: remove need for -I directives to ocamldebug in common case
(patch by Josh Watzman)

Add absolute directory names to bytecode format for ocamldebug to use

The need for a long list of -I directives makes interactively using
ocamldebug a pain in the butt. Many folks have solved this with various
`find` invocations or even Python wrappers, but those lead to other
problems when it might include files you weren't expecting (or miss
things you were). But all of this is really annoying since the tooling
should be able to figure out itself, even heuristically, where your
source files are -- gdb gets this right, why can't we?

This patch implements one of the more important heuristics from gdb: you
typically debug on the same machine you built on, so looking for the
source files and built artifacts in the absolute paths where they were
during compilation is a good first try. We write out absolute paths into
a new structure at the beginning of the debug section and then
automatically append those directories into the load path.

This means mean that if you happen to be debugging on a machine
where the original source and build artifacts are *not* available in
their original absolute locations, things will work as before, using the
standard load path mechanism. You can also explicitly use -I to prepend
directories to the load path and override the defaults located by this
new mechanism.

I personally find this makes using ocamldebug much more pleasant :)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14533 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-06 15:06:22 +00:00
Damien Doligez c95804ee7e ignore generated file ocamlmklibconfig.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14526 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-03 16:18:14 +00:00
Alain Frisch ce4c5fad1d Rvert parts of the original commit which are not relevant with the encoding approach.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14513 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-31 16:17:37 +00:00
Damien Doligez 989ac0b263 stop ignoring ocamlmklib.ml, it is not a generated file any more
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14512 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-31 16:02:01 +00:00
Alain Frisch 132ff51559 Some preparation for record arguments.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14505 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-28 17:08:53 +00:00
Luc Maranget c2a88c27fd #PR6269 Optimized string matching
Noticed that I had to bootstrap to test on ARM, so I commit  a new bootstrap
compiler.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14479 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-21 17:02:44 +00:00
Alain Frisch 4907f6ca76 #5779: improve support for structured constants (better propagation, sharing, cleaner representation). Also fix #6337 (constants emitted several times).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14444 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-06 17:03:16 +00:00
Alain Frisch 663c098be6 Add location to module and module type definitions. Improves #6311.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14428 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-30 12:18:34 +00:00
Alain Frisch 5d99ea5177 Fix dependency analysis for module aliases.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14403 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-21 16:47:05 +00:00
Jacques Garrigue 3b4d7cf63b Merge module-alias branch (cf. PR#6063)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14394 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-10 07:53:33 +00:00
Jacques Garrigue d90b126bd4 Add -trans-mod option for transparent module dependencies.
Without that option, dependencies are strict, both for
typing and linking.


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14382 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-20 06:55:26 +00:00
Damien Doligez ed52c665b6 ocamlmklibconfig.ml: add missing config varible
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14368 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-17 08:48:31 +00:00
Jacques Garrigue cfa350c31a merge generative functors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14365 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-17 03:52:50 +00:00
Xavier Leroy 33f6c2c78b Un-bootstrapping of ocamlbuild, clean-up phase:
- removed boot/myocamlbuild.boot, _tags, myocamlbuild.ml, etc
- removed shell scripts in build/, now unused
- revised configuration and build of tools/ocamlmklib.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14353 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-14 16:34:18 +00:00
Xavier Leroy 33f242aaea Reverting the elimination of the ocamlcomp*.sh scripts, namely the following commits:
14278
14277
14276
14176
14175
14173
14172
14171
14169
14168
14167
These changes need to mature on their own branch.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14329 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-29 13:04:38 +00:00
Wojciech Meyer 928503e9b8 build: always build lex/ and ocamlc with the compiler from boot/.
(Patch by Adrien Nader!)

This is a partial revert of revision 14168 which caused issues when
bootstrapping the compiler. Since these directories don't take long to
build, we can always use a byte-compiled compiler.

Bootstrapping and more generally working on the compiler itself does not
play nice with trying to use the most recent compiler as soon as
possible: imagine you've just modified the compiler but in a way that
breaks it at runtime in a non-obvious way; all the files that are
subsequently built will have been built with your the compiler you will
be debugging.

v2: always build tools/ with boot/ocamlc since most executables link
    against compiler libs.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14277 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-10 12:32:12 +00:00
Jacques Garrigue 5f68db9cf0 Merge trunk at revision 14200. Now everything works except private types
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14201 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 13:54:59 +00:00
Jacques Garrigue 97899f37ca Support module aliases.
Namely, you can write "module L = List" in signatures,
and avoid have the compiler use directly List when you write L.
See examples in testsuite/tests/typing-modules/aliases.ml


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14196 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-29 07:22:34 +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 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
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
Wojciech Meyer 241585bc83 build: replace ocamlcomp*.sh.
This script was built from ocamlcomp.sh.in through sed and is called
instead of "ocamlc" (for instance).
It makes it possible to switch from "ocamlc" to "ocamlc.opt" without
changing anything in the Makefiles, only calling sed.

I couldn't cleanly make it handle both a compiler for the target and for
the build. Instead I'm replacing it and doing as much as possible
directly in the Makefiles.
I hoped it would reduce the number of shell invocations, which would
speed things up quite a lot on Windows but I still had to have at least
one since it's not possible to update a make variable from inside a make
rule: i.e. it's not possible to do X=a, build a.opt and update X to be
a.opt.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-20 00:22:38 +00:00
Wojciech Meyer 8104198af7 build: replace build/mk{config,myocamlbuild_config}.sh.
(Patch by Adrien Nader!)

These scripts sed config/Makefile in order to create shell script and
ocaml code that define the same values as the Makefile but in the
corresponding language.
The sed stuff is very difficult to understand, very brittle and
impossible to change.
Remove that altogether and use a Makefile to run commands like
[ echo FOO=$(FOO) ]. There is still some sed involved (to get the list
of variables in the config and to put rewrite the lists into a list of
commands) but much less and all the expressions are put into variables
with meaningful names with lots of comments.

For config.sh, mkconfig.sh generated lines like :
  if [ -z "${FOO}" ]; then FOO=bar; fi
The new script sets the value without checking anything.
I haven't found a reason to do things differently: if there is anything
to override, the right place to do it is after sourcing the shell
script. In any case, I haven't seen any such use.

The mkconfig.sh file also set "WINDOWS=true/false" but the only use is
in the parallel build-system which is implemented in build/ and uses
ocamlbuild as much as possible, and it's going away so it's useless to
set it too.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14167 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-20 00:13:23 +00:00
Alain Frisch 40117f7480 #5817: new compiler flag (-keep-locs) to keep location in cmi files.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14157 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 12:45:05 +00:00
Alain Frisch 884ca00fdf Continue cleanup. driver/errors.ml is no longer needed.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14120 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:45:03 +00:00
Alain Frisch d18a044380 Keep input file in Pparse.Error. Switch it to the new system.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14108 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 12:27:33 +00:00
Alain Frisch 71efb4666b Switch Lexer.Error to the new system.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14107 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 11:59:45 +00:00
Alain Frisch 6ad98b3d09 Port Syntaxerr.Error to the new system. Trickier, because of special way to report some errors in the toplevel (is it really worth the trouble?).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14105 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-11 18:10:59 +00:00
Alain Frisch ef35b10412 Remove the dump_ast tool. A better replacement is part of the standalone ppx_tools package.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14087 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-10 14:28:36 +00:00
Damien Doligez 7844495624 Merge branch 4.01 from branching point to 4.01.0+rc1
Command line used:
  svn merge --accept postpone -r 13776:14055 $REPO/version/4.01 .


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14060 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-04 15:12:37 +00:00
Alain Frisch f6e4122b85 Do not compile or install by default ocamlast.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14045 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-29 12:51:03 +00:00
Alain Frisch 842f6794a9 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@14042 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-28 17:10:04 +00:00
Damien Doligez 5fbcc8e6ae PR#4243: make the Makefiles parallelizable
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13931 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-24 14:39:31 +00:00
Alain Frisch b0d5fc28a2 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13922 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-22 17:03:39 +00:00
Alain Frisch d3be8230a7 #6073: Add signature to Tstr_include. (Cherry-picked from commit 13903 on 4.01.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13904 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-17 15:25:47 +00:00
Fabrice Le Fessant 1823936ce0 Fix OCAMLPARAM problems
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13901 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-17 12:35:26 +00:00
Alain Frisch 525ef9d703 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-16 13:34:30 +00:00
Alain Frisch 9d3592791c Fix #5811 as suggested. (Merge 13792 from 4.01.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13793 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-17 08:53:03 +00:00
Fabrice Le Fessant ad6c285818 Improved implementation of OCAMLPARAM
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13747 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-05 16:34:40 +00:00
Alain Frisch c928582092 A toy tool to produce an mli file from an annotated ml file.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 16:32:11 +00:00
Alain Frisch 2e199ef1f2 Item attributes on each let-binding.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13736 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 15:14:19 +00:00
Damien Doligez 0739ee7671 compact representation of warning flags
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13704 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-28 11:03:42 +00:00
Jérémie Dimino 8cee3aedf9 Revert addition of raw literals to the parsetree
It turns out it is not possible to have the exact raw representation
since a constant does not always correspond to exactly one token, so
there is no point in making the AST more complex.


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13702 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-23 15:12:04 +00:00
Damien Doligez c3bf54a7b6 merge changes from version/4.00 from 4.00.1 to r13697
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13699 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-22 12:56:54 +00:00
Jérémie Dimino 4e7ae971a7 add the raw representation of constants to the parsetree
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13696 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-20 11:37:41 +00:00
Alain Frisch a3b1c67fff #5980: explicit way to silence the new warning (open! X).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13685 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-16 13:34:53 +00:00
Damien Doligez 51c65627cb ignore *.exe.manifest files
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13659 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-07 11:26:57 +00:00
Damien Doligez 61013c6e39 ignore .obj and .lib files
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13657 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-07 09:40:52 +00:00
Damien Doligez e7bda64c3d ignore also .dll files
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13626 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-29 18:21:17 +00:00
Alain Frisch 67912da346 Allow abstract module declaration in structures to make the syntax and Parsetree more uniform.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13556 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-18 13:14:53 +00:00
Xavier Leroy e29c9d2956 PR#5986: added flag Marshal.Compat_32 and ocamlc option -compat-32.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13554 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-18 11:58:59 +00:00
Alain Frisch 84147074f9 Split Pexp_constraint into Pexp_coerce/Pexp_constraint.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13552 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 12:23:44 +00:00
Alain Frisch d2171a98d8 Split Pexp_function into Pexp_function/Pexp_fun.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13551 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 11:43:29 +00:00
Alain Frisch b36ec9f764 Get rid of the 'explicit arity' flag on Pexp_construct/Ppat_construct. If really requires (for camlp5?), the feature should be reimplemented with attributes.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13549 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 09:46:52 +00:00
Alain Frisch 501dfd2b5e Getting rid of Pexp_assertfalse/Texp_assertfalse.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13548 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 09:18:03 +00:00
Alain Frisch 088de517d8 Keep interval pattern sugar in the Parsetree (Camlp4 parsers still expand them).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13546 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 15:34:09 +00:00
Alain Frisch 158bc9c9e3 Get rid of the undocumented syntax #c[>`A] (#5936, #5983).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13542 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 12:17:17 +00:00
Alain Frisch 3fe10139ab Better representation of with-constraints.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13540 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 10:47:45 +00:00
Alain Frisch c8743ab55f Remove pcsig_loc field + doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13538 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 09:21:05 +00:00
Alain Frisch ecb088015f Rename Pcty_fun to Pcty_arrow (and idem in Types, Typedtree, Outcometree) to be coherent with Ptyp_arrow.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13536 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 08:59:09 +00:00
Alain Frisch e7736899fb Explicit representation of guards, get rid of Pexp_when.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13528 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-15 16:23:22 +00:00
Damien Doligez 75ba2fd463 ignore .exe files
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13526 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-13 20:24:33 +00:00
Alain Frisch 04de43bee5 Attributes on Pstr_eval.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13512 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 14:07:32 +00:00
Alain Frisch 92ad47d47b Keep item attributes on let-binding structure items.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13511 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 13:52:06 +00:00
Alain Frisch 90bbd25948 Extension nodes as class field or class type field.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13502 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 17:54:54 +00:00
Alain Frisch 6e36fd566b Extension nodes and attributes for class types.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13501 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 17:44:15 +00:00
Alain Frisch ee5f754a42 Attributes and extension points in class_expr.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 17:26:55 +00:00
Alain Frisch e2036c5a22 Start to bring constructor names closer to concrete syntax.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13497 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 11:17:41 +00:00
Alain Frisch 580bb34579 Renaming pcstr_pat -> pcstr_self, cstr_pat -> cstr_self.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13496 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 09:35:09 +00:00
Alain Frisch ec9dacb3f1 Support for attributes on class type fields.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13494 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 09:17:22 +00:00
Alain Frisch d84ae41182 Item attributes on class fields.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13493 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-09 15:54:41 +00:00
Alain Frisch d1751e4738 Allow to not have empty Ptyp_poly node in the Parsetree (the type-checker insert them automatically).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13491 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-09 14:10:54 +00:00
Alain Frisch 1eb1ec4c40 Get rid of core_field_type, more direct representation of object types.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13489 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-09 13:29:00 +00:00
Alain Frisch 47a3ee095e Get rid of the Default case in Asttype.rec_flag.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13481 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-04 12:38:20 +00:00
Alain Frisch 27d523ea72 Better representation of variance in the Parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13474 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-02 15:33:35 +00:00
Alain Frisch 1a63c4659c Filtering of location and empty attribute fields.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13468 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-29 12:50:51 +00:00
Alain Frisch 7f973bc330 A tool to dump the Parsetree in OCaml syntax (relies on the toplevel pretty-printer).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13467 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-29 11:14:25 +00:00
Alain Frisch 6bfcb1da5b Support for quoted strings.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13450 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 11:17:17 +00:00
Alain Frisch c2c5b10685 Align module type binding with Parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13448 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 08:21:29 +00:00
Alain Frisch 2ffa26af82 Align module binding with Parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13447 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 08:09:26 +00:00
Alain Frisch 77d3fce857 Align exception_declaration with Parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13446 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 18:42:45 +00:00
Alain Frisch f4ca2da467 Align type_declaration with parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13445 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 18:20:11 +00:00
Alain Frisch 25815e6e77 Align typed value_declaration with parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13444 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 18:04:40 +00:00
Alain Frisch fbde1f7e52 Align module and module type declarations between Parsetree and Typedtree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13443 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 17:47:28 +00:00
Alain Frisch 0b9347f482 Represent exception declarations as constructor declarations in the Parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13442 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 15:49:10 +00:00
Alain Frisch dd61fb5e55 Represent label and constructor declarations as records in the typedtree. Also keep return type for GADT constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13441 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 14:56:56 +00:00
Alain Frisch 5c98dd91fe Starting to keep attributes in the typedtree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13440 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 14:16:07 +00:00
Damien Doligez 7b31f54095 It is no longer necessary to keep pre-processed files in case of errors
(see commits 3817 and 5224,5302,5816)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13406 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-18 20:13:53 +00:00
Damien Doligez c63f9e0957 fix a few problems with whitespace and over-long lines
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13393 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-09 22:38:52 +00:00
Alain Frisch b0987fd693 Attributes on expresions (etc) are now stored in the expression record, to facilitate pattern matching on structured fragments of AST while ignoring attributes. Introducing a new Ast_helper module to help creating AST fragments.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13381 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-08 14:59:45 +00:00
Alain Frisch 97c5f1a253 Attributes on label in record type declarations.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13361 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 13:51:18 +00:00
Alain Frisch d50038cae7 Attribute has structure/signature item.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13359 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 12:27:32 +00:00
Alain Frisch 2cf65c8c85 Record for module type declarations.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13358 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 12:14:02 +00:00
Alain Frisch 24a0c6eb0e Name is part of the value_description record.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13357 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 12:00:18 +00:00
Alain Frisch 241abe55e6 Type name is part of the type declaration record.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13356 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 11:47:59 +00:00
Alain Frisch 59bdf321d3 Switch Pstr_modtype argument to a record type.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13355 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 10:49:44 +00:00
Alain Frisch a79811afe9 Finish attributes on module/recursive modules in structures.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13354 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 10:12:21 +00:00
Alain Frisch cc70961d4f Support item attributes on exn rebind.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13351 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-05 12:44:40 +00:00
Alain Frisch b01b7305bd Put name in the exception_declaration record.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13350 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-05 12:37:17 +00:00