Commit Graph

838 Commits (4f31b10d66ec105ad6f1c147d36cf1981c7f91d0)

Author SHA1 Message Date
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
Anukriti12 7feaeb52a1
Merge branch 'trunk' into trunk 2020-03-31 15:50:39 +05:30
muskangarg21 e831b47457 Added: Warning 67 description. 2020-03-30 21:51:54 +05:30
muskangarg21 50866e4cbf [nitpick]: Added "." at the end of warning descriptions in utils/warnings.ml 2020-03-30 21:48:02 +05:30
Anukriti12 8f235efdf5 call_linker now returns exit_code for better error response on linking_error, fixes #7141 2020-03-23 06:12:05 +05:30
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
Gabriel Scherer 8c36e799b0 revert #244
The logic in this patch is wrong:
- setting the margins is not the responsibility of the color-handling code
- because setup_colors is called at inpredictable times (on the first error/warning),
  the logic makes it very difficult to correctly set margins for `{str,err}_formatter`

The patch was originally proposed in the caml-list discussion
  https://sympa.inria.fr/sympa/arc/caml-list/2015-09/msg00164.html
but it does not convincingly solve the problem:
- there is no reason to use `std_formatter`
  rather than `err_formatter` as a reference, and
- the user can set the both margins themselves anyway.

In particular, since the 4.08 changes to error/warning
representations, we don't use intermediary formatters anymore to
produce error/warning messages, so setting `Formatter.std_formatter`
directly works as expected *when* this formatter is used to print to
the toplevel (the current default, which may change in the future).

Note: We have an API in `Location` to access and configure
error/warning formatters, but it is not accessible from the
toplevel. Changing the margins without using this API is fragile.
For example, utop and expect-tests change the formatter away from the
default.
2019-12-21 15:44:42 +01:00
Fourchaux 1f9474c63c Fixing typos (#9162) 2019-12-04 19:38:02 +00:00
Gabriel Scherer 9d81d6a10e new Misc.Magic_number module for magic number handling
This module was originally inspired by js_of_ocaml Misc.MagicNumber module
https://github.com/ocsigen/js_of_ocaml/blob/151b811/compiler/util.cppo.ml#L277-L347

It provides parsing and validation function for magic numbers, that
can tell the difference between "not a valid magic number" and "a
valid magic number, but with another version", and print user-friendly
user messages about it.

It does not contain any knowledge for where to find the magic number
in an OCaml file (this depends on the file format); the parsing
function should be called with an input channel already at the right
position for whichever format is expect.
2019-12-03 00:08:29 +01:00
Greta Yorsh fe7c8edeaa Fix -i broken by PR #8938 (#9090)
* Check print_types in should_stop after Typing
* Compare rank instead of equals makes should_stop_after monotonic in its pass argument
2019-11-26 16:55:43 +01:00
Greta Yorsh 6daaf62904 Do not emit references to dead labels (spacetime) (#9097) 2019-11-26 12:06:19 +00:00