Commit Graph

179 Commits (bdd9ca391e3a56253d7480b07bb1a8aac361904c)

Author SHA1 Message Date
Gabriel Scherer d260a79416 [refactoring] gives tailcall attributes a more standard structure
We want to start allowing more information in the payload of
[@tailcall] attributes (currently no payload is supported), for
example we could consider using [@tailcall false] to ask the code
generator to disable a tail call.

A first required step in this direction is to use a custom datatype to
represent the tail-call attribute, instead of a boolean. This is
consistent with the other application-site
attributes (inline_attribute, specialise_attribute, local_attribute),
so it makes the code more regular -- but the change itself is
boilerplate-y.
2020-06-08 15:39:50 +02:00
Stephen Dolan 0d44a6cfe6 Remove Const_pointer from Lambda and Clambda (#9585)
Lambda and Clambda distinguish Const_int from Const_pointer only so
that they can pass the information to Cmm. But now that that
Const_pointer is gone from Cmm (#9578), there's no need for the
distinction in Lambda either.

This PR requires a bootstrap, because the .cmo format changes:
Lambda.structured_constant has one fewer constructor.  The bootstrap
is in the following commit.
2020-06-02 11:19:20 +02: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
Leo White 59fac074fe
Merge pull request #9349 from lpw25/inline-hint
Add [@inlined hint] attribute
2020-04-17 08:27:58 +01:00
Leo White f46abe1916 Add [@inlined hint] attribute 2020-04-16 15:58:03 +01:00
Gabriel Scherer 1cd6e4451f Map.filter_map and Set.filter_map 2020-03-31 15:01:41 +02:00
Greta Yorsh 824ce35492
Replace caml_int_compare and caml_float_compare with primitives (#2324) 2020-03-26 10:58:10 +01:00
Gabriel Scherer 8938886721 -dno-locations: hide source locations (and debug events) from IR dumps
This PR was tested with also the -dsel, -dlinear output (also fixed to
not-print locations), but the output is architecture-dependent so this
part of the test was removed.
2020-01-09 15:25:16 +01:00
Drup 9c8b63f4ce Annotated Asttypes.constant's string with content location. 2019-11-13 16:08:40 +01:00
Nicolas Ojeda Bar 66f7aed94e Closure: do not substitute mutable variables in function bodies 2019-10-29 12:37:16 +01:00
Thomas Refis 79f1c73462
Warn about unused functor parameters (#8891) 2019-10-14 11:11:01 +01:00
Alain Frisch 5c031d2d3d Decide unboxing of let-bound expressions based on their Cmm translation (#2165) 2019-09-17 10:22:08 +02:00
Vincent Laviron f814450b60 Flambda: prevent recursive approximations in Build_export_info (#8924)
Fixes #8921
2019-09-11 15:28:24 +02:00
Gabriel Scherer eba0d95205 make check-typo happy 2019-09-10 10:58:34 +02:00
Pierre Chambart 039d88a17e Minor refactor in lift_code 2019-09-09 18:36:55 +02:00
Leo White c8b4e45bb7 Flambda: lift mutable lets along with immutable ones 2019-09-09 18:36:55 +02:00
Thomas Refis 4a22aeccb5 warning 60: enable on local modules 2019-08-28 13:24:10 +01:00
Gabriel Scherer 4c303cc88a Merge pull request #8826 from glondu/4.08-spelling-errors
Fix spelling errors reported by Lintian

(cherry picked from commit c808ce7068f3e31975594bcd5e6a41dceab3a80e)
2019-07-29 08:36:53 +02:00
Gabriel Scherer 101cd9e274
Merge pull request #8692 from lpw25/remove-may-map
Remove Misc.may_map and similar
2019-05-24 15:24:33 +02:00
Leo White acd06f1eff Remove Misc.may_map and similar 2019-05-23 16:27:58 +01:00
JPR 6dc59549ce Fixing misspellings 2019-05-21 10:23:27 +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
Mark Shinwell c4272f7fe5 Shorten symbol names of anonymous functions in Flambda mode 2019-03-18 10:57:01 +00:00
Mark Shinwell e141d9e240
Add a few utility functions in Misc (#2284) 2019-03-15 11:28:19 +00:00
David Allsopp 46c32f8ce0 Additional executable file from GPR#614
Subsequently moved!
2019-02-27 10:19:09 +00:00
David Allsopp a16bef478e Remove unnecesary executable bit from sources
Added in cad3b523 in GPR#614 (presumably misconfigured core.fileMode)
2019-02-27 10:09:08 +00:00
Pierre Chambart 1e6c739811
Merge pull request #1579 from chambart/split_backend_primitives
Use a different type for primitives in clambda and lambda
2019-02-14 15:30:37 +01:00
Fourchaux 1946594bd7 Fixing typos in various files (#2246)
Note: Typos found with https://github.com/codespell-project/codespell

Here is the (semi-manual) command used to get (and correct) the typos:

$ codespell -i 3 -w --skip=".png,.gif,./ocaml/boot,./ocaml/.git,./ocaml/manual/styles,./ocaml/manual/manual/htmlman" -L minimise,instal,contructor,"o'caml",cristal,pres,clos,cmo,uint,iff,te,objext,nto,nd,mut,upto,larg,exten,leage,mthod,delte,tim,atleast,langage,hten,iwth,mke,contant,succint,methids,eles,valu,clas,modul,que,classe,missings,froms,defaut,correspondance,differents,configury,reachs,cas,approche,normale,dur,millon,amin,oje,transfert
2019-02-13 14:04:56 +01:00
Pierre Chambart 94b50698ce Rename for_primitive_clambda to for_primitive 2019-02-11 17:16:44 +01:00
Pierre Chambart 6dfd40f72f Push clambda_primitives to flambda 2019-02-11 17:16:44 +01:00
Pierre Chambart 7c5cc144a5 Clean string load/set primitives 2019-02-11 17:16:43 +01:00
Pierre Chambart 55209629d0 Clean Clambda_primitive 2019-02-11 17:16:43 +01:00
Thomas Refis 742c65d30b List.filter_map (#2185) 2018-12-12 16:29:50 +01:00
Alain Frisch 9b27a9c75e
Optimize some local functions (#2143) 2018-11-27 17:54:07 +01:00
Alain Frisch 7a746deed1
Keep more type information in Lambda (#2156)
* Propagate type information about function parameters and return

* Keep value kind on staticcatch parameters
2018-11-23 15:34:05 +01:00
Alain Frisch 7baf33d6ad
Fix PR6638: add dedicated wrning for "unused open!" (#1110) 2018-11-09 13:41:34 +01:00
Daniel Bünzli a7afd89003 s/string_of_int/Int.to_string/g 2018-11-07 13:52:02 +01:00
Armaël Guéneau 6a8c46ff3a Avoid losing information when using Debuginfo.from_location 2018-10-17 11:22:57 +01:00
Thomas Refis fc210f08e4 ident: hide stamp related functions from the interface
The only remaining user was [Predef], which was bumping the counter by
999 to allow cmis to remain compatible if new predefs were defined.
This commit removes that use by making sure that every ident defined in
predef.ml is marked as predef and use a different stamp counter as user
defined idents. That way idents in cmi always start at 1, no matter how
many predefs there are.

Stamps on predef aren't strictly necessary: predefs names are unique.
However, predef idents comparison is just faster with stamps.
2018-09-21 11:47:44 -04:00
Thomas Refis b134588f28 ident: split Local into Local and Scoped
Also rename [create] into [create_scoped] and [create_var] into
[create_local].
2018-09-21 11:47:44 -04:00
Thomas Refis 67f29d1a18 ident: add an explicit scope field
- Ident.create now takes a scope as argument
- added Ident.create_var to use when the scope doesn't matter
- the current_time and the current_level are unrelated as of this
  commit. But one has to remember to bump the level when creating new
  scopes.
2018-09-21 11:47:42 -04:00
Thomas Refis bc9a1de20b middle_end: break a cycle 2018-09-12 16:13:51 +01: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
sliquister ae1317caae Add option to dump the output of e.g. -dlambda in a file (#1913) 2018-07-27 08:51:53 +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
Valentin Gatien-Baron 0444eac687 Print warnings on the warnings formatter in the couple of places that don't
Except the OCAMLPARAM stuff, as that runs before the command line
warning settings are even parsed, so while they are reported using the
normal warnings code, they don't look like normal warnings.
2018-07-15 15:00:47 -04:00
Xavier Clerc cd06e22582 Shadow the polymorphic comparison in the middle-end (#1811) 2018-07-11 13:50:02 +02:00
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00