From afb632d2028fdc4a37e10e41e1929264ff59f52e Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 14 Mar 2013 09:53:33 +0100 Subject: Convert XML files to UTF-8, where needed --- lib/compiler/doc/src/notes.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 94fea84557..ea78372606 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -45,7 +45,7 @@

Forbid multiple values in Core Erlang sequence arguments. - Thanks to José Valim and Anthony Ramine.

+ Thanks to José Valim and Anthony Ramine.

Own Id: OTP-10818

@@ -144,7 +144,7 @@

compile:forms/2 will now use a {source,SourceFilePath} to set the source returned by - module_info(compile) (Thanks to José Valim)

+ module_info(compile) (Thanks to José Valim)

Own Id: OTP-10150

@@ -256,7 +256,7 @@

Fix typo in `compile' doc: unmatched parenthesis (Thanks - to Ricardo Catalinas Jiménez)

+ to Ricardo Catalinas Jiménez)

Own Id: OTP-9919

@@ -757,7 +757,7 @@ (Thanks to Paul Fisher.)

Using filter expressions containing andalso or orelse in a list comprehension could cause a - compiler crash. (Thanks to Martin Engström.)

+ compiler crash. (Thanks to Martin Engström.)

Own Id: OTP-8054

-- cgit v1.2.3 From e5875001247e6a6ac4f474157a51a8c54f94ae49 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 14 Mar 2013 16:01:25 +0100 Subject: Convert XML files to UTF-8 --- lib/compiler/doc/src/book.xml | 4 ++-- lib/compiler/doc/src/compile.xml | 4 ++-- lib/compiler/doc/src/fascicules.xml | 2 +- lib/compiler/doc/src/notes.xml | 2 +- lib/compiler/doc/src/notes_history.xml | 4 ++-- lib/compiler/doc/src/part_notes.xml | 4 ++-- lib/compiler/doc/src/part_notes_history.xml | 4 ++-- lib/compiler/doc/src/ref_man.xml | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/book.xml b/lib/compiler/doc/src/book.xml index fc56a837d5..45b49fe46d 100644 --- a/lib/compiler/doc/src/book.xml +++ b/lib/compiler/doc/src/book.xml @@ -1,10 +1,10 @@ - +
- 19972009 + 19972013 Ericsson AB. All Rights Reserved. diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index ddaae2655d..96907f6b10 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -1,10 +1,10 @@ - +
- 19962012 + 19962013 Ericsson AB. All Rights Reserved. diff --git a/lib/compiler/doc/src/fascicules.xml b/lib/compiler/doc/src/fascicules.xml index 43090b4aed..fadd37eefb 100644 --- a/lib/compiler/doc/src/fascicules.xml +++ b/lib/compiler/doc/src/fascicules.xml @@ -1,4 +1,4 @@ - + diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index ea78372606..352bb0d7ac 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -1,4 +1,4 @@ - + diff --git a/lib/compiler/doc/src/notes_history.xml b/lib/compiler/doc/src/notes_history.xml index db0dc2f683..9e8934f416 100644 --- a/lib/compiler/doc/src/notes_history.xml +++ b/lib/compiler/doc/src/notes_history.xml @@ -1,10 +1,10 @@ - +
- 20062009 + 20062013 Ericsson AB. All Rights Reserved. diff --git a/lib/compiler/doc/src/part_notes.xml b/lib/compiler/doc/src/part_notes.xml index e730e3f7e2..0c1fdd567d 100644 --- a/lib/compiler/doc/src/part_notes.xml +++ b/lib/compiler/doc/src/part_notes.xml @@ -1,10 +1,10 @@ - +
- 20042009 + 20042013 Ericsson AB. All Rights Reserved. diff --git a/lib/compiler/doc/src/part_notes_history.xml b/lib/compiler/doc/src/part_notes_history.xml index 12366f0006..a4909f156e 100644 --- a/lib/compiler/doc/src/part_notes_history.xml +++ b/lib/compiler/doc/src/part_notes_history.xml @@ -1,11 +1,11 @@ - +
2006 - 2011 + 2013 Ericsson AB, All Rights Reserved diff --git a/lib/compiler/doc/src/ref_man.xml b/lib/compiler/doc/src/ref_man.xml index 74fe45aa77..6478ad4b11 100644 --- a/lib/compiler/doc/src/ref_man.xml +++ b/lib/compiler/doc/src/ref_man.xml @@ -1,10 +1,10 @@ - +
- 19962009 + 19962013 Ericsson AB. All Rights Reserved. -- cgit v1.2.3 From 60984adef62f5e5bf8c65f403d4f8522afb6d40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 5 Sep 2013 13:57:09 +0200 Subject: compiler: Conform returned errors to the documented format ErrorInfo is documented to be: {ErrorLine,Module,ErrorDescriptor} but for some errors with line numbers it would look like: {Module,ErrorDescriptor} Ensure that all ErrorInfo tuples have three elements. Use 'none' instead of a line number: {none,Module,ErrorDescriptor} There already are errors that return 'none' when no line number is available, but that convention was not documented. Mention it in the documentation. Also make sure that the compiler will not print 'none' as a line number in error messages (if the 'report_errors' option is given) as that looks stupid. That is, when attempting to compile a non-existing module, the error message should be: non-existing.erl: no such file or directory and not: non-existing.erl:none: no such file or directory --- lib/compiler/doc/src/compile.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index ddaae2655d..f1238f27a6 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -859,6 +859,10 @@ pi() -> 3.1416. {ErrorLine, Module, ErrorDescriptor} +

ErrorLine will be the atom none if the error does + not correspond to a specific line (e.g. if the source file does + not exist).

+

A string describing the error is obtained with the following call:

-- cgit v1.2.3 From c011973178d860f280c6ce18b07ce4176aec5b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 6 Sep 2013 13:40:21 +0200 Subject: Change encoding of troublesome notes.xml files to utf-8 Most notes.xml files will be updated in every release and cause the kind of the problems described in the previous commit. --- lib/compiler/doc/src/notes.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 33b32a3dce..837fcf4368 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -96,7 +96,7 @@

Forbid multiple values in Core Erlang sequence arguments. - Thanks to José Valim and Anthony Ramine.

+ Thanks to José Valim and Anthony Ramine.

Own Id: OTP-10818

@@ -195,7 +195,7 @@

compile:forms/2 will now use a {source,SourceFilePath} to set the source returned by - module_info(compile) (Thanks to José Valim)

+ module_info(compile) (Thanks to José Valim)

Own Id: OTP-10150

@@ -307,7 +307,7 @@

Fix typo in `compile' doc: unmatched parenthesis (Thanks - to Ricardo Catalinas Jiménez)

+ to Ricardo Catalinas Jiménez)

Own Id: OTP-9919

@@ -808,7 +808,7 @@ (Thanks to Paul Fisher.)

Using filter expressions containing andalso or orelse in a list comprehension could cause a - compiler crash. (Thanks to Martin Engström.)

+ compiler crash. (Thanks to Martin Engström.)

Own Id: OTP-8054

-- cgit v1.2.3 From 20641fe0f2ea745873fc7557448d3a7deb1bd639 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 16 Sep 2013 20:11:53 +0200 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 837fcf4368..eb5fa8b398 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -31,6 +31,67 @@

This document describes the changes made to the Compiler application.

+
Compiler 4.9.3 + +
Fixed Bugs and Malfunctions + + +

+ Expressions such as 'B = is_integer(V), if B and B + -> ok end' would crash the compiler.

+

+ Own Id: OTP-11240

+
+ +

+ compile:file2/2 with the option + report_errors could return ErrorInfo tuples with + only two elements, while the documentation says that the + ErrorInfo tuple always has three elements. Also updated + the documentation to add that the first element may be + 'none' if no line number is applicable.

+

+ Own Id: OTP-11304 Aux Id: seq12412

+
+
+
+ + +
Improvements and New Features + + +

+ Fix matching of floating point middle-endian machines. + Thanks to Johannes Weissl.

+

+ Own Id: OTP-11201

+
+ +

+ Restrict inlining of local fun references. Thanks to + Anthony Ramine.

+

+ Own Id: OTP-11211

+
+ +

+ Silence a misleading warning with some comprehensions. + Thanks to Anthony Ramine.

+

+ Own Id: OTP-11212

+
+ +

+ Forbid returning a match context in beam_validator. + Thanks to Anthony Ramine.

+

+ Own Id: OTP-11247

+
+
+
+ +
+
Compiler 4.9.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From d2b412df6c8751c10de025399cb04a8194169d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 18 Oct 2013 12:05:46 +0200 Subject: Allow all auto imports to be suppressed at once This patch introduces the no_auto_import attribute: -compile(no_auto_import). Useful for code generation tools that always use the qualified function names and want to avoid the auto imported functions clashing with local ones. Implementation wise, we chose to have a special flag 'all' to avoid doing many set lookups when checking for suppression. --- lib/compiler/doc/src/compile.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index f1238f27a6..579612b531 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -402,6 +402,11 @@ module.beam: module.erl \ -compile({no_auto_import,[error/1]}). + no_auto_import + +

Do not auto import any functions from the module erlang.

+
+ no_line_info -- cgit v1.2.3 From 25237481ccccd3ddfa74582dc267632ad618ba30 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 9 Dec 2013 20:12:33 +0100 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index eb5fa8b398..cb39b28d3d 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -31,6 +31,34 @@

This document describes the changes made to the Compiler application.

+
Compiler 4.9.4 + +
Fixed Bugs and Malfunctions + + +

