Age | Commit message (Collapse) | Author |
|
The compiler would crash in v3_codegen when trying to compile the
following code:
is_port(_) -> false.
foo(P) when port(P) -> ok.
We *could* have the compiler interpret the code as:
is_port(_) -> false.
foo(P) when erlang:is_port(P) -> ok.
But that would encourage using the obsolete form of the guard tests.
Note that the following code is illegal:
is_port(_) -> false.
foo(P) when is_port(P) -> ok.
It produces the following diagnostic:
call to local/imported function is_port/1 is illegal in guard
Therefore, we should refuse to compile the code.
|
|
* bjorn/eliminate-sys_pre_expand/OTP-13856:
Remove sys_pre_expand
xref: Eliminate use of sys_pre_expand
debugger: Eliminate use of sys_pre_expand
compiler: Eliminate use of sys_pre_expand
shell_SUITE: Eliminate references to sys_pre_expand in comments
qlc_pt: Simplify code because of updated erl_expand_records
Teach erl_expand_records to translate module-less calls
erl_internal: Add add_predefined_functions/1
cover: Remove always stale comment
|
|
* maint:
doc: Correct errors introduced by Editorial changes
|
|
* hasse/doc/fix_editorial_changes:
doc: Correct errors introduced by Editorial changes
|
|
The previous commits have made sys_pre_expand superfluous. Since
sys_pre_expand is undocumented and unsupported it can be removed in
a major release without prior deprecation.
Also remove code in erl_parse that handles abstract code that has
passed through sys_pre_expand.
We considered deprecating sys_pre_expand just in case, but decided
against it for the following reasons:
- Anyone brave and knowledgeable enough to use sys_pre_expand should
be able to cope with sys_pre_expand being removed.
- If we kept it, but didn't test it anywhere in OTP, it could
potentially stop working. So we would probably have to add some test
cases.
|
|
sys_pre_expand previously did a lot more work, for example,
translating records and funs, but now is merely a grab bag
of small transformations. Move those transformations to
v3_core.
|
|
Make it clear that we test that the shell is not dependent on
the compiler application being in the path.
|
|
erl_expand_records now adds "erlang:" to calls to BIFs, so we
can simplify the code.
|
|
As the next step in eliminating sys_pre_expand, teach
erl_expand_records to handle calls without explicit module name. If
such call refer to a BIF or imported function, add an explicit module
name.
That means that any subsequent pass will know that a call without
a module name is always to a local function defined in the module.
|
|
The sys_pre_expand module used to do a lot more (translate records and
funs, for example), but now it does very little. Most of the code is
an identify transformation of the abstract format.
The identity transformation part of the code must be maintained and
kept correct when new forms are added to the abstract format. That
adds to the maintance burden. It also adds (slightly) to compilation
times. Therefore, we want to eliminate sys_pre_expand, moving all of
its (non-identity) transformations to better places.
As a preliminary first step, move the code that adds the pre-defined
functions (such as module_info/0) to a new function in erl_internal.
|
|
* maint:
beam_lib: Correct type for the abstract code chunk
|
|
The abstract_code chunk can also contain {eof,_}, {error,_}, and
{warning,_} in addition to the abstract forms that make up the Erlang
syntax proper.
|
|
Fix some older errors as well.
|
|
* maint:
Fix xmllint-warnings
|
|
|
|
|
|
* raimo/gen_statem-callback_mode/OTP-13752:
ssl: Upgrade suite testing skipped if stdlib upgrade is required
Fix version numbers and dependencies
Conflicts:
lib/ssl/src/ssl.appup.src
lib/ssl/vsn.mk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* josevalim/large-binary-strings/PR-1131/OTP-13794:
Move expansion of strings in binaries to v3_core
|
|
|
|
This speeds up the compilation of binary literals
with string values in them. For example, compiling
a file with a ~340kB binary would yield the following
times by the compiler:
Compiling "foo"
parse_module : 0.130 s 5327.6 kB
transform_module : 0.000 s 5327.6 kB
lint_module : 0.011 s 5327.8 kB
expand_module : 0.508 s 71881.2 kB
v3_core : 0.463 s 11.5 kB
Notice the increase in memory and processing time
in expand_module and v3_core. This happened because
expand_module would expand the string in binaries
into chars. For example, the binary <<"foo">>, which
is represented as
{bin, 1, [
{bin_element, 1, {string, 1, "foo"}, default, default}
]}
would be converted to
{bin, 1, [
{bin_element, 1, {char, 1, $f}, default, default},
{bin_element, 1, {char, 1, $o}, default, default},
{bin_element, 1, {char, 1, $o}, default, default}
]}
However, v3_core would then traverse all of those
characters and convert it into an actual binary, as it
is a literal value.
This patch addresses this issue by moving the expansion
of string into chars to v3_core and only if a literal
value cannot not be built. This reduces the compilation
time of the file mentioned above to the values below:
Compiling "bar"
parse_module : 0.134 s 5327.6 kB
transform_module : 0.000 s 5327.6 kB
lint_module : 0.005 s 5327.8 kB
expand_module : 0.000 s 5328.7 kB
v3_core : 0.013 s 11.2 kB
|
|
|
|
|
|
|
|
|
|
'raimo/stdlib/gen_statem-types-and-templates/ERL-172_ERL-187/OTP-13746' into maint
* raimo/stdlib/gen_statem-types-and-templates/ERL-172_ERL-187/OTP-13746:
Fix type and template errors from bugs.erlang.org: ERL-172 and ERL-187
|
|
|
|
Conflicts:
OTP_VERSION
|
|
|
|
|
|
* sverker/update_counter-deadlock/ERL-188/OTP-13731:
erts: Add test ets_SUITE:update_counter_table_growth
erts: Fix deadlock in ets:update_counter/4
erts: Optimize db_finalize_dbterm_hash
|
|
|
|
* maint:
Fix return value spec for ets:match_object
|
|
ets:match_object/1 and ets:match_object/3 return list of matches
|
|
See also ERL-182.
|
|
* bjorn/remove-gs/OTP-13703:
Remove the gs application
|
|
The gs application ws deprecated in R15B01.
|
|
Guard tests (e.g. is_list/1) are listed both in guard_bif/2 and
in new_type_test/2. That is a trap for anyone who wants to add
a new guard test. Let guard_bif/2 call new_type_test/2 so that
new guard tests only have to be added in one place.
While we are it, also sort the clauses in guard_bif/2 and
new_type/2.
|
|
|
|
|
|
* siri/cuddle-master:
Add short sleep when killing slave nodes
[ct test] Do reload_config instead of get_config
|
|
slave_SUITE:t_start_link somtimes fails when checking that a slave is
dead. This commit add a short sleep before the check to allow the node
to terminate.
|
|
* bjorn/stdlib/doc:
Update STDLIB documentation
|
|
Language cleaned up by the technical writers xsipewe and tmanevik
from Combitech. Proofreading and corrections by Björn Gustavsson
and Hans Bolinder.
|