Commit Graph

78 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
Florian Angeletti 7d3a3f8c24
Merge pull request #9416 from lpw25/fix-warning-58-flambda-ocamlnat
Avoid warning 58 in flambda ocamlnat
2020-06-26 09:37:41 +02:00
Leo White 9e61a063c3 Avoid warning 58 in flambda ocamlnat 2020-06-25 14:45:45 +01:00
Leo White 62e286a1c7 Fix unused functor argument warning in toplevel 2020-06-14 08:38:03 +01:00
Stephen Dolan 2986beaa78 Replace Location.t with Lambda.scoped_location in Lambda code
This commit threads scopes through translation from Typedtree to
Lambda, extending the scopes when entering functions, modules,
classes and methods.
2020-04-27 12:58:53 +01:00
Gabriel Scherer a30e621190 toplevels: label the wrap_mod argument 2020-04-17 19:30:07 +02:00
David Allsopp 221fee0d85 Fix the native toplevel too... 2020-04-17 16:54:37 +01:00
Jérémie Dimino e54876a869
Add a new toplevel directive #use_output "<command>"
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
2020-03-16 17:48:41 +00:00
Thomas Refis 8e928caea7
a better representation for modules with no name (#8908) 2019-10-09 14:15:37 +01:00
Florian Angeletti afb90bdf74
Merge pull request #8988 from Octachron/fix_ocamlnat
Fix ocamlnat
2019-09-27 17:15:26 +02:00
Florian Angeletti 4efa0a21a8 Fix ocamlnat
use the right name for the intermediary obj file
2019-09-27 14:12:06 +02:00
Daniel Bünzli 17ef076000 .ocamlinit: XDG base directory lookup. (#8834) 2019-09-25 13:50:25 +02:00
Mark Shinwell 6cbdfad125 Move some code from Asmgen to the middle end directory etc. (#2288)
Followup to (#2281)
2019-05-10 15:11:22 +02:00
Mark Shinwell 72ea849d2a
Move some middle-end files around (#2281)
* Various file moves in the middle end: this is the first stage of improving separation between the middle end and backend.
* Creation of file_formats/ directory (with associated file moves) to hold the definitions of compilation artifact formats.
* Creation of lambda/ directory (with associated file moves) to hold Lambda language definition files, transformation passes and construction passes from Typedtree.
* Disable (hopefully temporarily) dynlink, debugger and ocamldoc for the dune build.
2019-04-01 17:18:47 +01:00
Stephen Dolan 18edce3b5f Remove use of Obj.truncate from toplevel.
When running a script with "ocaml foo.ml", the toplevel needs to
run foo.ml with a different Sys.argv than the initial value, since
foo.ml must not see the initial "ocaml" argument.

Previously, this was done with Obj.truncate to shorten the Sys.argv
array. This patch changes it by introducing a primitive %sys_argv.
Uses of this primitive expand to a call to a new C primitive, which
returns the argv array (and can be modified by the toplevel).
2019-04-01 14:14:00 +01:00
Mark Shinwell 36c163248d Remove support for compiler plugins (#2276)
After consultation on the core developers' list I am proposing this patch to remove support for compiler plugins.

The main motivations for removing compiler plugins are:
- They are a potential security risk.
 - They increase the complexity of the build system and make maintenance of the Dynlink libraries more difficult (although actually, this complexity could probably be reduced after #2268 is merged).
 - Many applications of plugins should be able to be expressed by building custom compiler drivers that link against compilerlibs.

* Remove compiler plugins and hooks
* Add new function Dynlink.unsafe_get_global_symbol but keep it outside the documented API.
* Remove otherlibs/dynlink/nodynlink.ml
* Update Changes
2019-03-13 11:46:37 +01: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
Thomas Refis f498c22e7a ocamlnat 2018-11-26 16:25:48 +00:00
Leo White 111d4e1827 Remove positions from paths 2018-11-21 03:39:34 -05:00
Mark Shinwell 6526a0c3d9 Make (nat)dynlink sound 2018-11-12 17:44:26 +00:00
Thomas Refis 6805595f57 introduce local substitutions in signatures
type [params] id := type_expr { and [params] id := type_expr }
    module Uid := extended-module-path
2018-11-09 16:43:43 +00:00
Geoff Gole aa14e7ab13 Fix #mod_use raising exception (MPR#7867) 2018-10-27 14:25:23 +08:00
Jérémie Dimino 9124ab82d1
Deprecate Pervasives (#1605)
- inline Pervasives in Stdlib and re-add Pervasives as a deprecated
module that aliases all elements of Stdlib except the stdlib modules.

- remove special case for Stdlib.Pervasives in printtyp.ml
2018-08-27 12:42:14 +01:00
Armaël Guéneau c0820e30cb Location: significantly rework the code printing errors and warnings 2018-08-08 17:42:08 +02:00
Hugo Heuzard c4dd1e67b5 Add locations to toplevel directives 2018-08-06 11:06:30 +01:00
sliquister ae1317caae Add option to dump the output of e.g. -dlambda in a file (#1913) 2018-07-27 08:51:53 +01:00
Thomas Refis 2403ffb1b5 typemod: allow items coming from includes to be shadowed 2018-07-25 13:06:38 +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
Florian Angeletti 349db3d869
PR#6416 et al.: injective mapping between identifiers and printed names (#1120) 2018-06-26 22:03:45 +02:00
Jacques Garrigue 3d33bd4ef5
Fix MPR#7751 (#1657)
Fix the toplevel printer, to have it properly load needed cmi's.
2018-03-27 09:25:28 +09:00
Pierre Chambart 6bfa23c08b Replace uses of Lambda.IdentSet by Ident.Set 2018-01-30 19:12:29 +01:00
Valentin Gatien-Baron bf96a7ac42 display the output of -dtimings as a hierarchy 2017-03-07 15:43:57 -05:00
Christoph Höger 0a735b71ba Actually use simplified lambda
Passing the original lambda might lead to illegal remnants of Lifused in the code passed to closure.ml (which will in turn raise an assertion error). This costed me a whole afternoon, I really wish there was a supported, native (or better: agnostic) toplevel.
2016-10-10 16:28:12 +02:00
Fabrice Le Fessant d1418bc031 Remove dependency on Dynlink in ocamlnat 2016-07-18 17:49:52 +02:00
Fabrice Le Fessant bfc36003aa Add hooks on some compilation phases 2016-07-12 17:59:58 +02:00
Pierre Chambart 1624c8e7a0 Also remove the forced dependency dummy code hack for closure
This also share the result type of transl_implementation_flambda
and transl_store_implementation
2016-07-08 16:02:26 +02:00
Pierre Chambart cb388c762a Some cleanup to explicit transl_implementation_flambda return values 2016-07-08 16:02:26 +02:00
Pierre Chambart 7286a4978f Allow to force linking modules without generating dummy code 2016-07-08 16:02:26 +02:00
Mark Shinwell 5f00ce793e Improve location handling in the middle end (version for merging) (#666) 2016-07-06 15:42:29 +01:00
Damien Doligez 4a2107be8d Merge pull request #575 from shindere/toplever-no-version
Add the -no-version option to the toplevel.
2016-05-10 11:31:26 +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
Sébastien Hinderer 50147913ac Call the '#' sign hash rather than sharp. 2016-05-09 16:34:40 +02:00
alainfrisch 83ae23568c Renaming block_kind -> value_kind. 2016-04-12 14:49:50 +02:00
alainfrisch 932d806937 Fix for ocamlnat. 2016-04-12 14:49:48 +02:00
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +01:00
Jeremie Dimino 86daba0e90 Add Toploop.override_sys_argv 2016-03-01 10:36:24 +00:00
Jeremie Dimino b98461c3f3 Add Misc.protect_refs 2016-03-01 10:36:24 +00: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
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00