+ Typo fix ambigous -> ambiguous. Thanks to Leo Correa.

+

+ Own Id: OTP-11455

+
+
+
+ + +
Improvements and New Features + + +

+ Lift 'after' blocks to zeroary functions. Thanks to + Anthony Ramine.

+

+ Own Id: OTP-11267

+
+
+
+ +
+
Compiler 4.9.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 18315c1675d965e5d0210a560e4742c483fcfd7f Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Tue, 3 Dec 2013 18:43:30 +0100 Subject: Officially support building assembler files erlc is wired to treat *.S files as assembler and build them as compile:file(File, [from_asm]), but this is not documented. There's also a documented compile:file/2 option called 'asm' (mapping to 'from_asm'), but the wording discourages its use. All of this has been in place and in use for a long time. Therefore, it should be supported officially. To fix that, make the following changes: * document erlc handling of *.core files * un-document 'asm' and document 'from_asm' instead * deprecate 'asm' While at it, fix a minor typo in the test suite. --- lib/compiler/doc/src/compile.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index 73d75851cf..eb7745890e 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -350,12 +350,11 @@ module.beam: module.erl \ parsed code before the code is checked for errors.

- asm + from_asm

The input file is expected to be assembler code (default file suffix ".S"). Note that the format of assembler files - is not documented, and may change between releases - this - option is primarily for internal debugging use.

+ is not documented, and may change between releases.

no_strict_record_tests -- cgit v1.2.3 From 455c8238535d2754234cd68bbf7caba9960607d6 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Tue, 3 Dec 2013 19:16:16 +0100 Subject: Officially support building core files erlc is wired to treat *.core files as core and build them as compile:file(File, [from_core]), but this is not documented. There's also an udocumented compile:file/2 option called 'from_core'. This has been in place and in use for a long time. Therefore, it should be supported officially. To fix that, make the following changes: * document erlc handling of *.core files * document 'from_core' --- lib/compiler/doc/src/compile.xml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index eb7745890e..1459f696a0 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -357,6 +357,13 @@ module.beam: module.erl \ is not documented, and may change between releases.

+ from_core + +

The input file is expected to be core code (default + file suffix ".core"). Note that the format of core files + is not documented, and may change between releases.

+
+ no_strict_record_tests

This option is not recommended.

-- cgit v1.2.3 From 774955d0d2a44fa8ac5943a14516d54db2b8f6d5 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Mon, 3 Mar 2014 15:27:09 +0100 Subject: Introduce compiler option 'nowarn_deprecated_type' The deprecation of the built-in types dict/0 and so on had as side-effect that it was impossible to switch to dict:dict/2 and so on without getting warnings either in the the previous release (R16B) or the current one (17.0). By including the attribute -compile(nowarn_deprecated_type). in an Erlang source file warnings about deprecated types can be avoided in 17.0. The option can also be given as a compiler flag: erlc +nowarn_deprecated_type file.erl --- lib/compiler/doc/src/compile.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index c66c8ea4bf..5fccdcdcb5 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -4,7 +4,7 @@
- 19962013 + 19962014 Ericsson AB. All Rights Reserved. @@ -551,6 +551,14 @@ module.beam: module.erl \ {Module,Name,Arity} or a list of such tuples.

+ nowarn_deprecated_type + +

Turns off warnings for uses of deprecated types. By + default (warn_deprecated_type), warnings are + emitted for every use of a type known by the compiler + to be deprecated.

+
+ warn_obsolete_guard

Causes warnings to be emitted for calls to old type -- cgit v1.2.3 From f719d0fe308f00b85f92c29d7cdf9b0dc20d98a2 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 7 Apr 2014 19:52:48 +0200 Subject: Update release notes --- lib/compiler/doc/src/notes.xml | 227 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 227 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index cb39b28d3d..a0f2e617cb 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -31,6 +31,233 @@

This document describes the changes made to the Compiler application.

+
Compiler 5.0 + +
Fixed Bugs and Malfunctions + + +

+ Line numbers would not be correct when a binary + construction such as + '<<Bin/binary,...>>' fails. (Thanks to + Stanislav Seletskiy for reporting this bug.)

+

+ Own Id: OTP-11572

+
+ +

+ The compiler now properly annotates the code in value in + the 'after' clause for a 'try' so that + Dialyzer no longer generates a false warning for an + unmatched return.

+

+ Own Id: OTP-11580

+
+ +

+ Some case statements where no clause would match could + cause an internal error in the compiler. (Thanks to Erik + Soe Sorensen for reporting this bug.)

+

+ Own Id: OTP-11610

+
+ +

+ With --Wunmatched_returns, dialyzer will no longer + warn when the value of a list comprehension is ignored, + provided that the each value in the list would be an + atomic value (such as integer or atoms, as opposed to + tuples and lists). Example: ignoring '[io:format(...) + || ...]' will not cause a warning, while ignoring + '[file:close(Fd) || ...]' will.

+

+ Own Id: OTP-11626

+
+ +

+ Matching out a binary and applying the binary as if it + were a fun would crash the run-time system. (Thanks to + Loïc Hoguin.)

+

+ Own Id: OTP-11672

+
+ +

+ Some local implementations of removing the last element + from a list are replaced by lists:droplast/1. Note + that this requires at least stdlib-2.0, which is + the stdlib version delivered in OTP 17.0. (Thanks to Hans + Svensson)

+

+ Own Id: OTP-11678

+
+ +

+ Allow all auto imports to be suppressed at once. + Introducing the no_auto_import attribute: + -compile(no_auto_import). Useful for code generation + tools that always use the qualified function names and + want to avoid the auto imported functions clashing with + local ones. (Thanks to José Valim.)

+

+ Own Id: OTP-11682

+
+ +

+ Application upgrade (appup) files are corrected for the + following applications:

+

+ asn1, common_test, compiler, crypto, debugger, + dialyzer, edoc, eldap, erl_docgen, et, eunit, gs, hipe, + inets, observer, odbc, os_mon, otp_mibs, parsetools, + percept, public_key, reltool, runtime_tools, ssh, + syntax_tools, test_server, tools, typer, webtool, wx, + xmerl

+

+ A new test utility for testing appup files is added to + test_server. This is now used by most applications in + OTP.

+

+ (Thanks to Tobias Schlager)

+

+ Own Id: OTP-11744

+
+ +

+ Adapt 'asm' deprecation message to new version scheme. + (Thanks to Tuncer Ayaz)

+

+ Own Id: OTP-11751

+
+ +

+ A number of compiler errors where unusual or nonsensical + code would crash the compiler have been reported by Ulf + Norell and corrected by Anthony Ramine.

+

+ Own Id: OTP-11770

+
+
+
+ + +
Improvements and New Features + + +

+ Compilation times for modules with a huge number for + record accesses using the dot operator has been improved.

+

+ Own Id: OTP-10652

+
+ +

+ The compiler can generate somewhat better code by moving + let expressions into sequences. (Thanks to Anthony + Ramine.)

+

+ Own Id: OTP-11056

+
+ +

+ Forbid unsized fields in patterns of binary generators + and simplified v3_core's translation of bit string + generators. (Thanks to Anthony Ramine.)

+

+ Own Id: OTP-11186

+
+ +

+ Funs can now be a given a name. Thanks to to Richard + O'Keefe for the idea (EEP37) and to Anthony Ramine for + the implementation.

+

+ Own Id: OTP-11537

+
+ +

+ Using the from_asm option to produce a BEAM file + starting from BEAM assembly code would often fail because + early optimization passes would not understand + instructions that later optimization passes would + introduce. (Thanks to Anthony Ramine.)

+

+ Own Id: OTP-11544

+
+ +

+ The .core and .S extensions are now + documented in the erlc documentation, and the + 'from_core' and 'from_asm' options are now + documented in the compiler documentation. (Thanks to + Tuncer Ayaz.)

+

+ Own Id: OTP-11547

+
+ +

Optimization of case expressions that build tuples or + lists have been improved.

+

+ Own Id: OTP-11584

+
+ +

+ EEP43: New data type - Maps

+

+ With Maps you may for instance: M0 = + #{ a => 1, b => 2}, % create + associations M1 = M0#{ a := 10 }, % + update values M2 = M1#{ "hi" => + "hello"}, % add new associations #{ + "hi" := V1, a := V2, b := V3} = M2. % match keys with + values

+

+ For information on how to use Maps please see the + Reference + Manual.

+

+ The current implementation is without the following + features: No variable keys + No single value access No map + comprehensions

+

+ Note that Maps is experimental during OTP 17.0.

+

+ Own Id: OTP-11616

+
+ +

+ Some function specs are corrected or moved and some edoc + comments are corrected in order to allow use of edoc. + (Thanks to Pierre Fenoll)

+

+ Own Id: OTP-11702

+
+ +

+ Thanks to Anthony Ramine for several improvements to the + optimizations in the BEAM compiler and for cleaning up + the code the code that transforms list and binary + comprehensions to Core Erlang.

+

+ Own Id: OTP-11720

+
+ +

+ The default encoding for Erlang source files is now + UTF-8. As a temporary measure to ease the transition from + the old default of latin-1, if the compiler encounters + byte sequences that are not valid UTF-8 sequences, the + compiler will re-try the compilation in latin-1 mode. + This workaround will be removed in a future release.

+

+ Own Id: OTP-11791

