Commit Graph

99 Commits (master)

Author SHA1 Message Date
Nicolás Ojeda Bär 5381e13626
Fix handling of Exit_compiler exception in toplevel (#9798) 2020-10-05 09:46:20 +02:00
Daniel Bünzli ad12d494a8
Unopen Compenv in the code base (this is a nop). (#9933) 2020-09-23 22:55:21 +02:00
Florian Angeletti a509157eb9 share argument implementation across executable
This commit defines five default argument modules in
Main_args.default. Those modules provide a default implementation
for the argument of ocaml, ocamlnat, ocamlc, ocamlopt, ocamldoc,
ocamlcp, ocamloptp, and expect_test.

Grouping together those implementations allow to share as much as
possible similar implementation across executables. It should make
easier to keep synchronized the various implementation, or reuse
those implementation in alternative drivers.
2019-09-30 15:56:40 +02:00
Florian Angeletti e6605d6a80 Remove unused preargument from toplevel
This commit removes the pre-arguments -dflambda, -dtiming and -dprofile
from the toplevel. Those pre-arguments were never actualized into actiual
arguments
2019-09-30 15:56:40 +02:00
Jérémie Dimino 705054b346 Delete the vmthreads library (#2289)
* Delete the deprecated vmthreads library

It was deprecated in 4.08.

* Remove the byte/native argument of init_path

It is no longer necessary.

* Error out when passing --{enable,disable}-vmthreads to ./configure

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-03-11 19:38:16 +01:00
Jeremie Dimino 7e0862a212 Refactor load path management and initial environment
- Add a Load_path module which caches files lookup

- Instead of falling back to the external environment, allow to
  declare in the environment that a module comes from the external
  world. This allows persistent structures to shadows non-persistent
  ones
2019-01-30 16:36:38 +00:00
Alain Frisch 2e5b9d1ef1
"Alerts" as a generalization of "deprecated" (#1804) 2018-11-15 09:51:35 +01:00
Armaël Guéneau 6b16bcc4fe Add option -error-style and environment variable OCAML_ERROR_STYLE 2018-10-20 17:11:35 +02:00
Nicolás Ojeda Bär 70be1416dc Add support for OCAMLTOP_INCLUDE_PATH 2018-10-10 14:54:47 +02:00
Thomas Refis b3b86c9b8b toplevels accept -nopervasives 2018-08-07 10:33:08 +01:00
Valentin Gatien-Baron 1ddb7ad725 rename Clflags.fast as Clflags.unsafe
The variable and the flag got out in sync in
2977939b5a.
2018-07-15 15:08:47 -04:00
Armael 7c9c210884 Move Location.absname to Clflags.absname (#1886) 2018-07-06 13:43:28 +01:00
Valentin Gatien-Baron dd31991312 refactoring the uses of Clflags.include_dirs
- store what was passed on the command line, before expanding
  +foo into path-to-stdlib/foo, instead of randomly doing either
- the toplevel libraries were not expanding the leading + from
  OCAMLPARAM
- make the native toplevel slightly closer to the bytecode one
- remove what looks like duplicated code in ocamldoc
2018-07-01 07:50:33 -04:00
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00
Sébastien Hinderer fa7019437c Add the -dunique-ids and -dno-unique-ids options to the compilers
These options allow to control whether identifiers are made unique by
appending a stamp to them when dumping intermediate representations or not.

The default is to print the stamp, as is done currently.

The "-dno-unique-ids" option is useful e.g. to simplify the comparison
between a produced intermediate reprsentation (-dlambda, say) and the
expected one, in the context of the testsuite, for instance.
2018-02-20 18:02:35 +01:00
octachron 0bf9ceaa3f toplevel: remove plugin option in toplevel 2017-09-30 11:03:53 +02:00
David Allsopp 12b20f30f5 Fix -nostdlib option to ocaml
Search path was initialised before options were parsed, meaning that
-nostdlib had no effect.
2017-08-17 15:16:02 +01:00
sliquister 3f76c0525b generalize -dtimings to show allocation, top heap size (#1152) 2017-06-09 12:29:21 +01:00
Bernhard Schommer bc81c313b0 Added expand to toplevel. (#864)
* Added expand to toplevel.

The toplevel now also accepts -args and -args0. In order to avoid
problems with the overide_args hack now script file is allowed in
expand options.

* Fixed differences between .ml and .mli

* Added missing expand in opttopmain.

* Added some test for broken -args for toplevel.

The test checks whether the toplevel fails if the script file is passed
via args option.

* Corrected test case.

* Updated error case.

Instead of printing the error string, Arg.Bad is raised and a wrapper is
added around the parse_and_expand_dynamic_argv.

* Added begin ... end around try ... with.

* Added working example an strip error path.

* Use sed to remove path and fixed typo.

* Added documentation.

* Also fix typo in reference file.

* Added PR to the corresponding change entry.

* Reworked Changes entry.

* Added new tests and updated documentation.

A script file in a responsefile now only prints an error message instead
of the help.

* Removed duplicated entry.

* Simplified expand logic.

We only remember where the current last expanded option is.

* Use first non_expand position instead.

* Updated error message.
2016-11-07 11:48:56 -05:00
Damien Doligez d5a6e50ebe GPR#606: add unboxed types 2016-07-21 13:51:46 +02:00
Fabrice Le Fessant f26c0ff8b6 Add plugins in the compiler 2016-07-18 17:43:05 +02:00
Marc Lasson 0fd2964dff Use OCAMLPARAM's objects in toplevel
Only the non-native one (it does not support OCAMLPARAM at all atm).
2016-07-04 09:53:23 +02:00
Sébastien Hinderer 3bbf34319e Add the -no-version option to the toplevel.
This option requests the toplevel not to print its version number
at startup.
2016-05-09 17:22:29 +02:00
Demi Obenour fe05f8fc29 Add `-alias-deps` and `-app-funct`
This was meant for GPR #514, but I forgot to include it.
2016-04-19 12:21:09 -04:00
Demi Obenour 795a4d532d Add explicit command-line flags for currently-default settings
-no-keep-docs
    -no-keep-locs
    -no-principal
    -no-rectypes
    -no-strict-formats
2016-04-18 10:53:51 -04:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Pierre Chambart b0b0f6609c Enable flambda 2016-01-28 15:04:47 +01:00
Pierre Chambart 233e1b1791 Record compiler runtime 2015-12-18 13:33:10 +00:00
Alain Frisch 2a6db79e0e Prepare environment (with Compenv.readenv) before executing script passed on the toplevel command-line.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15412 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-01 14:50:36 +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
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
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 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
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
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
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
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
Gabriel Scherer b1c5fa3e52 PR#6071: Add a -noinit option to the toplevel [patch by David Sheets]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13972 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-04 19:58:09 +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
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
Jacques Garrigue 26e1ff7138 Merge short-paths into a fresh branch of trunk.
Also fix a bit unification and subtyping errors.
You now need the flag -short-path to activate short paths.



git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths-4.01@13285 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-29 14:21:12 +00:00
Alain Frisch ef9fc7ab0f #5904: support for -ppx in the toplevel.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13278 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-25 09:12:31 +00:00
Alain Frisch f1d0e5afab Add a -dtypedtree flag to all tools (using Printtyped). Also fix ocamlnat.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13139 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-18 17:19:53 +00:00
Alain Frisch dfa500533a #5741: make Pprintast available from the command-line (-dsource).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13025 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-17 16:09:38 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Jacques Garrigue 35185d610b merge version/4.00 at revision 12866
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths@12869 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-21 07:10:35 +00:00
Damien Doligez 3836d4086a PR#1898: add -nopromptcont option to suppress secondary prompts
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12085 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-27 12:48:15 +00:00
Jacques Garrigue 477b2dd743 propagate path-expansion environment everywhere
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths@12068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-23 07:59:45 +00:00
Damien Doligez 6b4bb576df PR#352: new option to make ocaml read stdin as a script
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11980 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-30 16:28:16 +00:00
Alain Frisch c1f154ea70 New option to force the compilers to show absolute paths in error messages.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11890 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-20 10:35:43 +00:00