Commit Graph

68 Commits (master)

Author SHA1 Message Date
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
Gabriel Radanne 1be47bf7ab Just some tbl things. (#1699) 2018-07-23 13:19:41 +01:00
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00
Stephen Dolan aa1dc8063a Remove Meta.static_{alloc, free}.
The bytecode runtime now represents code to be loaded as LongString.t,
rather than as a naked pointer to a bytecode block.

(This commit breaks Dynlink of bytecode, due to an issue about digests)
2018-04-13 16:29:33 +01:00
Damien Doligez e52f39cbe9 Revert "Replace constant pointers by regular integers (#1580)"
This reverts commit 022051e7bd.
2018-04-06 16:09:53 +02:00
Hugo Heuzard ad6304d7ec Rename instructions GET/SETSTRINGCHAR -> GET/SETBYTESCHAR 2018-03-15 18:25:31 +01:00
Hugo Heuzard 1c233b6b69 Add bytecode instruction to access string, different from the bytes one. 2018-03-15 18:25:31 +01:00
Vincent Laviron 022051e7bd Replace constant pointers by regular integers (#1580) 2018-03-15 09:57:53 +00:00
Gabriel Scherer 6c558779da honor the BUILD_PATH_PREFIX_MAP variable if it exists:
<https://reproducible-builds.org/specs/build-path-prefix-map/>
2018-03-01 17:54:16 +01:00
Leo White 1671e5a3af Treat negated float comparisons more directly (#1487)
* Add float comparison test

* Treat negated float comparisons more directly

* Add Changes entry
2018-02-28 14:19:46 +01:00
Thomas Refis 74c9dfaa59 emitcode: merge events after instructions reordering 2018-02-19 11:02:32 +00:00
hhugo b14e6fee9b Compiler: -compat-32 flag when building cmo/cma. (#896)
* Complier: -compat-32 flag when building cmo/cma.

Compiler: refactor -compat-32 support

Update Changes

Complier: more -compat-32 checks in emitcode.

* add tests for the -compat-32 flag
2017-05-05 07:18:40 +01:00
Xavier Leroy 56ff448d1f Make -linkall applicable to single compilation units
With this commit, "ocamlc -c -linkall" or "ocamlopt -c -linkall" produce object files that have the "force link" flag set.  Once put in library files (.cma/.cmxa), these object files will always be linked when the library is linked, even if no definition from the object file is referenced.  However, other object files in the library can still be removed if none of their definitions are referenced.

In this respect, we get finer-grained control on which object files should always be linked, typically because they contain important initialization code.
2017-01-15 20:48:39 +01: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
Damien Doligez b860d63145 whitespace cleanup, cut long lines, add some missing headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-11 11:58:31 +00:00
Gabriel Scherer 304c9c91a5 PR#6468: toplevel now supports backtraces if invoked with OCAMLRUNPARAM=b
(Peter Zotov and Jake Donham,
 review by Gabriel Scherer and Jacques-Henri Jourdan)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15830 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-08 14:10:12 +00:00
Damien Doligez 031cffd155 merge branch 4.02 from release 4.02.0 to release 4.02.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-15 13:34:58 +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
Fabrice Le Fessant 457958a9e6 Add reset functions to make modules reentrant when used through compiler-libs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14770 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 12:01:21 +00:00
Jacques Garrigue 1ce29d9bfc re-commit Leo's weak-dependencies pull request
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14755 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 00:34:20 +00:00
Jacques Garrigue 95104b3924 revert commit 14719
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14723 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 06:19:55 +00:00
Mark Shinwell 521ac0213a weak dependencies with -trans-mod (github/ocamllabs/weak-depends 45e980a,21856a7,merge)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14719 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-01 12:50:20 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Gabriel Scherer 2b9f94b69b PR#6270: remove need for -I directives to ocamldebug in common case
(patch by Josh Watzman)

Add absolute directory names to bytecode format for ocamldebug to use

The need for a long list of -I directives makes interactively using
ocamldebug a pain in the butt. Many folks have solved this with various
`find` invocations or even Python wrappers, but those lead to other
problems when it might include files you weren't expecting (or miss
things you were). But all of this is really annoying since the tooling
should be able to figure out itself, even heuristically, where your
source files are -- gdb gets this right, why can't we?

This patch implements one of the more important heuristics from gdb: you
typically debug on the same machine you built on, so looking for the
source files and built artifacts in the absolute paths where they were
during compilation is a good first try. We write out absolute paths into
a new structure at the beginning of the debug section and then
automatically append those directories into the load path.

This means mean that if you happen to be debugging on a machine
where the original source and build artifacts are *not* available in
their original absolute locations, things will work as before, using the
standard load path mechanism. You can also explicitly use -I to prepend
directories to the load path and override the defaults located by this
new mechanism.

I personally find this makes using ocamldebug much more pleasant :)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14533 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-06 15:06:22 +00:00
Gabriel Scherer 57fe3746f6 Revert "PR#6270: remove need for -I directives to ocamldebug in common case (patch by Josh Watzman)"
There seems to be a problematic interaction with backtrace collection. To test this,
  make world.opt
  cd testsuite
  make one DIR=tests/backtrace/

This needs to be sorted out before the patch can go in again.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14510 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-31 14:55:06 +00:00
Xavier Clerc dd7bd5b339 PR#6270: remove need for -I directives to ocamldebug in common case (patch by Josh Watzman)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14507 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-31 11:48:35 +00:00
Alain Frisch 0915cb5b5f Rename raise_nostack -> raise_notrace. Expose it in Pervasives.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14225 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-14 13:52:14 +00:00
Alain Frisch f31325cbaf #6203, #5935: variants of raise. 'reraise' is currently only inserted by the compiler when an handler does not catch the exception. The default 'raise' always start with a fresh backtrace. There is also 'raise_nostack' which does not trigger the stack trace recording. Bytecode only for now.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14223 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-14 12:31:50 +00:00
Gabriel Scherer e92b63fc21 PR#5957,PR#5920,PR#5925: LongString module to workaround 32bits string size limitations during bytecode linking (patch by Benoit Vaugon and Chet Murthy)
In PR#5925, Benoît Vaugon initially proposed the LongString module to
solve an issue with bytecode blocks of size > Sys.max_string_length on
32 bits architecture (16Mio). In PR#5957, Chet Murthy made small
changes to also fix the problem of debug information going above this
16Mio limit.

The LongString module should be reusable in other parts of the
compiler, should new 32bit-string-length issues arise.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13547 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 09:07:00 +00:00
Damien Doligez c63f9e0957 fix a few problems with whitespace and over-long lines
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13393 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-09 22:38:52 +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
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Damien Doligez 04b1656222 clean up spaces and tabs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9547 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-01-22 12:48:24 +00:00
Alain Frisch 1ba87b442b Output references to the native version of the primitives in ocamlopt
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8930 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2008-07-24 05:35:22 +00:00
Xavier Leroy 09921987cc Deplacement des infos de format des .cmo et .cma dans Cmo_format
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7422 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-05-11 15:50:53 +00:00
Jacques Garrigue 6a940ef65d switch to new vtable representation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6331 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-05-26 11:10:52 +00:00
Xavier Leroy 426afa35eb Pour l'option -pack, permettre de donner une interface explicite (via un .mli) au module synthetise
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5422 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-03-06 15:59:55 +00:00
Xavier Leroy 320487c59f Revu gestion des backtrace; suppression de RERAISE, utiliser l'adresse de l'objet exception a la place
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4040 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-11-26 12:47:03 +00:00
Xavier Leroy 343d49401a Revu gestion des DLLs: ne pas les utiliser en mode -custom; dans les .cma et .cmxa, stocker separement les options pour linker statiquement (-cclib) et par chargement dynamique (-dllib).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3949 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-10-30 09:32:32 +00:00
Luc Maranget e7d2a4ed93 corrected bug 325
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3481 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-03-30 13:35:15 +00:00
Xavier Leroy f2a7fdbcd3 Ajout de l'instruction RERAISE
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3421 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-02-19 12:28:04 +00:00
Pierre Weis 2116da4220 Getting rid of obsolete boolean operators & and or
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3359 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-12-28 13:07:42 +00:00
Luc Maranget ab97fd0dcc or-pat avec variables et compil du switch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3304 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-10-02 14:18:05 +00:00
Xavier Leroy c7b7c24381 Nouveau format de .cma et .cmxa, se rappelle des -cclib et -ccopt necessaires pour le link final
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2930 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-03-09 09:12:28 +00:00
Xavier Leroy 45a18236df Revu compilation du filtrage des variants. Ajout de la primitive Pisint et de l'instruction bytecode ISINT.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2669 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-12-06 16:59:24 +00:00
Xavier Leroy cc0f32b054 Changement de la licence
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-17 18:59:06 +00:00
Damien Doligez 55df3c20f0 generation de ENVACC4 et suppression de ATOM1..ATOM3
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2476 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-08 15:27:26 +00:00
Xavier Leroy ea8fe59ea0 Adoption des memes representations que dans ocamlopt pour les tableaux de flottants et les fonctions mutuellement recursives.
Simplification de la compilation du let rec de valeurs.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1895 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1998-04-06 09:15:55 +00:00
Xavier Leroy 3f1b15e439 bytelink, emitcode: nouvelle gestion des CRC des interfaces.
bytelink: Sys.command -> Ccomp.command
translcore: expanser les abreviations dans has_base_type


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1551 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1997-05-15 13:25:14 +00:00