+
+
+
+ +
+
Compiler 4.9.4
Fixed Bugs and Malfunctions -- cgit v1.2.3 From f47320f43c3fb39f78054834e60ae9424ac79f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 17 Jun 2014 16:26:50 +0200 Subject: doc: Fix broken links --- lib/compiler/doc/src/notes.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index a0f2e617cb..7b2b60fb3d 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -211,10 +211,10 @@ "hello"}, % add new associations #{ "hi" := V1, a := V2, b := V3} = M2. % match keys with values

-

- For information on how to use Maps please see the - Reference - Manual.

+

+ For information on how to use Maps please see Map Expressions in the + + Reference Manual.

The current implementation is without the following features: No variable keys -- cgit v1.2.3 From 77da984614ae462912a1896ba1bb73c798ffd4f8 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 19 Jun 2014 13:47:21 +0200 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 7b2b60fb3d..55e9661d7d 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -31,6 +31,29 @@

This document describes the changes made to the Compiler application.

+
Compiler 5.0.1 + +
Fixed Bugs and Malfunctions + + +

+ A Dialyzer crash involving analysis of Map types has now + been fixed.

+

+ Own Id: OTP-11947

+
+ +

The compiler would fail to compile a file with a + latin-1 character in the false branch of an -ifdef + or -indef.

+

+ Own Id: OTP-11987

+
+
+
+ +
+
Compiler 5.0
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 950d808c97a4c5b579f4f1cc16b95f2d419d3505 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 15 Sep 2014 12:02:14 +0200 Subject: Update release notes --- lib/compiler/doc/src/notes.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 55e9661d7d..d48a0a5599 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -31,6 +31,22 @@

This document describes the changes made to the Compiler application.

+
Compiler 5.0.2 + +
Fixed Bugs and Malfunctions + + +

+ Corrected a bug with incorrect code generation when + inlining was turned on.

+

+ Own Id: OTP-12132

+
+
+
+ +
+
Compiler 5.0.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 7f3486a5ddc02a366f2945dfd009c4a2697a2b98 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 9 Dec 2014 15:21:47 +0100 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index d48a0a5599..84ebd2f210 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -31,6 +31,35 @@

This document describes the changes made to the Compiler application.

+
Compiler 5.0.3 + +
Fixed Bugs and Malfunctions + + +

+ Named funs with the same name and arity could get mixed + up with each other.

+

+ Own Id: OTP-12262

+
+ +

+ Coalesce map keys in dialyzer mode

+

+ This fixes a regression introduced in commit + 805f9c89fc01220bc1bb0f27e1b68fd4eca688ba The problem + occurred with compounded map keys compiled with dialyzer + option turned on, '+dialyzer'.

+

+ Reported by: Ivan Uemlianin

+

+ Own Id: OTP-12347

+
+
+
+ +
+
Compiler 5.0.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 62870c998955e1498e71bfc90607885e96ecaa27 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 31 Mar 2015 12:24:04 +0200 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 84ebd2f210..9b5b44f3e1 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -31,6 +31,58 @@

This document describes the changes made to the Compiler application.

+
Compiler 5.0.4 + +
Fixed Bugs and Malfunctions + + +

+ Matching out a map from a record and then updating the + record could cause a 'badarg' exception at run-time. + (Thanks to Dmitry Aleksandrov for reporting this bug.)

+

+ Own Id: OTP-12402

+
+ +

The compiler would crash when compiling some complex, + nonsensical guards such as:

+

... when {{X}}, -X...

+

+ Own Id: OTP-12410

+
+ +

+ In rare circumstances, using binary pattern in the value + part of a map pattern would cause the compiler to crash.

+

+ Own Id: OTP-12414

+
+ +

Case expressions where a map was wrapped in a tuple or + list such as:

+

case {a,Map} of
{a,#{k:=_}}=Tuple -> + Tuple
end.

+

would be unsafely "optimized" to either cause an + exception at run-time or would return an empty map.

+

+ Own Id: OTP-12451

+
+ +

When a variable was compared to a literal map using + the '==' operator, the compiler would change the + operator to '=:=' since it is more efficient. + However, this optimization is not safe if the map literal + has numeric keys or values. The compiler will now only do + the optimization if all keys and values are + non-numeric.

+

+ Own Id: OTP-12456

+
+
+
+ +
+
Compiler 5.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 4823c4f7c792f8a9e4c27744f436f0f10763ef17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 21 May 2015 12:23:48 +0200 Subject: Update compiler documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Language cleaned up by the technical writer tmanevik from Combitech. Proofreading and corrections by Björn Gustavsson. --- lib/compiler/doc/src/compile.xml | 506 +++++++++++++++++++-------------------- lib/compiler/doc/src/ref_man.xml | 2 +- 2 files changed, 249 insertions(+), 259 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index 5fccdcdcb5..a271729c82 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -32,15 +32,15 @@ Erlang Compiler

This module provides an interface to the standard Erlang - compiler. It can generate either a new file which contains - the object code, or return a binary which can be loaded directly. + compiler. It can generate either a new file, which contains + the object code, or return a binary, which can be loaded directly.

file(File) - Compile a file + Compiles a file.

Is the same as file(File, [verbose,report_errors,report_warnings]). @@ -50,7 +50,7 @@ file(File, Options) -> CompRet - Compile a file + Compiles a file. CompRet = ModRet | BinRet | ErrRet ModRet = {ok,ModuleName} | {ok,ModuleName,Warnings} @@ -64,39 +64,38 @@

Returns {ok,ModuleName} if successful, or error if there are errors. An object code file is created if - the compilation succeeds with no errors. It is considered + the compilation succeeds without errors. It is considered to be an error if the module name in the source code is not the same as the basename of the output file.

-

Here follows first all elements of Options that in - some way control the behavior of the compiler.

+

Available options:

basic_validation -

This option is fast way to test whether a module will - compile successfully (mainly useful for code generators - that want to verify the code they emit). No code will +

This option is a fast way to test whether a module will + compile successfully. This is useful for code generators + that want to verify the code that they emit. No code is generated. If warnings are enabled, warnings generated by the erl_lint module (such as warnings for unused - variables and functions) will be returned too.

+ variables and functions) are also returned.

-

Use the strong_validation option to generate all +

Use option strong_validation to generate all warnings that the compiler would generate.

strong_validation -

Similar to the basic_validation option, no code - will be generated, but more compiler passes will be run - to ensure also warnings generated by the optimization - passes are generated (such as clauses that will not match +

Similar to option basic_validation. No code + is generated, but more compiler passes are run + to ensure that warnings generated by the optimization + passes are generated (such as clauses that will not match, or expressions that are guaranteed to fail with an - exception at run-time).

+ exception at runtime).

binary -

Causes the compiler to return the object code in a +

The compiler returns the object code in a binary instead of creating an object file. If successful, the compiler returns {ok,ModuleName,Binary}.

@@ -105,7 +104,9 @@

The compiler will emit informational warnings about binary matching optimizations (both successful and unsuccessful). - See the Efficiency Guide for further information.

+ For more information, see the section about + bin_opt_info + in the Efficiency Guide.

compressed @@ -117,20 +118,19 @@ debug_info -

Include debug information in the form of abstract code +

Includes debug information in the form of abstract code (see The Abstract Format in ERTS User's Guide) in the compiled beam module. Tools - such as Debugger, Xref and Cover require the debug - information to be included.

+ such as Debugger, Xref, and Cover require + the debug information to be included.

Warning: Source code can be reconstructed from the debug information. Use encrypted debug information - (see below) to prevent this.

+ (encrypt_debug_info) to prevent this.

-

See - beam_lib(3) - for details.

+

For details, see + beam_lib(3).

{debug_info_key,KeyString} @@ -138,65 +138,61 @@ {debug_info_key,{Mode,KeyString}} -

Include debug information, but encrypt it, so that it +

Includes debug information, but encrypts it so that it cannot be accessed without supplying the key. (To give - the debug_info option as well is allowed, but is + option debug_info as well is allowed, but not necessary.) Using this option is a good way to always have the debug information available during testing, yet - protect the source code.

+ protecting the source code.

Mode is the type of crypto algorithm to be used - for encrypting the debug information. The default type -- - and currently the only type -- is des3_cbc.

-

See - beam_lib(3) - for details.

+ for encrypting the debug information. The default + (and currently the only) type is des3_cbc.

+

For details, see + beam_lib(3).

encrypt_debug_info -

Like the debug_info_key option above, except that - the key will be read from an .erlang.crypt file. +

Similar to the debug_info_key option, but + the key is read from an .erlang.crypt file.

-

See - beam_lib(3) - for details.

+

For details, see + beam_lib(3).

makedep -

Produce a Makefile rule to track headers dependencies. +

Produces a Makefile rule to track headers dependencies. No object file is produced.

By default, this rule is written to - .Pbeam]]>. However, if the option + .Pbeam]]>. However, if option binary is set, nothing is written and the rule is returned in Binary.

-

For instance, if one has the following module: +

For example, if you have the following module:

-module(module). -include_lib("eunit/include/eunit.hrl"). --include("header.hrl"). - -

Here is the Makefile rule generated by this option: +-include("header.hrl"). +

The Makefile rule generated by this option looks as follows:

module.beam: module.erl \ /usr/local/lib/erlang/lib/eunit/include/eunit.hrl \ - header.hrl - + header.hrl
{makedep_output, Output} -

Write generated rule(s) to Output instead of the +

