Commit Graph

679 Commits (e227fb007d385aeb17b94472a7f854d2828b7566)

Author SHA1 Message Date
Gabriel Scherer b590421516 utils: import build_path_prefix_map library
This library is imported from

  <https://gitlab.com/gasche/build_path_prefix_map/>

commit 811691e479b38c0e6c1c0e5c853c555a63177ee3
2018-03-01 17:41:28 +01:00
Sébastien Hinderer fa7019437c Add the -dunique-ids and -dno-unique-ids options to the compilers
These options allow to control whether identifiers are made unique by
appending a stamp to them when dumping intermediate representations or not.

The default is to print the stamp, as is done currently.

The "-dno-unique-ids" option is useful e.g. to simplify the comparison
between a produced intermediate reprsentation (-dlambda, say) and the
expected one, in the context of the testsuite, for instance.
2018-02-20 18:02:35 +01:00
octachron 4aaf4f9b3b warnings: use manual cross-reference annotation 2018-01-04 12:46:57 +01:00
octachron 6570d99d53 warnings: fix references to extended description 2018-01-02 16:24:55 +01:00
Max Mouratov 7c6b2ed3e7 More robust implementation of Misc.no_overflow_mul (#1520)
* More robust implementation of Misc.no_overflow_mul

The old one fails on [a = min_int, b = -1] and [b = 0].  The new one is taken from Hacker's Delight.

* Changes: add entry

* testsuite: add tests for Misc.no_overflow_{add,sub,mul}
2017-12-20 16:45:39 +01:00
Armaël Guéneau b034ddc771 Add a hint suggesting to use ( * ) when (*) is used 2017-12-15 16:33:58 +01:00
Xavier Leroy 852b595ff3
Remove dependencies on curses/terminfo/termcap C library (#1431)
The terminfo C library was used for displaying error messages from the
toplevel.  Instead, just use ANSI escape sequences to display, and a
ioctl() to get the number of lines of the terminal.

- Remove byterun/terminfo.c
- Add primitive to query number of lines to io.c
  with OS-dependent code in unix.c (ioctl-based implementation)
  and win32.c (no implementation yet)
- Add a Terminfo.num_lines function and simplify interface to Terminfo.setup
- Query num_lines every time an error message needs to be highlighted,
  so as to react to windows resizing.
- Bootstrap to enable removal of old primitives.
2017-11-26 15:49:31 +01:00
David Allsopp 11c3df41ed Tidy-up generation of utils/config.ml
Simultaneously deals with an overly-long line and also ensure that
backslashes would be escaped no matter which variables they happened to
appear in.
2017-10-25 23:54:39 +01:00
Gabriel Scherer d10f0857a4 Merge pull request #1429 from gasche/config-cppflags
ocamlc -config: introduce ocaml{c,opt}_cppflags
2017-10-22 19:30:04 +02:00
Leo White 6d3a8b904e Merge pull request #1421 from lpw25/call-counts-by-default
Enable call counts in spacetime by default
2017-10-17 13:42:00 +01:00
Gabriel Scherer 5b8fcf2b56 ocamlc -config: also include 'afl_instrument' in output 2017-10-16 10:28:48 +02:00
Gabriel Scherer ebe32513b8 ocamlc -config: introduce ocaml{c,opt}_cppflags 2017-10-14 18:00:06 +02:00
Leo White 8f6c6aca92 Enable call counts in spacetime by default 2017-10-12 16:52:09 +01:00
Damien Doligez 8ba70ff194 Synchronize and bump all magic numbers, except for the byte-code exec. 2017-10-11 22:20:06 +02:00
Florian Angeletti db03cedfdf Merge pull request #830 from Octachron/stdlib_doc_unnested_hierarchy
PR#7363: documentation, start heading levels at 1
2017-10-05 19:26:44 +02:00
Jeremy Yallop 6c443077d4 Restore support for native_c_compiler and bytecomp_c_compiler
(no change entry needed)
2017-10-04 13:04:41 +01:00
octachron e30e82a219 PR#7363: start documentation headers at {1 2017-10-04 13:05:05 +02:00
Gabriel Scherer a202aa032b rename the configure-time safe-string options for clarity
-(un)safe-string becomes -(no-)force-safe-string
-(un)safe-string-default becomes -default-unsafe-string

Config.safe_string (and Clflags.unsafe_string) keep their name for
backward-compatibility, as well as the C define CAML_SAFE_STRING
(which corresponds to -force-safe-string).
2017-10-02 14:42:19 +02:00
Gabriel Scherer 6550a30719 safe-string: clarify the relation between configure- and compile-time options 2017-10-02 14:42:19 +02:00
Nicolás Ojeda Bär 9fe6d0e2c2 Unicode support for the Windows runtime (#1200)
* Add support code

* Explicitly reference ANSI Windows APIs

* Adapt Sys.is_directory

* Adapt ocamlrun

* Add Changes entry

* Add testsuite

* Adapt Unix.open_process{_in,_out,_full,}, Unix.create_process{_env,}

* Adapt headernt.c

* Adapt Pervasives.open_{in,out}, Filename.temp_file, etc.

* Adapt Sys.file_exists

* Adapt Sys.remove

* Adapt Sys.chdir

* Adapt Sys.getcwd

* Adapt Sys.getenv

* Adapt Sys.command

* Adapt Sys.readdir

* Adapt CPLUGINS

* Remove use of FormatMessageA, CreateFileA

* Adapt Unix.mkdir

* Adapt Unix.openfile

* Adapt Unix.readlink

* Adapt Unix.rename

* Adapt Unix.{LargeFile,}.{l,}stat

* Adapt Unix.system

* Adapt Unix.{open,read}dir

* Adapt Unix.link

* Adapt Unix.symlink

* Adapt Unix.getcwd

* Adapt Unix.rmdir

* Adapt Unix.utimes

* Adapt Unix.unlink

* Adapt Unix.chdir

* Adapt Unix.chmod

* Adapt Unix.{execv,execve,execvp,execvpe}

* Compile with -DUNICODE -D_UNICODE under Windows

* Add configure-time switch, Config.windows_unicode

* Adapt Unix.putenv

* Re-implement Unix.environment using GetEnvironmentStrings()

* Use Unicode-aware flexdll

* Adapt Unix.environment

* AppVeyor: bootstrap flexdll

* Adapt tests/embedded/cmmain.c

* Adapt tests/lib-dynlink-csharp/entry.c

* Remove exec tests

* Fixup

* Pass -municode to MinGW compiler

* Try to fix tests/embedded

* Adapt Sys.rename

* Correct Changes entry

* Makefile.several: use $(O) and $(NATIVECODE_ONLY)

* Display => skipped correctly for tests/win-unicode

* Add missing casts to execv* calls

It's not clear why these aren't necessary for with char, but they are
necessary with wchar_t on GCC (but not MSVC).

* Missing header in systhreads (Win32 only)

* Revert "Pass -municode to MinGW compiler"

This reverts commit a4ce7fb319c429068a5b9d1ab14a2cc3969c355f.

* Revert "Try to fix tests/embedded"

This reverts commit 5197d8922295b7b339b970ec3189374aa15de4b8.

* Revert "Remove exec tests"

This reverts commit 306ccef2e79eca5b38ecfa285b912c7bcf3e9f52.

* Don't pass $(LDFLAGS) when build ocamlc.opt

It's already included via CC anyway, and it causes Unicode problems for
Winodws (because the linker options need to be prefixed "-link" to go via
flexlink).

* Use wmain on Windows for ocamlrun

* Build Unicode applications on Windows

* Use wmain in headernt.c

* Minor correction to win-unicode Makefile

* Switch submodule to FlexDLL 0.36

* Build ocamlyacc as an ANSI application

* Revert "Fixup"

This reverts commit 500bd6b575ffd6c5b71c6953e55d740f0b090185.

* Fix casts for execvp/execve

* Remove tabs from test code

* Fix Changes entry

* shell32.lib is no longer necessary

* Free allocated string

* Changes: signal breaking change

* Disable exec_tests

* Protect with CAML_INTERNALS
2017-09-18 17:41:29 +02:00
Damien Doligez 535390f8f0 Fix output-complete-obj for MSVC:
- bug in ccomp.ml
- bug in test Makefile
- disable testing bytecode on MSVC: AFAICT this never worked.
2017-09-17 16:46:08 +02:00
Leo White e1fd8d5d3a Merge pull request #1332 from bobot/fix_output_complete_obj
[OCamlc] fixes output-complete-object
2017-09-16 06:54:58 +01:00
François Bobot 1343658f5d [OCamlc] use OUTPUTOBJ and move CAML_INTERNAL
in the generated file instead of in the command line
2017-09-15 21:28:59 +02:00
Damien Doligez e8d0abbcb0 switch to safe-string by default (related to MPR#7113) (#1252)
* switch to safe-string by default
2017-09-15 18:53:39 +02:00
Leo White 20668002bb Turn off warning 40 by default (#1333)
* Turn off warning 40 by default
2017-09-15 18:41:49 +02:00
Damien Doligez f086eda9c0 add -no-flat-float-array configure option 2017-09-15 18:24:36 +02:00
Mark Shinwell b65096678b Register availability analysis (#856) 2017-09-15 11:08:14 +01:00
Leo White 5cb27d8ebb Merge pull request #792 from sliquister/generalize-destr-subst2
Fixing the limitations on destructive substitutions
2017-09-15 09:29:29 +01:00
François Bobot 8afe629b5f [OCamlc] fixes output_complete_object
ocamlc complained that the temporary files it just created existed.
   since ed60dece81575305b5f1f7394cdda652b65b037a and
   19d3bccf48fee6e5e91e65e9f8a5d07c49d2afd4
2017-09-13 17:28:56 +02:00
alainfrisch 895a7f4443 Continue + expect test. 2017-09-12 00:35:58 +02:00
Leo White 2fc41796c8 Prevent repeated warnings with recursive modules 2017-09-11 16:57:34 +01:00
Xavier Leroy 071866c447 Create .cmi files atomically (MPR#7472) (#1307)
* MPR#7472: create .cmi files atomically

This is done by writing the data to a temporary file, compute the checksum, finish writing the data, and only then rename the temporary file to the destination .cmi file.

Writing .cmi files this way should avoid the corruption of .cmi files reported in MPR#4991.  This corruption can occur when a .cmi file is produced simultaneously by a run of ocamlc and a run of ocamlopt.

"Atomic" here means "as atomic as the underlying file system guarantees".  The atomicity guarantees of Windows file systems aren't entirely clear.

* Create .annot and .cmt files atomically, like .cmi files

Follow-up to MPR#7472.  The pattern "write to temporary file then rename"
is abstracted in the new function Misc.output_to_file_via_temporary
and applied to .cmi, .cmt and .annot files.
2017-09-06 20:01:15 +02:00
Fourchaux 72cfdd56e9 Typos and basic grammar error fixing (#1280) 2017-08-10 11:59:23 +01:00
Pierre Chambart 177713ec02 Optimize away some physical equality (#850) 2017-08-01 08:04:03 +01:00
Valentin Gatien-Baron 0ef1806969 Make type variable names in Utils.Tbl meaningful 2017-07-29 17:13:26 -04:00
Thomas Refis 1747a2f0eb Mention deprecated warning 25 in manual and man page
* warning 25: updated the man page

* warning 25: update the manual
2017-07-10 18:18:37 +02:00
Daniel Bünzli b5100112b4 Clflags: switch default value of keep_locs from false to true.
This provides better error messages from the toolchain by default.
2017-06-30 13:13:06 +02:00
Mark Shinwell 9683393625 Call counts in Spacetime (#1180) 2017-06-16 13:51:12 +01:00
sliquister 3f76c0525b generalize -dtimings to show allocation, top heap size (#1152) 2017-06-09 12:29:21 +01:00
Gabriel Scherer 2072b5d063 Merge pull request #1187 from Octachron/document_plugins
Manual: minimal documentation for compiler plugins
2017-06-04 10:43:59 -04:00
octachron df3f4b9f61 GPR#1187: document command line flags for plugins 2017-06-01 23:24:12 +02:00
octachron 60ad2d8145 GPR#1187: Minimal documentation for compiler plugins 2017-06-01 18:22:09 +02:00
Fabrice Le Fessant 8daa184d95 New -depend option for ocamlc/ocamlopt 2017-06-01 15:56:30 +02:00
Alain Frisch 1a93a20f37 Merge pull request #1138 from alainfrisch/pr7444_deprecated_warning_upon_inclusion
Deprecation warning when checking signature inclusion
2017-05-15 18:06:31 +02:00
David Allsopp 65fd726329 Install bootstrapped FlexDLL objects to flexdll/
The install-flexdll target now puts the object files for FlexDLL in a
subdirectory flexdll of the Standard Library instead of in the Standard
Library itself.

A configuration tweak means that -I +flexdll is effectively added to all
compiler invocations and also a pseudo-option -L+flexdll to ocamlmklib
calls to Config.mkdll which fixes PR#7373.
2017-04-09 19:00:06 +02:00
alainfrisch f6d53cc38f Deprecation warning when checking signature inclusion
Deprecation warning (3) is currently only reported when directly
accessing a component marked with the deprecated attribute; but it is
missed when we coerce the signature contaning the deprecated component
to a signature without the attribute.

This commit adds the required machinery to detect such cases
and report the same warning. (An alternative design could be
to introduce a new warning for that purpose.)

Some of the new machinery could be used for other purposes:

  - During the inclusion check, keep the location that would used in
    the error message if the check fails.

  - Warnings can now hold extra "sub-locations" (and associated
    messages).
2017-04-05 19:13:59 +02:00
Sébastien Hinderer f2d5d60376 Define new build variables for C compiler and preprocessor flags 2017-03-29 11:10:06 +02:00
Max Mouratov d29f3f7104 Fixed erroneous comments 2017-03-28 16:02:05 +02:00
alainfrisch 30f502abc8 Optimize lookups by specializing Tbl.find to string keys (not strictly related to this PR). 2017-03-24 14:24:36 +01:00
Pierre Chambart cb81cc6fe2 Declare record type for flambda function parameters (#1028) 2017-03-16 10:40:47 +00:00