Commit Graph

712 Commits (082bdf545d178ac87e48f26db5b9bf34df05b675)

Author SHA1 Message Date
Leandro Ostera ee2f3b428c
Move typed_impl to Typedtree.t 2020-11-05 19:06:12 +01:00
Leandro Ostera f6e428acf2
Introduce typed_impl record 2020-11-05 18:29:45 +01:00
Leandro Ostera 3a125b8c3c
Expose module signature when typing implementation
While working on a new backend for OCaml to generate Erlang sources, I
found the need to read the .cmi file back into a `Types.signature`
value.

@Drup spotted that I was reading the file and pointed out this value was
already being read during the type checking process.

A quick check at the `Typedtree.module_coercion` showed us that it would
be difficul to extract the same information that is readily available in
the signature value.

This change will expose the signature value directly, so other backends
relying on this signature information do not need to do the extra work
of reading it again.
2020-11-05 17:33:19 +01:00
Xavier Leroy 426b10c6a8
Provide semaphores in the threading library (#9930)
This commit adds a new thread-related module Semaphore, implementing
counting semaphores and binary semaphores.

The two kinds of semaphores are presented as two different
abstract types in two sub-modules, Counting and Binary.
2020-10-12 19:09:52 +02:00
Nicolás Ojeda Bär 5381e13626
Fix handling of Exit_compiler exception in toplevel (#9798) 2020-10-05 09:46:20 +02:00
octachron 1393a37509 ocamldoc: fix printing of (::) 2020-09-07 11:07:10 +02:00
Sébastien Hinderer 8087f7f1c5 Build system: simplify installation rules
Now that programs are built with their $(EXE) suffix, their installation
rules can be simplified a bit because most of the programs get installed
under the name they have been built with.
2020-06-18 11:16:58 +02:00
Sébastien Hinderer bdd9ca391e Add the $(EXE) suffix to all programs at build rather than install time
This commit touches neither boot/ocamlc nor boot/ocamllex

It has the side-effect of fixing the cleanup rules which did not use the
$(EXE) extension when removing a file although it was produced with the
$(EXE) extension.
2020-06-18 11:16:55 +02:00
Sébastien Hinderer 433485b8b5 ocamldoc: remove debugging facility 2020-06-09 12:30:44 +02:00
Stephen Dolan f75d5f3174 Use Odoc_global.library_namespace for index alias removal 2020-05-25 11:12:28 +01:00
Stephen Dolan 6b214f5138 Ensure stdlib documentation index refers to Stdlib
Previously, some references were to Pervasives and some were missing.
2020-05-18 19:15:05 +01:00
Florian Angeletti c86a5d8d11
#9189: avoid one-letter make variables (#9281) 2020-05-11 12:21:59 +02:00
Gabriel Scherer fab58a938a makefiles: move the inclusion of Makefile.build_config in Makefile.common 2020-05-06 12:10:02 +02:00
David Allsopp ac2a9dd188 Cease committing C dependendency information
When building for the first time, the only requirement is that generated
header files have been built (jumptbl.h, version.h and opnames.h).
Detailed dependency information is only required when headers have been
edited.

COMPUTE_DEPS in Makefile.config controls whether C dependency
information should be generated on a per-file basis. This variable is
controlled by a new --disable-dependency-generation in configure which
is enabled for Git checkouts and disabled for tarballs (i.e. releases).

The Microsoft C compiler (cl) cannot generate dependencies in a
consistent way which we can consume, so for a Git checkout configure
searches for an additional C compiler in order to compute dependencies.
This is obviously not required for a user-build.

As a result, the MSVC port can now safely run make alldepend, since only
OCaml dependency information is committed to the repo after this change.

CI does not need to waste time testing the dependency information,
because it only tests a single build. A single Travis job has been added
which tests the build system code to generate the dependency information
(and provides a single `make -j` run in CI, although Inria's CI also
tests parallel building continuously).
2020-04-17 14:11:22 +01:00
David Allsopp 3a40b2fd94 Introduce Makefile.build_config.in
This moves the configure-generated parts of Makefile.common to a
separate (generated) Makefile, allowing Makefile.common to be a normal
Makefile.

OCaml's build system Makefile's now include Makefile.build_config (which
itself includes Makefile.config) but Makefile.config is still installed
as before. This allows configure to generate variables which are
specific to the build process and are not intended to be exported to the
installation.
2020-04-17 13:53:49 +01:00
David Allsopp 9c5d7c1112 Correct implementation of --disable-stdlib-manpages 2020-02-26 15:07:17 +00:00
David Allsopp 13786d7d12 Ensure make distclean works on an unconfigured tree 2019-10-15 11:46:36 +01:00
David Allsopp d4a566573f Allow make to be invoked before configure
This should be improved to give better warnings for when Makefile.config
and Makefile.common are required.
2018-12-04 10:28:36 +00:00
Thomas Refis d52dd5c33e Add a unique id to every signature item 2020-03-05 13:34:12 +01:00
David Allsopp 504d95c275 Fix formatting of closing brace in records 2019-11-21 12:06:53 +00:00
Gabriel Scherer 9ef833b0a6 ocamldoc man: use .EX..EE in multi-line code blocks
(Suggested by Florian Angeletti)
2019-11-14 11:35:04 +01:00
Gabriel Scherer 757a64464f ocamldoc: better support of multiline code blocks in the manpage backend
Before, `man Map` would show:

```
For instance: module IntPairs = struct type t = int * int let compare (x0,y0) (x1,y1) = match Stdlib.compare x0 x1 with 0 -> Stdlib.compare y0 y1 |
c -> c end module PairsMap = Map.Make(IntPairs) let m = PairsMap.(empty |> add (0,1) hello |> add (1,0) world )
```

Now it shows:

```
For instance:
     module IntPairs =
       struct
         type t = int * int
         let compare (x0,y0) (x1,y1) =
           match Stdlib.compare x0 x1 with
               0 -> Stdlib.compare y0 y1
             | c -> c
       end

     module PairsMap = Map.Make(IntPairs)

     let m = PairsMap.(empty |> add (0,1) "hello" |> add (1,0) "world")
```

(in both cases the code is in bold)
2019-11-14 11:31:05 +01:00
Thomas Refis 79f1c73462
Warn about unused functor parameters (#8891) 2019-10-14 11:11:01 +01:00
Gabriel Scherer a06a8c0012 ocamldoc Makefile: use .opt versions of the build tools when available
On my machine, a sequential build of (make all allopt) goes from 31s
to 11s, and a parallel build (-j5) goes from 16s to 6s.
2019-10-12 10:23:29 +02:00
Thomas Refis 8e928caea7
a better representation for modules with no name (#8908) 2019-10-09 14:15:37 +01:00
Gabriel Scherer e232369580
Merge pull request #8835 from dra27/save-the-planet
New configure option to disable building and installing library manpages
2019-10-05 16:52:16 +02:00
Gabriel Scherer 5fc29e52a4
Merge pull request #8992 from Octachron/shared_args
Share argument implementations
2019-10-01 12:08:54 +02:00
Jacques Garrigue 1e895dbaee
Allow compiling ocamldoc with -principal (#8955)
Also solves issue #6922
2019-09-30 21:14:06 +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 f6a72e3578 Cleanup ocamldoc pre-arguments
This commit removes all pre-arguments that were defined in
Odoc_args but never turned into actual arguments.
2019-09-30 15:56:40 +02:00
David Allsopp 0912745754 Make STDLIB_MANPAGES a boolean, not a target 2019-09-27 17:13:42 +01:00
David Allsopp 2d717cb71a Add --disable-stdlib-manpages to configure 2019-09-27 17:13:24 +01:00
Gabriel Scherer 9067d0e3b9 explanatory comment on when 'ocamlrun ocamldoc' fails 2019-08-30 10:20:09 +02:00
Gabriel Scherer 4cde3f72e2 ocamldoc: remove an obsolete test
The odoc_fhtml file required by this test seems to have been part of
the ocamldoc distribution sometime in the distant past (see
27934ab79a from 2002) but I can't find
traces of it in the git history of the compiler distribution.
2019-08-30 09:59:27 +02:00
Gabriel Scherer bb1be5dd17 ocamldoc/Makefile: use ocamldoc.opt when available 2019-08-30 09:59:27 +02:00
Gabriel Scherer 2bbf7caa72 ocamldoc: build manpages explicitly in root Makefile 2019-08-30 09:57:18 +02:00
Gabriel Scherer 5e53c93489 ocamldoc/Makefile: manpages don't need generators anymore, odoc_man is builtin 2019-08-30 09:57:18 +02: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 a34c3e3ee5 make alldepend 2019-07-28 11:46:44 +02:00
Gabriel Scherer f4766cf0bb ocamldoc: reimplement a slow function
With this minor change to a naively-implemented function, manpage generation
for the compiler (stdlib + compiler-libs) goes from 1.8s to 0.4s on my machine.
2019-07-27 09:35:42 +02:00
Gabriel Scherer df631380ba actually remove tools/addlabels.ml, leftover from #8663 2019-06-19 16:46:01 +02:00
Leo White acd06f1eff Remove Misc.may_map and similar 2019-05-23 16:27:58 +01:00
Sébastien Hinderer a201ade7f3 Build system: make ocamllex silent by default (#8664)
This commit makes e.g. make -s world.opt completely
silent when everything works, in order to increase the visibility of
any unexpected message occurring during the build.
This will be useful for instance during CI, in particular it should
make it easier to catch undefined build variables.

The implementation is straightforward. The OCAMLLEX_FLAGS variable is
defined in Makefile.common.in and then used consistently by all
lexing recipes.

In addition, in tools/Makefile, the two rules producing the lexers
from cvt_emit.mll and make_opcodes.mll have been replaced by a
pattern-rule and the useless .SUFFIXES target has been removed.
2019-05-07 11:32:05 +02:00
Nicolás Ojeda Bär 8897fe60cc make clean: do not remove emacs backups 2019-04-10 14:18:04 +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 dbede46c2e
Improve the packing mechanism used to build Dynlink (#2268) 2019-03-19 10:26:35 +00:00
Jérémie Dimino c413136fa3 Delete otherlib/{graph,win32graph} (#2318)
The Graphics library is now distributed as a separate package.
The sources are at https://github.com/ocaml/graphics .

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-03-18 15:05:57 +01: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
David Allsopp 6e84987715 Restore -vmthreads flag as an error (#2312)
This GPR restores -vmthread with an adapted version of the deprecation message as an error message and also keeps the use_vmthreads part of ppx contexts.

* Partially revert #2289
* Convert -vmthread to an error
* Neuter use_vmthreads in ppx context
* Remove Clflags.use_vmthreads
2019-03-13 10:46:30 +01:00