Writes generated rules to Output instead of the default .Pbeam]]>. Output can be a filename or an io_device(). To write to - stdout, use standard_io. However if binary + stdout, use standard_io. However, if binary is set, nothing is written to Output and the result is returned to the caller with {ok, ModuleName, Binary}. @@ -205,7 +201,7 @@ module.beam: module.erl \ {makedep_target, Target} -

Change the name of the rule emitted to Target. +

Changes the name of the rule emitted to Target.

@@ -217,20 +213,20 @@ module.beam: module.erl \ makedep_add_missing -

Consider missing headers as generated files and add them to the +

Considers missing headers as generated files and adds them to the dependencies.

makedep_phony -

Add a phony target for each dependency. +

Adds a phony target for each dependency.

'P' -

Produces a listing of the parsed code after preprocessing +

Produces a listing of the parsed code, after preprocessing and parse transforms, in the file .P]]>. No object file is produced.

@@ -238,7 +234,7 @@ module.beam: module.erl \ 'E' -

Produces a listing of the code after all source code +

Produces a listing of the code, after all source code transformations have been performed, in the file .E]]>. No object file is produced.

@@ -258,21 +254,21 @@ module.beam: module.erl \ report -

This is a short form for both report_errors and +

A short form for both report_errors and report_warnings.

return_errors -

If this flag is set, then +

If this flag is set, {error,ErrorList,WarningList} is returned when there are errors.

return_warnings -

If this flag is set, then an extra field containing - WarningList is added to the tuples returned on +

If this flag is set, an extra field, containing + WarningList, is added to the tuples returned on success.

@@ -284,13 +280,13 @@ module.beam: module.erl \ return -

This is a short form for both return_errors and +

A short form for both return_errors and return_warnings.

verbose -

Causes more verbose information from the compiler +

Causes more verbose information from the compiler, describing what it is doing.

@@ -314,7 +310,7 @@ module.beam: module.erl \ {i,Dir} -

Add Dir to the list of directories to be searched +

Adds Dir to the list of directories to be searched when including a file. When encountering an -include or -include_lib directive, the compiler searches for header files in the following @@ -322,14 +318,14 @@ module.beam: module.erl \

".", the current working directory of - the file server;

+ the file server

-

the base name of the compiled file;

+

The base name of the compiled file

-

the directories specified using the i option. - The directory specified last is searched first.

+

The directories specified using option i; + the directory specified last is searched first

@@ -353,15 +349,15 @@ module.beam: module.erl \ from_asm

The input file is expected to be assembler code (default - file suffix ".S"). Note that the format of assembler files - is not documented, and may change between releases.

+ file suffix ".S"). Notice that the format of assembler files + is not documented, and can change between releases.

from_core

The input file is expected to be core code (default - file suffix ".core"). Note that the format of core files - is not documented, and may change between releases.

+ file suffix ".core"). Notice that the format of core files + is not documented, and can change between releases.

no_strict_record_tests @@ -369,9 +365,9 @@ module.beam: module.erl \

This option is not recommended.

By default, the generated code for - the Record#record_tag.field operation verifies that - the tuple Record is of the correct size for - the record and that the first element is the tag + operation Record#record_tag.field verifies that + the tuple Record has the correct size for + the record, and that the first element is the tag record_tag. Use this option to omit the verification code.

@@ -390,79 +386,87 @@ module.beam: module.erl \ {no_auto_import,[{F,A}, ...]}

Makes the function F/A no longer being - auto-imported from the module erlang, which resolves - BIF name clashes. This option has to be used to resolve name - clashes with BIFs auto-imported before R14A, if one wants to + auto-imported from the erlang module, which resolves + BIF name clashes. This option must be used to resolve name + clashes with BIFs auto-imported before R14A, if it is needed to call the local function with the same name as an auto-imported BIF without module prefix.

-

From R14A and forward, the compiler resolves calls +

As from R14A and forward, the compiler resolves calls without module prefix to local or imported functions before - trying auto-imported BIFs. If the BIF is to be + trying with auto-imported BIFs. If the BIF is to be called, use the erlang module prefix in the call, not - { no_auto_import,[{F,A}, ...]}

+ { no_auto_import,[{F,A}, ...]}.

If this option is written in the source code, as a -compile directive, the syntax F/A can be used instead - of {F,A}. Example:

+ of {F,A}, for example:

-compile({no_auto_import,[error/1]}).
no_auto_import -

Do not auto import any functions from the module erlang.

+

Do not auto-import any functions from erlang module.

no_line_info -

Omit line number information in order to produce a slightly +

Omits line number information to produce a slightly smaller output file.

-

If warnings are turned on (the report_warnings option - described above), the following options control what type of - warnings that will be generated. +

If warnings are turned on (option report_warnings + described earlier), the following options control what type of + warnings that are generated. - With the exception of {warn_format,Verbosity} all - options below have two forms; one warn_xxx form to - turn on the warning and one nowarn_xxx form to turn off - the warning. In the description that follows, the form that - is used to change the default value is listed.

+ Except from {warn_format,Verbosity}, the following options + have two forms:

+ + A warn_xxx form, to turn on the warning. + A nowarn_xxx form, to turn off the warning. + +

In the descriptions that follow, the form that is used to change + the default value are listed.

{warn_format, Verbosity}

Causes warnings to be emitted for malformed format strings as arguments to io:format and similar - functions. Verbosity selects the amount of - warnings: 0 = no warnings; 1 = warnings for invalid - format strings and incorrect number of arguments; 2 = - warnings also when the validity could not be checked - (for example, when the format string argument is a - variable). The default verbosity is 1. Verbosity 0 can - also be selected by the option nowarn_format.

+ functions.

+

Verbosity selects the number of warnings:

+ + 0 = No warnings + 1 = Warnings for invalid format strings and incorrect + number of arguments + 2 = Warnings also when the validity cannot + be checked, for example, when the format string argument is a + variable. + +

The default verbosity is 1. Verbosity 0 can + also be selected by option nowarn_format.

nowarn_bif_clash -

This option is removed, it will generate a fatal error if used.

+

This option is removed, it generates a fatal error if used.

-

Beginning with R14A, the compiler no longer calls the +

As from beginning with R14A, the compiler no longer calls the auto-imported BIF if the name clashes with a local or - explicitly imported function and a call without explicit - module name is issued. Instead the local or imported - function is called. Still accepting nowarn_bif_clash would makes a - module calling functions clashing with autoimported BIFs + explicitly imported function, and a call without explicit + module name is issued. Instead, the local or imported + function is called. Still accepting nowarn_bif_clash would + make a module calling functions clashing with auto-imported BIFs compile with both the old and new compilers, but with - completely different semantics, why the option was removed.

+ completely different semantics. This is why the option is removed.

-

The use of this option has always been strongly discouraged. - From OTP R14A and forward it's an error to use it.

+

The use of this option has always been discouraged. + As from R14A, it is an error to use it.

To resolve BIF clashes, use explicit module names or the {no_auto_import,[F/A]} compiler directive.

@@ -470,11 +474,11 @@ module.beam: module.erl \ {nowarn_bif_clash, FAs} -

This option is removed, it will generate a fatal error if used.

+

This option is removed, it generates a fatal error if used.

-

The use of this option has always been strongly discouraged. - From OTP R14A and forward it's an error to use it.

+

The use of this option has always been discouraged. + As from R14A, it is an error to use it.

To resolve BIF clashes, use explicit module names or the {no_auto_import,[F/A]} compiler directive.

@@ -482,35 +486,29 @@ module.beam: module.erl \ warn_export_all -

Causes a warning to be emitted if the export_all - option has also been given.

+

Emits a warning if option export_all is also given.

warn_export_vars -

Causes warnings to be emitted for all implicitly - exported variables referred to after the primitives - where they were first defined. No warnings for exported - variables unless they are referred to in some pattern, - which is the default, can be selected by the option - nowarn_export_vars.

+

Emits warnings for all implicitly exported variables + referred to after the primitives where they were first defined. + By default, the compiler only emits warnings for exported + variables referred to in a pattern.

- warn_shadow_vars + nowarn_shadow_vars -

Causes warnings to be emitted for "fresh" variables - in functional objects or list comprehensions with the same - name as some already defined variable. The default is to - warn for such variables. No warnings for shadowed - variables can be selected by the option - nowarn_shadow_vars.

+

Turns off warnings for "fresh" variables + in functional objects or list comprehensions with the same + name as some already defined variable. Default is to + emit warnings for such variables.

nowarn_unused_function -

Turns off warnings for unused local functions. - By default (warn_unused_function), warnings are - emitted for all local functions that are not called +

Turns off warnings for unused local functions. Default + is to emit warnings for all local functions that are not called directly or indirectly by an exported function. The compiler does not include unused local functions in the generated beam file, but the warning is still useful @@ -519,148 +517,142 @@ module.beam: module.erl \ {nowarn_unused_function, FAs} -

Turns off warnings for unused local functions as - nowarn_unused_function but only for the mentioned +

Turns off warnings for unused local functions like + nowarn_unused_function does, but only for the mentioned local functions. FAs is a tuple {Name,Arity} or a list of such tuples.

nowarn_deprecated_function -

Turns off warnings for calls to deprecated functions. By - default (warn_deprecated_function), warnings are - emitted for every call to a function known by the compiler - to be deprecated. Note that the compiler does not know - about the -deprecated() attribute but uses an +

Turns off warnings for calls to deprecated functions. Default + is to emit warnings for every call to a function known by the + compiler to be deprecated. Notice that the compiler does not know + about attribute -deprecated(), but uses an assembled list of deprecated functions in Erlang/OTP. To - do a more general check the Xref tool can be used. + do a more general check, the Xref tool can be used. See also xref(3) and the function - xref:m/1 also - accessible through - the c:xm/1 - function.

