Commit Graph

848 Commits (9e181ca8f446d238ba279bc22fef9d166d4f38b0)

Author SHA1 Message Date
Florian Angeletti 55973d1203 Bump magic numbers for 4.12 (and trunk) 2020-10-19 15:33:26 +02:00
Thomas Refis 9fdc759ac0
Centralized tracking of frontend's global state (#9963)
import Local_store from merlin, with a simplified API following review comments
2020-10-15 14:47:19 +02:00
Greta Yorsh 855c13cd6e
ability to restart compilation from .cmir-linear IR files 2020-10-13 15:07:13 +02:00
Gabriel Scherer 82b29828d2
Allow `[@tailcall true]` and `[@tailcall false]` (#9754)
* remove the unused is_native_tail_call_heuristic forward reference

This forward-reference from Lambda to Asmcomp was used to generate
machine-specific tailcall information in -annot output; this only use
was removed in 57d329e07b, so we can now
remove it to simplify the codebase.

The logic was non-trivial and might be useful again in the future.

* [minor] testsuite: convert warnings/w51.ml to an expect-test

* [minor] translattribute: refactor attribute payload deconstruction

* [@tailcall false]: warn if the call *is* a tailcall

(+ constructor renaming suggested by Nicolás during review)

* Changes

* testsuite: add an example with the 'invalid payload' exception

(suggested by Nicolás during review)
2020-10-10 13:41:39 +02:00
Xavier Leroy 86c8a98f3c
Merge pull request #9948 from nojb/remove_spacetime
The Spacetime memory profiler is not going to be supported in Multicore OCaml, and  is already broken by some of the related changes in OCaml 4.12.  The core development team decided to remove Spacetime support from OCaml 4.12.
2020-10-09 14:43:23 +02:00
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
Greta Yorsh 04bceec6cc
Save Linear IR before emit (#8939)
* Save IR before emit

* Update .depend for linear_format

* Test for -save-ir-after command-line option

* Address review comments

* Add Changes entry
2020-10-07 11:32:40 +01:00
David Allsopp 2bc77ee5cd Simpler implementation of Ccomp.linker_is_flexlink 2020-09-21 10:11:39 +01:00
David Allsopp 14300d3b1a Fix -fdebug-prefix-map when using flexlink
Prepend the -fdebug-prefix-map= option with -link if the "linker" is in
fact flexlink.
2020-09-21 10:11:39 +01:00
hhugo 49aa87c316
Introduce warning 68 to warn about hidden allocation due to pattern match of mutable field in curried functions (#9751)
Introduce new warning 68
2020-08-17 09:47:36 +01:00
Nicolás Ojeda Bär 7e5a60b1ae Avoid breaking string literal 2020-07-21 08:11:03 +02:00
Nicolás Ojeda Bär 68be98d455 Include mnemonic when displaying warnings 2020-07-20 21:10:01 +02:00
Nicolás Ojeda Bär fb76c322b4 Rename Ignored_argument => Ignored_extra_argument 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 5e274544e3 check-typo 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär a73fedb0e3 Warning 25: make it clear that it is ignored 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 5e090605c6 Fix mnemonics, handle warnings without names 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär dae22804b9 Typo 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 9ac31c224c Rename No_unsafe_array_syntax_without_parsing => Unsafe_array_syntax_without_parsing 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 958281de38 Rename Unreachable_argument => Ignored_argument 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 06f1a66f96 Rename Unused_subpat => Redundant_subpat 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 47c0e44d63 Rename Unused_case => Redundant_case 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär ca4b8dcbd7 Rename Non_closed_record_pattern => Missing_record_field_pattern 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär f3c6b16ad7 Rename Partial_application => Ignored_partial_application 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär f9786a9cb2 Rename Unsafe_without_parsing => No_unsafe_array_syntax_without_parsing 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 85a7e8ef31 Rename Assignment_to_non_mutable_value => Flambda_assignment_to_non_mutable_value 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 14f8fa58ec Rename Ambiguous_pattern => Ambiguous_var_in_pattern_guard 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 5789d6c6df Rename Expect_tailcall => Tailcall_expected 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär a0cef9fdc6 Rename Bad_docstring => Unexpected_docstring 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 9f9cc29fd8 Rename Multiple_definition => Module_linked_twice 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 358a6c1ae8 Rename Unused_argument => Unreachable_argument 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär e05f119ea1 Rename Without_principality => Non_principal_labels 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär b2606e0f18 Rename Unused_pat => Unused_subpat 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 45d14467cd Rename Unused_match => Unused_case 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär fd48548c05 Rename Statement_type => Non_unit_statement 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär 1647c4705a Introduce mnemnonics for warnings 2020-07-20 08:31:18 +02:00
Xavier Leroy 0802bacf4b
Merge pull request #9551 from nojb/microbfd
Implement (in utils/binutils.ml) a simple parser for ELF, Mach-O and PE shared object files.  Use it to get rid of libbfd in ocamlobjinfo and to improve the checking of external primitives during linking in ocamlc.
2020-07-14 10:47:12 +02:00
Nicolás Ojeda Bär 34ff264937 Add module utils/binutils 2020-07-02 06:40:10 +02:00
Stephen Dolan c2461c000c Start Clflags.parse_arguments from 0 2020-06-30 10:57:09 +01:00
Stephen Dolan 81618f7b61 Move code of main and optmain to compilerlibs 2020-06-30 10:57:09 +01:00
David Allsopp e6ab329541 Don't call the archiver/librarian for empty .cmxa 2020-04-22 14:56:02 +01:00
Sébastien Hinderer 16006d55b1 Make ext_exe public in the configuration module of the compiler 2020-06-18 11:07:43 +02:00
David Allsopp da943eac54 Share generation code between ocamltest and utils
ocamltest/ocamltest_config.ml now generated using same make macros as
utils/config.ml.
2020-06-06 13:36:00 +01:00
Nicolás Ojeda Bär 836d62470b
Fix load path ordering (#9611) 2020-06-03 00:10:38 +02:00
Stephen Dolan fd1bb255e1 More partial application warnings 2020-06-02 12:11:41 +01:00
Nicolás Ojeda Bär 9b748843bb
Use List.find_map (#9589) 2020-05-21 08:51:16 +02:00
Gabriel Scherer 9eb9d04751 fix the dune build 2020-05-03 10:11:47 +02:00
Xavier Leroy 68c6f89409
Use diversion when calling external tools with a very long argument list (#9492)
It's not just on Windows that the length of the command passed to Sys.command
can exceed system limits:
- On Linux there is a per-argument limit of 2^17 bytes
  (the whole command is a single argument to /bin/sh)
- On macOS with default parameters, the limit is between 70000 and 80000
- On BSDs with default parameters, the limit is around 2^18.

In parallel, response files (@file) are supported by all the C compilers
we've encountered: GCC, Clang, Intel's ICC, and even CompCert.  They all
seem to follow quoting rules similar to that of the native shell
for the contents of the response file.

This commit forces the use of a response file when the total size of
the arguments to the linker is greater than 2^16.

Arguments passed via a response file are quoted using Filename.quote
as if they were passed on the command line.

Closes: #9482
Closes: #8549
2020-04-25 19:09:35 +02:00
David Allsopp 2b4fe09dc7 Eliminate Config.ocamlopt_c{,pp}flags
Config.ocamlopt_cflags and Config.ocamlopt_cppflags were solely used by
the driver when compiling .c files passed on the command line. The
behaviour of this should be the same as for `ocamlc -c` and the
inclusion of `-fPIC` in `ocamlc_cflags` only on some systems causes
problems for `ocamlmklib` which behaves as though the two drivers
compile C files identically.

This PR eliminates the separate settings in configure.ac and deprecates
the old variables in Config.
2019-04-20 13:00:30 +01:00
Gabriel Scherer 9568154248
Merge pull request #9389 from Anukriti12/trunk
call_linker now returns exit_code for better user response on linking_error, fixes #7141
2020-04-17 17:05:56 +02:00
Gabriel Scherer 1cd6e4451f Map.filter_map and Set.filter_map 2020-03-31 15:01:41 +02:00