Commit Graph

380 Commits (bdd9ca391e3a56253d7480b07bb1a8aac361904c)

Author SHA1 Message Date
Xavier Leroy 4aa90e9784
Limit the number of parameters for an uncurried or untupled function (#9620)
This commit introduces a quantity Lambda.max_arity that is the maximal
number of parameters that a Lambda function can have.

Uncurrying is throttled so that, for example, assuming the limit is 10,
a 15-argument curried function fun x1 ... x15 -> e
becomes a 10-argument function (x1...x10) that returns a 5-argument
function (x11...x15).

Concerning untupling, a function that takes a N-tuple of arguments,
where N is above the limit, remains a function that takes a single
argument that is a tuple.

Currently, max_arity is set to 126 in native-code, to match the new
representation of closures implemented by #9619.  A signed 8-bit field
is used to store the arity.  126 instead of 127 to account for the
extra "environment" argument.

In bytecode the limit is infinity (max_int) because there are no needs
yet for a limit on the number of parameters.
2020-06-05 18:45:38 +02:00
Gabriel Scherer bf95a24739 Matching: propagate constructor descriptions in complete_pats_constrs
This simplifies this particular interface boundary between Matching
and Parmatch.

(Suggested by Florian Angeletti)
2020-05-26 15:47:41 +02:00
Thomas Refis e880ec3323 make depend 2020-05-14 10:11:36 +02:00
Gabriel Scherer ffb6caef8b patterns: move Parmatch.Pattern_head into Patterns.Head
The aim is to also move the Simple/Half_simple/General stuff from
matching, but we need to split in those modules the part that are
purely structural (they go in Patterns) and the parts that are
actually compilation logic (Half_simple.of_clause), those stay in
Matching.
2020-05-14 10:11:36 +02:00
Stephen Dolan fc2aee9429 Bootstrap 2020-04-27 12:58:53 +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
Nicolás Ojeda Bär 57d329e07b
Deprecate -annot (#2141)
* Move driver code from Cmt2annot to Read_cmt
* Move cmt2annot.ml into typing/
* make depend
* Use standard error handling
* Move specific logic to read_cmt
* Do not pass full cmt record as argument
* Better locations
* Emit .annot files produced from cmt data
* Remove direct calls to Stypes
* Deprecate -annot
* Changes
* make depend
* Adapt doc
* make -C tools depend
2020-03-13 12:59:34 +01:00
Gabriel Scherer e8d9ec52e2 make depend 2020-03-06 07:03:56 +01:00
Gabriel Scherer 3dacb41fe7 make depend 2020-02-04 11:42:19 +01:00
Rodolphe Lepigre beb750b5ee typedecl_separability: interfaces and basic definitions, implementations missing 2020-01-28 11:39:52 +01:00
Florian Angeletti 40e40a9c20 compilerlibs: expose parsers for 'Longident.t's 2020-01-09 16:45:39 +01:00
Gabriel Scherer 2082059e6e make depend 2019-12-03 14:09:36 +01:00
Stephen Dolan 768dcce48f Use allocation-size info on more than just amd64.
Moves the alloc_dbginfo type to Debuginfo, to avoid a circular
dependency on architectures that use Branch_relaxation.

This commit generates frame tables with allocation sizes on all
architectures, but does not yet update the allocation code for
non-amd64 backends.
2019-10-22 11:47:31 +01:00
Stephen Dolan 787e2d05a7 Apply suggestions from code review, and make depend.
Co-Authored-By: Damien Doligez <damien.doligez@gmail.com>
2019-10-22 11:47:31 +01:00
Florian Angeletti cf5cca65a1 make alldepend 2019-10-18 18:24:08 +02:00
Vincent Laviron 60f58174ba
Split cmmgen into generic cmm helpers and clambda-specific transformations (#1963) 2019-10-04 17:49:59 +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
Gabriel Scherer 776fcc3919 make depend 2019-09-25 11:45:33 +02:00
Jeremie Dimino 2d31ebfc8b Add support for [@@immediate64]
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-09-24 07:56:15 +01:00
Greta Yorsh 0b6b544fcb Split Linearize into two modules
Separate the description of the IR from the transformations
performed on it by moving type declarations from linearize.ml
into their own file, called linear.ml.
2019-09-04 11:55:11 +01:00
Stephen Dolan 5ad64306d3
Merge pull request #8713 from kayceesrk/r14-globals
Move C global variables to a dedicated structure
2019-08-27 13:30:22 +01:00
Valentin Gatien-Baron f40011556c in -dtimings output, show time spent in C linker clearly 2019-08-26 07:58:28 +02:00
Valentin Gatien-Baron ebc6bb8013 make depend 2019-08-26 07:58:28 +02:00
KC Sivaramakrishnan ad96dec89c Use domain state field names that do not conflict with compatibility.h
The domain state structure (caml_domain_state) uses certaing field names
(young_start, young_limit, etc.) that conflict with the macro
definitions in compatibility.h that use the same names. These macro
definitions are made only when CAML_NAME_SPACE is not defined. To avoid
conflict, when CAML_NAME_SPACE is not defined, we prefix the field names
in caml_domain_state with an underscore.

Update .depend files.
2019-08-23 09:59:53 +05:30
KC Sivaramakrishnan 0d19da48d4 Make depend. Fix reference to ref table. 2019-08-23 09:50:05 +05:30
Gabriel Scherer e5db889f4d make depend 2019-08-19 15:40:48 +02:00
Leo White 74e1a85b72 Update depends 2019-07-10 19:23:21 +01:00
Gabriel Scherer df631380ba actually remove tools/addlabels.ml, leftover from #8663 2019-06-19 16:46:01 +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
Isaac Avram 87f999734b Merge remote-tracking branch 'origin/trunk' into tast_iterator2 2019-03-25 13:49:04 -07:00
Isaac Avram da0743ca17 Updated depend file 2019-03-23 21:21:55 -07:00
Mark Shinwell dbede46c2e
Improve the packing mechanism used to build Dynlink (#2268) 2019-03-19 10:26:35 +00:00
Mark Shinwell e3a62eef91
Add Compute_ranges pass (#2291) 2019-03-18 08:52:34 +00:00
Mark Shinwell 2cc1ea26b9 Remove gprof support (#2314)
This commit removes support for gprof-based profiling (the -p option to ocamlopt).  It follows a discussion on the core developers' list, which indicated that removing gprof support was a reasonable thing to do. The rationale is that there are better easy-to-use profilers out there now, such as perf for Linux and Instruments on macOS; and the gprof support has always been patchy across targets. We save a whole build of the runtime and simplify some other parts of the codebase by removing it.
2019-03-16 19:56:53 +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
Mark Shinwell 7cb0da58f1
Don't generate Clambda constants during Cmmgen, etc. (#2280) 2019-03-05 17:09:40 +00:00
Mark Shinwell 3133699187
Add bytecomp/opcodes.mli (#2265) 2019-02-26 16:17:38 +00:00
Gabriel Scherer 93f0ce31bb env refactoring: separate the cmi/crc handling into a persistent_env module
Persistent_env is a new module that handles the relation between the
type-checking state and the "persistent" typing information laying in
.cmi files on the filesystem. In particular, it handles the collection
and production of CRC information for the .cmi files being read and
written to the filesystem; the using modules (in our case, only Env)
are in charge of turning the cmi files into higher-level information
(components and signatures).

Persistent_env exposes a type `'a t` of a persistent environment,
which acts as a mutable store of `'a` values. There is no global state
in the module itself: while Env (and thus the OCaml type-checker) uses
a single global persistent environment, it should be possible to
create several independent environments to represent, for example,
several independent type-checking sessions.
2019-02-18 17:02:47 +01:00
Pierre Chambart 9f9dc9bae6 Update .depend 2019-02-11 17:16:44 +01:00
Gabriel Scherer 96c6bc533e make depend (from the future) 2019-01-30 22:37:13 +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
Damien Doligez 6bbb913693 last commit before branching 4.08 2019-01-18 15:29:36 +01:00
Nicolás Ojeda Bär fe617f638f Remove unnecessary ocamldep call 2019-01-12 08:57:12 +01:00
Gabriel Scherer 567d5cc80b make depend 2018-12-13 18:37:23 +01:00
Gabriel Scherer 295f71cb96 make alldepend (with new one-dep-per-file printing) 2018-12-12 09:38:49 +01:00
Thomas Refis f9b8935b2e
make alldepend (#2181) 2018-12-03 18:15:28 +01:00
Gabriel Scherer 7aad17adac make depend 2018-11-28 04:48:55 +01:00
Runhang Li 97329f30ed Extend `open` to arbritrary module expressions in structures and to
applicative module paths in signatures
2018-11-26 16:20:37 +00:00
Rodolphe Lepigre ca227428f4 Typedecl: split immediacy to a separate unit Typedecl_variance
get_unboxed_type_representation is used in several other modules, and
split into its own Typedecl_unboxed unit.

(pair-programming with Gabriel Scherer)
2018-11-23 12:05:33 +01:00