Commit Graph

120 Commits (bdd9ca391e3a56253d7480b07bb1a8aac361904c)

Author SHA1 Message Date
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
Gabriel Scherer 95bdcd3856 Compile_common: turn `init` into continuation-passing `with_info`
I think this clarifies the fact that the `info` value is a resource that
has a limited lifetime. The new API lets us create (and close) the ppf_dump
directly from `Compile_common.with_info`, simplifying the API for user.
2019-01-05 12:12:20 +01:00
Gabriel Scherer c6d95c9ef6 Compile_common.init: make ppf_dump a labelled argument 2019-01-04 18:51:14 +01:00
Gabriel Scherer a75fc10076 driver/compile_common: refactor interface/implementation entry points 2019-01-04 18:09:44 +01:00
Gabriel Scherer 2ef45b3621 driver: consistently use _ as word separator 2019-01-04 17:56:12 +01:00
Valentin Gatien-Baron c93d080f13 Compile_common.implementation 2018-08-04 16:08:54 +02:00
Gabriel Scherer ebc34d5115 compile_common: remove wrap_compilation
wrap_compilation makes the compilation pipeline non-modular by
exposing a split between two fixed passes, a frontend and a backend,
in a .mli interface. I need a finer-grained interface for a feature
I've been using in my Menhir-parser branch, and it is likely that
other users also will need to be finer-grained than that.

This PR pushes the error/ressource handling contained with
wrap_compilation into its producers (note: this change assume that
only typecheck_impl needs Stypes.dump, and that only the optcompile
backend may generate `obj` and `cmx` files), so that the logic in
"wrap" becomes very simple, and then inlines it in the two users in
{opt,}compile.ml.
2018-08-04 16:07:51 +02:00
Drup abc0b7e3ed Add compile_common.ml which contains the basic compilation pipeline.
Factorize the part from compile.ml and optcompile.ml.
2018-07-27 15:07:43 +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
Nicolás Ojeda Bär 40bab2d768 Implement reviewer suggestions 2018-07-25 17:58:32 +02:00
François Bobot da3f9f34f5 Use reraise_raw_backtrace in Misc.try_finally
And add labels ~always for previous cleanup function and
    ~exceptionally for new cleanup function in exceptional case
2018-07-25 17:58:32 +02:00
Thomas Refis 2b30f13622 remove redundant calls to simplify_signature
Simplification is already done in Typemod.type_interface.
2018-07-25 12:48:10 +01:00
Valentin Gatien-Baron 3d0299a185 Create warning 64, for uses of -unsafe with a -pp that returns a marshalled ast
Instead of the current print to stderr. This way it's treated the same
as other warnings: it has a position, colors, can be made an error,
disabled, goes in the expected formatter, is documented.
2018-07-15 15:08:38 -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
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01: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
sliquister 3f76c0525b generalize -dtimings to show allocation, top heap size (#1152) 2017-06-09 12:29:21 +01:00
Valentin Gatien-Baron bf96a7ac42 display the output of -dtimings as a hierarchy 2017-03-07 15:43:57 -05:00
Valentin Gatien-Baron 81dafd7ee2 making -dtimings include time spent typing mli's 2017-02-01 16:24:20 -05:00
Fabrice Le Fessant 2ecd3f43e4 Fix order of arguments with -cclib XXX (#761) 2016-12-14 13:14:21 +00:00
Fabrice Le Fessant bfc36003aa Add hooks on some compilation phases 2016-07-12 17:59:58 +02:00
Pierre Chambart 25d24e38c2 Also remove linking hack for bytecode
Adds the required_globals information to bytecode compilation units.

This patch also bootstrap ocamlc. The cmo format is changed by this
commit, there is no way around bootstraping here. Note that ocamldep and
ocamllex does not rely on the cmo format, so they are not present in
this commit.

Changes in tests:

* Update test/transprim/comparison_table.ml.reference:
    The (opaque (global List!)) expression is not present anymore

* Update tests/no-alias-deps/aliases.cmo.reference
    The output of objinfo changed
2016-07-08 16:02:26 +02: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
Mark Shinwell bde2bdd206 Reformatting only (to the standards of tools/check-typo) 2016-02-10 18:28:38 +01:00
Damien Doligez 1c28b231ef Revert "PR#6475: accept -o in ocamlc when compiling C files"
This reverts commit 1d8e590c54.

Conflicts:
	Changes
	bytecomp/bytelink.ml
	driver/optcompile.ml
	ocamlbuild/ocaml_specific.ml
	ocamlbuild/testsuite/internal.ml
	utils/ccomp.ml
2016-02-10 10:34:02 +01:00
Pierre Chambart b05b5f71f5 Remove last use of Timining.start/stop in {opt,}compile.ml 2015-12-18 13:35:44 +00:00
Pierre Chambart 828e78d4a4 Avoid using Timings.start/stop 2015-12-18 13:35:44 +00:00
Pierre Chambart 233e1b1791 Record compiler runtime 2015-12-18 13:33:10 +00:00
alainfrisch 7ad212045f Add module to deal with 'front-end' built-in attributes. 2015-12-02 14:46:14 +01:00
alainfrisch 945d0c7d7a Keep deprecation flag on compilation unit, extracted from a floating attribute in the .mli file. 2015-11-27 19:13:56 +01:00
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Gabriel Scherer 1d8e590c54 PR#6475: accept -o in ocamlc when compiling C files
(Vincent Laporte, Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15734 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 12:18:07 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +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
Alain Frisch f0ef09de26 Expose a Typemod.type_interface (currently an alias of Typemod.transl_signature) by symmetry with type_implementation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14759 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 12:46:00 +00:00
Jérémie Dimino c31d2ab685 revert commit 14728
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14729 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-03 09:07:14 +00:00
Jérémie Dimino f0b74bd726 -o sets the module name
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14728 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 16:44:09 +00:00
Alain Frisch e01f145c2e More direct style, remove the temporary file created by -pp processor right after it has been read.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14085 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-10 13:48:43 +00:00
Alain Frisch 0769ab46a7 Introduce and use higher-level wrappers around parsing routine for .ml/.mli files, taking care of -pp and -ppx preprocessors.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14084 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-10 13:44:34 +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
Damien Doligez 726da0bdfc fix whitespace and over-long lines
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13429 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-22 18:19:54 +00:00
Damien Doligez 7b31f54095 It is no longer necessary to keep pre-processed files in case of errors
(see commits 3817 and 5224,5302,5816)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13406 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-18 20:13:53 +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 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
Fabrice Le Fessant d39d43e55f merge with branch bin-annot
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-30 14:52:37 +00:00
Alain Frisch 05c973e6ed Compile with warning 33, and remove unused opens.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12497 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-29 11:10:03 +00:00