+ xref:m/1, also + accessible through the function + c:xm/1.

{nowarn_deprecated_function, MFAs} -

Turns off warnings for calls to deprecated functions as - nowarn_deprecated_function but only for +

Turns off warnings for calls to deprecated functions like + nowarn_deprecated_function does, but only for the mentioned functions. MFAs is a tuple {Module,Name,Arity} or a list of such tuples.

nowarn_deprecated_type -

Turns off warnings for uses of deprecated types. By - default (warn_deprecated_type), warnings are - emitted for every use of a type known by the compiler - to be deprecated.

+

Turns off warnings for use of deprecated types. Default + is to emit warnings for every use of a type known by the compiler + to be deprecated.

warn_obsolete_guard -

Causes warnings to be emitted for calls to old type - testing BIFs such as pid/1 and list/1. See - the - Erlang Reference Manual +

Emits warnings for calls to old type testing BIFs, + such as pid/1 and list/1. See the + Erlang Reference Manual for a complete list of type testing BIFs and their old - equivalents. No warnings for calls to old type testing - BIFs, which is the default, can be selected by the option - nowarn_obsolete_guard.

+ equivalents. Default is to emit no warnings for calls to + old type testing BIFs.

warn_unused_import -

Causes warnings to be emitted for unused imported - functions. No warnings for unused imported functions, - which is the default, can be selected by the option - nowarn_unused_import.

+

Emits warnings for unused imported functions. + Default is to emit no warnings for unused imported functions.

nowarn_unused_vars -

By default, warnings are emitted for variables which - are not used, with the exception of variables beginning - with an underscore ("Prolog style warnings"). +

By default, warnings are emitted for unused variables, + except for variables beginning with an underscore + ("Prolog style warnings"). Use this option to turn off this kind of warnings.

nowarn_unused_record -

Turns off warnings for unused record types. By - default (warn_unused_records), warnings are - emitted for unused locally defined record types.

+

Turns off warnings for unused record types. Default is to + emit warnings for unused locally defined record types.

Another class of warnings is generated by the compiler during optimization and code generation. They warn about patterns that will never match (such as a=b), guards - that will always evaluate to false, and expressions that will + that always evaluate to false, and expressions that always fail (such as atom+42).

- -

Note that the compiler does not warn for expressions that it - does not attempt to optimize. For instance, the compiler tries - to evaluate 1/0, notices that it will cause an - exception and emits a warning. On the other hand, - the compiler is silent about the similar expression - X/0; because of the variable in it, the compiler does - not even try to evaluate and therefore it emits no warnings. -

- -

Currently, those warnings cannot be disabled (except by +

Those warnings cannot be disabled (except by disabling all warnings).

+ +

The compiler does not warn for expressions that it + does not attempt to optimize. For example, the compiler tries + to evaluate 1/0, detects that it will cause an + exception, and emits a warning. However, + the compiler is silent about the similar expression, + X/0, because of the variable in it. Thus, the compiler does + not even try to evaluate and therefore it emits no warnings.

+
+ -

Obviously, the absence of warnings does not mean that +

The absence of warnings does not mean that there are no remaining errors in the code.

- -

Note that all the options except the include path - ({i,Dir}) can also be given in the file with a - -compile([Option,...]). attribute. - The -compile() attribute is allowed after function + + +

All options, except the include path + ({i,Dir}), can also be given in the file with attribute + -compile([Option,...]). + Attribute -compile() is allowed after the function definitions.

- -

Note also that the {nowarn_unused_function, FAs}, + + + +

The options {nowarn_unused_function, FAs}, {nowarn_bif_clash, FAs}, and - {nowarn_deprecated_function, MFAs} options are only + {nowarn_deprecated_function, MFAs} are only recognized when given in files. They are not affected by - the warn_unused_function, warn_bif_clash, or - warn_deprecated_function options.

+ options warn_unused_function, warn_bif_clash, or + warn_deprecated_function.

+

For debugging of the compiler, or for pure curiosity, the intermediate code generated by each compiler pass can be inspected. - A complete list of the options to produce list files can be - printed by typing compile:options() at the Erlang - shell prompt. - The options will be printed in order that the passes are + To print a complete list of the options to produce list files, + type compile:options() at the Erlang shell prompt. + The options are printed in the order that the passes are executed. If more than one listing option is used, the one representing the earliest pass takes effect.

-

Unrecognized options are ignored.

+

Unrecognized options are ignored.

Both WarningList and ErrorList have the following format:

-[{FileName,[ErrorInfo]}]. - - -

ErrorInfo is described below. The file name has been - included here as the compiler uses the Erlang pre-processor - epp, which allows the code to be included in other - files. For this reason, it is important to know to - which file an error or warning line number refers. +[{FileName,[ErrorInfo]}]. + +

ErrorInfo is described later in this section. + The filename is included here, as the compiler uses the + Erlang pre-processor epp, which allows the code to be + included in other files. It is therefore important to know to + which file the line number of an error or a warning refers.

forms(Forms) - Compile a list of forms + Compiles a list of forms.

Is the same as forms(File, [verbose,report_errors,report_warnings]). @@ -670,7 +662,7 @@ module.beam: module.erl \ forms(Forms, Options) -> CompRet - Compile a list of forms + Compiles a list of forms. Forms = [Form] CompRet = BinRet | ErrRet @@ -681,48 +673,49 @@ module.beam: module.erl \

Analogous to file/1, but takes a list of forms (in the Erlang abstract format representation) as first argument. - The option binary is implicit; i.e., no object code - file is produced. Options that would ordinarily produce a - listing file, such as 'E', will instead cause the internal - format for that compiler pass (an Erlang term; usually not a - binary) to be returned instead of a binary.

+ Option binary is implicit, that is, no object code + file is produced. For options that normally produce a listing + file, such as 'E', the internal format for that compiler pass + (an Erlang term, usually not a binary) is returned instead of + a binary.

format_error(ErrorDescriptor) -> chars() - Format an error descriptor + Formats an error descriptor. ErrorDescriptor = errordesc()

Uses an ErrorDescriptor and returns a deep list of - characters which describes the error. This function is - usually called implicitly when an ErrorInfo structure - is processed. See below.

+ characters that describes the error. This function is + usually called implicitly when an ErrorInfo structure + (described in section + Error Information) is processed.

output_generated(Options) -> true | false - Determine whether the compile will generate an output file + Determines whether the compiler generates an output file. Options = [term()] -

Determines whether the compiler would generate a beam +

Determines whether the compiler generates a beam file with the given options. true means that a beam - file would be generated; false means that the compiler - would generate some listing file, return a binary, or merely - check the syntax of the source code.

+ file is generated. false means that the compiler + generates some listing file, returns a binary, or merely + checks the syntax of the source code.

noenv_file(File, Options) -> CompRet - Compile a file (ignoring ERL_COMPILER_OPTIONS) + Compiles a file (ignoring ERL_COMPILER_OPTIONS). -

Works exactly like file/2, +

Works like file/2, except that the environment variable ERL_COMPILER_OPTIONS is not consulted.

@@ -730,9 +723,9 @@ module.beam: module.erl \ noenv_forms(Forms, Options) -> CompRet - Compile a list of forms (ignoring ERL_COMPILER_OPTIONS) + Compiles a list of forms (ignoring ERL_COMPILER_OPTIONS). -

Works exactly like forms/2, +

Works like forms/2, except that the environment variable ERL_COMPILER_OPTIONS is not consulted.

@@ -740,12 +733,13 @@ module.beam: module.erl \ noenv_output_generated(Options) -> true | false - Determine whether the compile will generate an output file (ignoring ERL_COMPILER_OPTIONS) + Determines whether the compiler generates an output file + (ignoring ERL_COMPILER_OPTIONS). Options = [term()] -

Works exactly like +

Works like output_generated/1, except that the environment variable ERL_COMPILER_OPTIONS is not consulted.

@@ -755,14 +749,14 @@ module.beam: module.erl \
- Default compiler options + Default Compiler Options

The (host operating system) environment variable ERL_COMPILER_OPTIONS can be used to give default compiler options. Its value must be a valid Erlang term. If the value is a - list, it will be used as is. If it is not a list, it will be put + list, it is used as is. If it is not a list, it is put into a list.

-

The list will be appended to any options given to +

The list is appended to any options given to file/2, forms/2, and output_generated/2. @@ -770,9 +764,9 @@ module.beam: module.erl \ noenv_file/2, noenv_forms/2, or noenv_output_generated/2 - if you don't want the environment variable to be consulted - (for instance, if you are calling the compiler recursively from - inside a parse transform).

+ if you do not want the environment variable to be consulted, + for example, if you are calling the compiler recursively from + inside a parse transform.

@@ -781,31 +775,31 @@ module.beam: module.erl \ module. Inlining means that a call to a function is replaced with the function body with the arguments replaced with the actual values. The semantics are preserved, except if exceptions are - generated in the inlined code. Exceptions will be reported as + generated in the inlined code. Exceptions are reported as occurring in the function the body was inlined into. Also, - function_clause exceptions will be converted to similar + function_clause exceptions are converted to similar case_clause exceptions.

-

When a function is inlined, the original function will be +

When a function is inlined, the original function is kept if it is exported (either by an explicit export or if the - export_all option was given) or if not all calls to the - function were inlined.

+ option export_all was given) or if not all calls to the + function are inlined.

Inlining does not necessarily improve running time. - For instance, inlining may increase Beam stack usage which will - probably be detrimental to performance for recursive functions. + For example, inlining can increase Beam stack use, which + probably is detrimental to performance for recursive functions.

-

Inlining is never default; it must be explicitly enabled with a +

Inlining is never default. It must be explicitly enabled with a compiler option or a -compile() attribute in the source module.

-

To enable inlining, either use the inline option to - let the compiler decide which functions to inline or +

To enable inlining, either use the option inline to + let the compiler decide which functions to inline, or {inline,[{Name,Arity},...]} to have the compiler inline all calls to the given functions. If the option is given inside a compile directive in an Erlang module, {Name,Arity} - may be written as Name/Arity.

+ can be written as Name/Arity.

Example of explicit inlining:

@@ -817,33 +811,30 @@ pi() -> 3.1416.

Example of implicit inlining:

--compile(inline).
-    
+-compile(inline). -

The {inline_size,Size} option controls how large functions - that are allowed to be inlined. Default is 24, which will - keep the size of the inlined code roughly the same as - the un-inlined version (only relatively small functions will be +

The option {inline_size,Size} controls how large functions + that are allowed to be inlined. Default is 24, which + keeps the size of the inlined code roughly the same as + the un-inlined version (only relatively small functions are inlined).

Example:

 %% Aggressive inlining - will increase code size.
 -compile(inline).
--compile({inline_size,100}).
-    
+-compile({inline_size,100}).
- Inlining of list functions -

The compiler can also inline a variety of list manipulation functions - from the stdlib's lists module.

+ Inlining of List Functions +

The compiler can also inline various list manipulation functions + from the module list in STDLIB.

This feature must be explicitly enabled with a compiler option or a -compile() attribute in the source module.

-

To enable inlining of list functions, use the inline_list_funcs - option.

+

To enable inlining of list functions, use option inline_list_funcs.

The following functions are inlined:

@@ -869,24 +860,23 @@ pi() -> 3.1416.
+ Error Information -

The ErrorInfo mentioned above is the standard - ErrorInfo structure which is returned from all IO modules. +

The ErrorInfo mentioned earlier is the standard + ErrorInfo structure, which is returned from all I/O modules. It has the following format:

-{ErrorLine, Module, ErrorDescriptor} - +{ErrorLine, Module, ErrorDescriptor} -

ErrorLine will be the atom none if the error does - not correspond to a specific line (e.g. if the source file does - not exist).

+

ErrorLine is the atom none if the error does + not correspond to a specific line, for example, if the source file does + not exist.

A string describing the error is obtained with the following call:

-Module:format_error(ErrorDescriptor) - +Module:format_error(ErrorDescriptor)
diff --git a/lib/compiler/doc/src/ref_man.xml b/lib/compiler/doc/src/ref_man.xml index 6478ad4b11..6584e79c4e 100644 --- a/lib/compiler/doc/src/ref_man.xml +++ b/lib/compiler/doc/src/ref_man.xml @@ -29,7 +29,7 @@ application.sgml
-

The Compiler application compiles Erlang +

The Compiler application compiles Erlang code to byte-code. The highly compact byte-code is executed by the Erlang emulator.

-- cgit v1.2.3 From 738c34d4bb8f1a3811acd00af8c6c12107f8315b Mon Sep 17 00:00:00 2001 From: Bruce Yinhe Date: Thu, 18 Jun 2015 11:31:02 +0200 Subject: Change license text to APLv2 --- lib/compiler/doc/src/Makefile | 21 +++++++++++---------- lib/compiler/doc/src/book.xml | 21 +++++++++++---------- lib/compiler/doc/src/compile.xml | 21 +++++++++++---------- lib/compiler/doc/src/notes.xml | 21 +++++++++++---------- lib/compiler/doc/src/notes_history.xml | 21 +++++++++++---------- lib/compiler/doc/src/part_notes.xml | 21 +++++++++++---------- lib/compiler/doc/src/part_notes_history.xml | 19 ++++++++++--------- lib/compiler/doc/src/ref_man.xml | 21 +++++++++++---------- 8 files changed, 87 insertions(+), 79 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/Makefile b/lib/compiler/doc/src/Makefile index 13a73a5d31..b989325686 100644 --- a/lib/compiler/doc/src/Makefile +++ b/lib/compiler/doc/src/Makefile @@ -3,16 +3,17 @@ # # Copyright Ericsson AB 1997-2012. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # diff --git a/lib/compiler/doc/src/book.xml b/lib/compiler/doc/src/book.xml index 45b49fe46d..8de3fae69a 100644 --- a/lib/compiler/doc/src/book.xml +++ b/lib/compiler/doc/src/book.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index a271729c82..db701409db 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 9b5b44f3e1..3311943b3c 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/compiler/doc/src/notes_history.xml b/lib/compiler/doc/src/notes_history.xml index 9e8934f416..85216b2c66 100644 --- a/lib/compiler/doc/src/notes_history.xml +++ b/lib/compiler/doc/src/notes_history.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/compiler/doc/src/part_notes.xml b/lib/compiler/doc/src/part_notes.xml index 0c1fdd567d..5000f50dca 100644 --- a/lib/compiler/doc/src/part_notes.xml +++ b/lib/compiler/doc/src/part_notes.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/compiler/doc/src/part_notes_history.xml b/lib/compiler/doc/src/part_notes_history.xml index a4909f156e..046b4893c3 100644 --- a/lib/compiler/doc/src/part_notes_history.xml +++ b/lib/compiler/doc/src/part_notes_history.xml @@ -9,16 +9,17 @@ Ericsson AB, All Rights Reserved - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. The Initial Developer of the Original Code is Ericsson AB. diff --git a/lib/compiler/doc/src/ref_man.xml b/lib/compiler/doc/src/ref_man.xml index 6584e79c4e..d360e7963f 100644 --- a/lib/compiler/doc/src/ref_man.xml +++ b/lib/compiler/doc/src/ref_man.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. -- cgit v1.2.3 From 2955ddebc32837b66d9bacb4e925ad0ed0033168 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 23 Jun 2015 10:24:26 +0200 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 113 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 3311943b3c..6db8d19b5a 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,6 +32,119 @@

This document describes the changes made to the Compiler application.

+
Compiler 6.0 + +
Fixed Bugs and Malfunctions + + +

+ The compiler optimizes away building of terms that are + never actually used. As a result, the compiler in OTP 18 + may produce more warnings for terms that are built but + not used than the compiler in OTP 17.

+

+ Own Id: OTP-12453

+
+ +

+ Using a map could incorrectly suppress warnings for + unused variables.

+

+ Own Id: OTP-12515

+
+ +

+ The compiler now properly reports unknown parse + transforms. That is, undef exceptions coming from + the parse transform itself is reported differently from + the absence of the parse transform.

+

+ Own Id: OTP-12723

+
+ +

+ Allow for 'creation of sub binary delayed' optimization + if maps instructions are in a clause.

+

+ Own Id: OTP-12758

+
+
+
+ + +
Improvements and New Features + + +

+ The cerl and cerl_trees modules in the + compiler application are now documented.

+

+ Own Id: OTP-11978

+
+ +

+ The deprecated 'asm' option has been removed.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12100

+
+ +

+ Support variables as Map keys in expressions and patterns

+

Erlang will accept any expression as keys in Map + expressions and it will accept literals or bound + variables as keys in Map patterns.

+

+ Own Id: OTP-12218

+
+ +

+ Infer Map type information in beam_type compiler + optimization pass.

+

+ Own Id: OTP-12253

+
+ +

+ Compiler optimizations have been improved.

+

+ Own Id: OTP-12393

+
+ +

+ Five undocumented functions in the module core_lib + have been deprecated and will be removed in the next + major release. The functions are: get_anno/{1,2}, + is_literal/1, is_literal_list/1, and + literal_value. Use the appropriate functions in + the cerl module instead.

+

+ Own Id: OTP-12497

+
+ +

+ Change some internal data structures to Maps in order to + speed up compilation time. Measured speed up is around + 10%-15%.

+

+ Own Id: OTP-12774

+
+ +

+ Fix beam_bool pass for Maps instruction get_map_elements

+

+ Before beam_split the get_map_elements instruction is + still in blocks and the helper function in beam_jump did + not reflect this.

+

+ Own Id: OTP-12844 Aux Id: 17

+
+
+
+ +
+
Compiler 5.0.4
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 6738d356a279835222b951fd213ed4cf9897eb7e Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 21 Sep 2015 17:09:23 +0200 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 6db8d19b5a..bd85f22462 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,6 +32,26 @@

This document describes the changes made to the Compiler application.

+
Compiler 6.0.1 + +
Fixed Bugs and Malfunctions + + +

+ Fix get_map_elements register corruption

+

+ Instruction get_map_elements might destroy target + registers when the fail-label is taken. Only seen for + patterns with two, and only two, target registers. + Specifically if we copy one register and then jump.

+

+ Own Id: OTP-12967

+
+
+
+ +
+
Compiler 6.0
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 6f50633829adc53d20a2c2aee454aef8caece907 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 13 Oct 2015 14:01:18 +0200 Subject: [compiler] Correct documentation Fix mistakes found by 'xmllint'. --- lib/compiler/doc/src/notes.xml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index bd85f22462..daf3bd3af9 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -458,22 +458,28 @@

EEP43: New data type - Maps

- With Maps you may for instance: M0 = - #{ a => 1, b => 2}, % create - associations M1 = M0#{ a := 10 }, % - update values M2 = M1#{ "hi" => - "hello"}, % add new associations #{ - "hi" := V1, a := V2, b := V3} = M2. % match keys with - values

+ With Maps you may for instance:

+ + M0 = #{ a => 1, b => 2}, % create + associations + M1 = M0#{ a := 10 }, % update values + M2 = M1#{ "hi" => + "hello"}, % add new associations + #{ "hi" := V1, a := V2, b := V3} = M2. + % match keys with values +

For information on how to use Maps please see Map Expressions in the Reference Manual.

The current implementation is without the following - features: No variable keys - No single value access No map - comprehensions

+ features:

+ + No variable keys + No single value access + No map comprehensions +

Note that Maps is experimental during OTP 17.0.

-- cgit v1.2.3 From f4a0ae1736216feac5ae053610644bba2e12ed34 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 15 Dec 2015 09:45:27 +0100 Subject: Update release notes --- lib/compiler/doc/src/notes.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index daf3bd3af9..3c06e4f98e 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,6 +32,29 @@

This document describes the changes made to the Compiler application.

+
Compiler 6.0.2 + +
Fixed Bugs and Malfunctions + + +

+ Fix cerl_trees:label/2 bug with map K/V swap

+

+ Own Id: OTP-13091

+
+ +

+ Warnings produced when the 'bin_opt_info' option + was given could sometimes lack filenames and line + numbers. (Thanks to José Valim for reporting this bug.)

+

+ Own Id: OTP-13113

+
+
+
+ +
+
Compiler 6.0.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 0f8afe80c6582f7affd17f36dc9cb48cc7946713 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 14 Mar 2016 10:46:23 +0100 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 3c06e4f98e..8ed71db54a 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,6 +32,55 @@

This document describes the changes made to the Compiler application.

+
Compiler 6.0.3 + +
Fixed Bugs and Malfunctions + + +

+ An complicated guard expression in a function call could + crash the compiler. (Thanks to Thomas Arts for reporting + this bug.)

+

+ Own Id: OTP-13208

+
+ +

Constructing a map in a guard in a catch could crash + the compiler. (Thanks to Thomas Arts for reporting this + bug.)

+

+ Own Id: OTP-13223

+
+ +

Updating a fun as if it were a map would cause the + compiler to crash. (Thanks to Thomas Arts for reporting + this bug.)

+

+ Own Id: OTP-13231

+
+ +

+ Fix pretty printing of Core Maps

+

+ Literal maps could cause Dialyzer to crash when pretty + printing the results.

+

+ Own Id: OTP-13238

+
+ +

+ A complex combination of bit syntax matching operations + would cause an internal consistency check failure during + compilation. (Thanks to Jose Valim for reporting this + bug.)

+

+ Own Id: OTP-13309

+
+
+
+ +
+
Compiler 6.0.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 6664eed554974336909d3ffe03f20349cc4c38fd Mon Sep 17 00:00:00 2001 From: Henrik Nord Date: Tue, 15 Mar 2016 15:19:56 +0100 Subject: update copyright-year --- lib/compiler/doc/src/Makefile | 2 +- lib/compiler/doc/src/book.xml | 2 +- lib/compiler/doc/src/compile.xml | 2 +- lib/compiler/doc/src/notes.xml | 2 +- lib/compiler/doc/src/notes_history.xml | 2 +- lib/compiler/doc/src/part_notes.xml | 2 +- lib/compiler/doc/src/part_notes_history.xml | 2 +- lib/compiler/doc/src/ref_man.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/Makefile b/lib/compiler/doc/src/Makefile index b989325686..c6864cb835 100644 --- a/lib/compiler/doc/src/Makefile +++ b/lib/compiler/doc/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1997-2012. All Rights Reserved. +# Copyright Ericsson AB 1997-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/compiler/doc/src/book.xml b/lib/compiler/doc/src/book.xml index 8de3fae69a..af6b4cf47a 100644 --- a/lib/compiler/doc/src/book.xml +++ b/lib/compiler/doc/src/book.xml @@ -4,7 +4,7 @@
- 19972013 + 19972016 Ericsson AB. All Rights Reserved. diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index db701409db..954750fcdd 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -4,7 +4,7 @@
- 19962014 + 19962016 Ericsson AB. All Rights Reserved. diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 8ed71db54a..ae375c5f58 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20042013 + 20042016 Ericsson AB. All Rights Reserved. diff --git a/lib/compiler/doc/src/notes_history.xml b/lib/compiler/doc/src/notes_history.xml index 85216b2c66..16bfb3d34b 100644 --- a/lib/compiler/doc/src/notes_history.xml +++ b/lib/compiler/doc/src/notes_history.xml @@ -4,7 +4,7 @@
- 20062013 + 20062016 Ericsson AB. All Rights Reserved. diff --git a/lib/compiler/doc/src/part_notes.xml b/lib/compiler/doc/src/part_notes.xml index 5000f50dca..c1f0ff3861 100644 --- a/lib/compiler/doc/src/part_notes.xml +++ b/lib/compiler/doc/src/part_notes.xml @@ -4,7 +4,7 @@
- 20042013 + 20042016 Ericsson AB. All Rights Reserved. diff --git a/lib/compiler/doc/src/part_notes_history.xml b/lib/compiler/doc/src/part_notes_history.xml index 046b4893c3..4019676b83 100644 --- a/lib/compiler/doc/src/part_notes_history.xml +++ b/lib/compiler/doc/src/part_notes_history.xml @@ -5,7 +5,7 @@
2006 - 2013 + 2016 Ericsson AB, All Rights Reserved diff --git a/lib/compiler/doc/src/ref_man.xml b/lib/compiler/doc/src/ref_man.xml index d360e7963f..f5466553c0 100644 --- a/lib/compiler/doc/src/ref_man.xml +++ b/lib/compiler/doc/src/ref_man.xml @@ -4,7 +4,7 @@
- 19962013 + 19962016 Ericsson AB. All Rights Reserved. -- cgit v1.2.3 From bd64ad8e15d66e48b36dbe3584315dd5cfc8b59a Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Wed, 11 May 2016 17:22:23 +0200 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index ae375c5f58..dede5aa0fd 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,6 +32,86 @@

This document describes the changes made to the Compiler application.

+
Compiler 7.0 + +
Fixed Bugs and Malfunctions + + +

compile:forms/1,2 would crash when used in a + working directory thad had been deleted by another + process. (Thanks to Adam Lindberg for reporting this + bug.)

+

+ Own Id: OTP-13430 Aux Id: ERL-113

+
+
+
+ + +
Improvements and New Features + + +

+ Optimization of tuple matching has been slightly + improved.

+

+ Own Id: OTP-12951

+
+ +

Five deprecated and undocumented functions in the + module core_lib have been removed. The functions + are: get_anno/{1,2}, is_literal/1, + is_literal_list/1, and literal_value. Use + the appropriate functions in the cerl module + instead.

+

+ Own Id: OTP-12979

+
+ +

The pre-processor can now expand the ?FUNCTION_NAME + and ?FUNCTION_ARITY macros.

+

+ Own Id: OTP-13059

+
+ +

The function mapfold/4 has been added to the + cerl_trees module.

+

+ Own Id: OTP-13280

+
+ +

Bitstring comprehensions have been generalized to + allow arbitrary expressions in the construction part.

+

+ Own Id: OTP-13289

+
+ +

The compiler will now produce warnings for binary + patterns that will never match (example: + <<-1/unsigned>> = Bin).

+

+ Own Id: OTP-13374 Aux Id: ERL-44

+
+ +

The compiler will no longer put the compilation date + and time into BEAM files. That means that two BEAM files + compiled on the same computer from the same source code + and compilation options will be identical.

+

Note: If you want to find out whether a BEAM file on + disk is different from the loaded code, compared the MD5 + value obtained from Mod:module_info(md5) with the + MD5 value obtained from + beam_lib:md5(BeamFileForMod)

. +

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13504

+
+
+
+ +
+
Compiler 6.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 663e847459686604ea051f036a0e4caff18cea6f Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 12 May 2016 12:04:14 +0200 Subject: Revert "Prepare release" This reverts commit bd64ad8e15d66e48b36dbe3584315dd5cfc8b59a. --- lib/compiler/doc/src/notes.xml | 80 ------------------------------------------ 1 file changed, 80 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index dede5aa0fd..ae375c5f58 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,86 +32,6 @@

This document describes the changes made to the Compiler application.

-
Compiler 7.0 - -
Fixed Bugs and Malfunctions - - -

compile:forms/1,2 would crash when used in a - working directory thad had been deleted by another - process. (Thanks to Adam Lindberg for reporting this - bug.)

-

- Own Id: OTP-13430 Aux Id: ERL-113

-
-
-
- - -
Improvements and New Features - - -

- Optimization of tuple matching has been slightly - improved.

-

- Own Id: OTP-12951

-
- -

Five deprecated and undocumented functions in the - module core_lib have been removed. The functions - are: get_anno/{1,2}, is_literal/1, - is_literal_list/1, and literal_value. Use - the appropriate functions in the cerl module - instead.

-

- Own Id: OTP-12979

-
- -

The pre-processor can now expand the ?FUNCTION_NAME - and ?FUNCTION_ARITY macros.

-

- Own Id: OTP-13059

-
- -

The function mapfold/4 has been added to the - cerl_trees module.

-

- Own Id: OTP-13280

-
- -

Bitstring comprehensions have been generalized to - allow arbitrary expressions in the construction part.

-

- Own Id: OTP-13289

-
- -

The compiler will now produce warnings for binary - patterns that will never match (example: - <<-1/unsigned>> = Bin).

-

- Own Id: OTP-13374 Aux Id: ERL-44

-
- -

The compiler will no longer put the compilation date - and time into BEAM files. That means that two BEAM files - compiled on the same computer from the same source code - and compilation options will be identical.

-

Note: If you want to find out whether a BEAM file on - disk is different from the loaded code, compared the MD5 - value obtained from Mod:module_info(md5) with the - MD5 value obtained from - beam_lib:md5(BeamFileForMod)

. -

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13504

-
-
-
- -
-
Compiler 6.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From e020f75c10410a6943cd055bfa072a2641eab7da Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 2 Jun 2016 10:55:26 +0200 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 89 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index ae375c5f58..5d7f48857e 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,6 +32,95 @@

This document describes the changes made to the Compiler application.

+
Compiler 7.0 + +
Fixed Bugs and Malfunctions + + +

compile:forms/1,2 would crash when used in a + working directory thad had been deleted by another + process. (Thanks to Adam Lindberg for reporting this + bug.)

+

+ Own Id: OTP-13430 Aux Id: ERL-113

+
+ +

Dialyzer no longer crashes when there is an invalid + function call such as 42(7) in a module being + analyzed. The compiler will now warn for invalid function + calls such as X = 42, x(7). (ERL-138. Thanks to + Daniel Feltey for reporting this bug.)

+

+ Own Id: OTP-13552

+
+
+
+ + +
Improvements and New Features + + +

+ Optimization of tuple matching has been slightly + improved.

+

+ Own Id: OTP-12951

+
+ +

Five deprecated and undocumented functions in the + module core_lib have been removed. The functions + are: get_anno/{1,2}, is_literal/1, + is_literal_list/1, and literal_value. Use + the appropriate functions in the cerl module + instead.

+

+ Own Id: OTP-12979

+
+ +

The pre-processor can now expand the ?FUNCTION_NAME + and ?FUNCTION_ARITY macros.

+

+ Own Id: OTP-13059

+
+ +

The function mapfold/4 has been added to the + cerl_trees module.

+

+ Own Id: OTP-13280

+
+ +

Bitstring comprehensions have been generalized to + allow arbitrary expressions in the construction part.

+

+ Own Id: OTP-13289

+
+ +

The compiler will now produce warnings for binary + patterns that will never match (example: + <<-1/unsigned>> = Bin).

+

+ Own Id: OTP-13374 Aux Id: ERL-44

+
+ +

The compiler will no longer put the compilation date + and time into BEAM files. That means that two BEAM files + compiled on the same computer from the same source code + and compilation options will be identical.

+

Note: If you want to find out whether a BEAM file on + disk is different from the loaded code, compared the MD5 + value obtained from Mod:module_info(md5) with the + MD5 value obtained from + beam_lib:md5(BeamFileForMod)

. +

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13504

+
+
+
+ +
+
Compiler 6.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From c04cad3ba921deb086d19e2de2526af4854add75 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 2 Jun 2016 11:39:07 +0200 Subject: Revert "Prepare release" This reverts commit e020f75c10410a6943cd055bfa072a2641eab7da. --- lib/compiler/doc/src/notes.xml | 89 ------------------------------------------ 1 file changed, 89 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index 5d7f48857e..ae375c5f58 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,95 +32,6 @@

This document describes the changes made to the Compiler application.

-
Compiler 7.0 - -
Fixed Bugs and Malfunctions - - -

compile:forms/1,2 would crash when used in a - working directory thad had been deleted by another - process. (Thanks to Adam Lindberg for reporting this - bug.)

-

- Own Id: OTP-13430 Aux Id: ERL-113

-
- -

Dialyzer no longer crashes when there is an invalid - function call such as 42(7) in a module being - analyzed. The compiler will now warn for invalid function - calls such as X = 42, x(7). (ERL-138. Thanks to - Daniel Feltey for reporting this bug.)

-

- Own Id: OTP-13552

-
-
-
- - -
Improvements and New Features - - -

- Optimization of tuple matching has been slightly - improved.

-

- Own Id: OTP-12951

-
- -

Five deprecated and undocumented functions in the - module core_lib have been removed. The functions - are: get_anno/{1,2}, is_literal/1, - is_literal_list/1, and literal_value. Use - the appropriate functions in the cerl module - instead.

-

- Own Id: OTP-12979

-
- -

The pre-processor can now expand the ?FUNCTION_NAME - and ?FUNCTION_ARITY macros.

-

- Own Id: OTP-13059

-
- -

The function mapfold/4 has been added to the - cerl_trees module.

-

- Own Id: OTP-13280

-
- -

Bitstring comprehensions have been generalized to - allow arbitrary expressions in the construction part.

-

- Own Id: OTP-13289

-
- -

The compiler will now produce warnings for binary - patterns that will never match (example: - <<-1/unsigned>> = Bin).

-

- Own Id: OTP-13374 Aux Id: ERL-44

-
- -

The compiler will no longer put the compilation date - and time into BEAM files. That means that two BEAM files - compiled on the same computer from the same source code - and compilation options will be identical.

-

Note: If you want to find out whether a BEAM file on - disk is different from the loaded code, compared the MD5 - value obtained from Mod:module_info(md5) with the - MD5 value obtained from - beam_lib:md5(BeamFileForMod)

. -

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13504

-
-
-
- -
-
Compiler 6.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 60a13b64316a79edbf830811cdf113311c6547b7 Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Mon, 6 Jun 2016 21:52:14 -0700 Subject: Compiler: new function env_compiler_options/0 retrieve the value of the environment variable ERL_COMPILER_OPTIONS in the same manner as used by file/2, forms/2 and output_generated/2 --- lib/compiler/doc/src/compile.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index 954750fcdd..0fb09061b6 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -39,6 +39,19 @@ + + env_compiler_options() + + Compiler options defined via the environment variable + ERL_COMPILER_OPTIONS + + +

Return compiler options given via the environment variable + ERL_COMPILER_OPTIONS. If the value is a list, it is + returned as is. If it is not a list, it is put into a list. +

+
+
file(File) Compiles a file. @@ -768,6 +781,10 @@ module.beam: module.erl \ if you do not want the environment variable to be consulted, for example, if you are calling the compiler recursively from inside a parse transform.

+ +

The list can be retrieved with + env_compiler_options/0 + .

-- cgit v1.2.3 From d567a443e1b3506fdef7d1f57af8d4cd364d45b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 8 Jun 2016 10:14:17 +0200 Subject: compile.xml: Eliminate unsightly space before period --- lib/compiler/doc/src/compile.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index 0fb09061b6..61e214294e 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -783,8 +783,7 @@ module.beam: module.erl \ inside a parse transform.

The list can be retrieved with - env_compiler_options/0 - .

+ env_compiler_options/0.

-- cgit v1.2.3 From 6e51c6d19612d03abc81b86bb70b8d7da678ce5d Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 21 Jun 2016 15:12:41 +0200 Subject: Prepare release --- lib/compiler/doc/src/notes.xml | 94 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) (limited to 'lib/compiler/doc/src') diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index ae375c5f58..e25cdc580c 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,6 +32,100 @@

This document describes the changes made to the Compiler application.

+
Compiler 7.0 + +
Fixed Bugs and Malfunctions + + +

compile:forms/1,2 would crash when used in a + working directory that had been deleted by another + process.

+

+ Own Id: OTP-13430 Aux Id: ERL-113

+
+ +

Dialyzer no longer crashes when there is an invalid + function call such as 42(7) in a module being + analyzed. The compiler will now warn for invalid function + calls such as X = 42, x(7).

+

+ Own Id: OTP-13552 Aux Id: ERL-138

+
+
+
+ + +
Improvements and New Features + + +

+ Optimization of tuple matching has been slightly + improved.

+

+ Own Id: OTP-12951

+
+ +

Five deprecated and undocumented functions in the + module core_lib have been removed. The functions + are: get_anno/{1,2}, is_literal/1, + is_literal_list/1, and literal_value. Use + the appropriate functions in the cerl module + instead.

+

+ Own Id: OTP-12979

+
+ +

The pre-processor can now expand the ?FUNCTION_NAME + and ?FUNCTION_ARITY macros.

+

+ Own Id: OTP-13059

+
+ +

The function mapfold/4 has been added to the + cerl_trees module.

+

+ Own Id: OTP-13280

+
+ +

Bitstring comprehensions have been generalized to + allow arbitrary expressions in the construction part.

+

+ Own Id: OTP-13289

+
+ +

The compiler will now produce warnings for binary + patterns that will never match (example: + <<-1/unsigned>> = Bin).

+

+ Own Id: OTP-13374 Aux Id: ERL-44

+
+ +

The compiler will no longer put the compilation date + and time into BEAM files. That means that two BEAM files + compiled on the same computer from the same source code + and compilation options will be identical.

+

Note: If you want to find out whether a BEAM file on + disk is different from the loaded code, compared the MD5 + value obtained from Mod:module_info(md5) with the + MD5 value obtained from + beam_lib:md5(BeamFileForMod)

. +

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13504

+
+ +

The function compile:env_compiler_options/0 has + been added to allow tools to pick up the same default + compiler options as the compiler itself.

+

+ Own Id: OTP-13654

+
+
+
+ +
+
Compiler 6.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3