Commit Graph
47 Commits
Author SHA1 Message Date
José Valim 46f7b37916 Ignore eval failure warnings from Erlang
Closes #15372.
2026-05-14 13:59:28 +02:00
José Valim 64a387da82 Load modules lazily and only if needed (#14453) 2025-04-28 12:45:25 +02:00
Jonatan Männchen e1d171e5c7 Add inline License / Copyright to Erlang files (#14255) 2025-02-05 13:50:00 +01:00
José Valim 485ca72ae2 Infer types and use them across remote calls (#13981)
This also unifies handling of deterministic builds with Erlang/OTP
as well as warnings_as_errors.
2024-11-09 18:00:27 +01:00
José Valim c3dc6c86dd Detect never matching clauses and patterns (#13968) 2024-11-06 13:51:04 +01:00
José Valim 809971a690 Remove redundant warnings 2024-10-29 18:52:12 +01:00
José Valim 58bb5194d3 Propagate diagnostics from inner compiler process 2023-07-06 09:41:57 +02:00
José Valim b24869687b Introduce mechanism to collect several errors in a module (#12275) 2022-11-28 15:40:30 +01:00
José Valim 239f8f9e3b Require Erlang/OTP 24 2022-07-27 13:20:42 +02:00
José Valim 5cca930097 Annotate code to be removed on Erlang/OTP 24 2021-09-19 20:22:30 +02:00
José Valim a355450af8 Ensure waiting is tracked across typespecs
The Elixir compiler spawns a separate process per file.
When a file has to wait on another module, Elixir tracks
in the compiler that the file is waiting.

However, every time a module is defined, the Elixir compiler
spawns a separate process to compile to .beam, and this
process may expand structs in the typespec. Since this
new process is no longer the original file process, Elixir
was not able to track its waiting time.

This PR address this issue by passing the original file_pid
to the .beam compiler process. Note though that, if we
change typespecs to be compiled in the original file process,
this change is no longer required, but at the moment there are
no plans to make such change.

Closes #11036.
2021-06-05 19:21:12 +02:00
José Valim 189fca62ca Reduce the amount of module map copies when compiling
Prior to this commit, compilation would copy the module map
(which is the map with the module definitions, attriubutes,
etc) multiple times. In particular, the module execution
process would pass it to the compiler. Then the module
execution process would send it to the parallel compiler
coordinator, which would pass it to the parallel checker
coordinator and then to each individual parallel checker.
That's four copies, which can be quite expensive since it
has the whole Elixir AST.

This commit makes it so it is copied only once. The map
is assembled inside the compiler process and then copied
to the checker process.

This has yielded good improvements in Elixir's test suite.

Before:

    Finished in 27.3 seconds (14.4s on load, 7.0s async, 5.8s sync)

After:

    Finished in 22.0 seconds (9.4s on load, 6.7s async, 5.8s sync)
2021-05-07 16:41:10 +02:00
Eksperimental 784b881b76 Standardize use of Erlang/OTP VERSION (#10867) 2021-04-03 17:11:57 +02:00
José Valim c0edad99b8 Remove TODOs related to Erlang/OTP 22+ 2021-03-30 09:46:43 +02:00
Wojtek Mach dedbfc8b3f Update warnings for OTP master (#10807) 2021-03-23 17:40:04 +01:00
Wojtek Mach 1ccb9c0060 Update Erlang warnings translation (#10694)
Since https://github.com/erlang/otp/commit/8ecc648df22dbfe9dd68a3e2b968ba2b6a2ca7fe
instead of `{eval_failure, Reason}` we'd get `{eval_failure, Call, Reason}`
2021-02-12 12:23:58 +01:00
José Valim 3916baf541 Do not crash if a module is given instead of file on inner compiler error 2020-10-20 10:51:43 +02:00
José Valim 58a5070cc5 Skip sys_core_prepare pass on Erlang/OTP 23+ 2020-03-18 14:21:13 +01:00
José Valim 60248a072a Fixes for Erlang/OTP 23 2020-02-26 12:06:08 +01:00
Eksperimental 8eef0ae581 Replace usage of "etc." (#9569) 2019-11-29 08:22:18 +01:00
José Valim cf881389cf Remove unecessary Erlang macro 2019-11-01 19:19:54 +01:00
José Valim 833ceb0826 Pass env compiler options to v3_core 2019-04-01 09:48:32 +02:00
José Valim 64eb6af13a Rely on IO.warn whenever possible 2019-01-18 14:59:20 +01:00
José Valim d644170c0a Raise when passing invalid compiler flags to Elixir, closes #7839 2018-11-26 10:09:58 +01:00
Eksperimental 477c821ef0 Use "etc." and not "etc" (#8379)
Command used to detect these typos:
$ ag -s "\betc[^.]"
2018-11-10 14:04:49 +01:00
José Valim 74f5740b2c Use the no_spawn_compiler_process in more recent release
See https://github.com/erlang/otp/pull/1972.
2018-10-03 14:02:46 +02:00
José Valim af25ea4d2a Bypass erl_lint and spawn compiler processes manually (#8241)
This speeds up the Elixir compiler from 5-10% as we no
longer do duplicate work on erl_lint and expand_records.
We also avoid the copying of messages by controlling
exactly when the compiler spawns new processes.
2018-10-02 11:18:44 +02:00
Glauber Campinho 5b48933f47 Let the undefined function error be performed in Elixir-land (#8231)
Refers to #5800
2018-10-01 12:22:38 +02:00
Fernando Tapia Rico 936d468281 Warn on underspecified opaque types (#8232)
Refers to #5800

Performs the erl_lint check "underspecified_opaque, {TypeName, Arity}}" in Elixir.

After reading the Erlang/OTP codebase, it seems an "underspecified opaque" is an opaque type of arity 0 with a spec of "term" or "any".
2018-09-28 10:58:31 +02:00
Glauber Campinho 2d9dece6cb Optimizes multiple :maps put and merge operations (#8223)
Optimizes :maps.put/3 to a VM operation instead of a remote call, including nested calls to it.
It does the same for :maps.merge/2 with a simple map on the right side.

Closes #7353
2018-09-28 08:40:27 +02:00
lukevmorris 00b7d16ba2 Warn if nested comparisons are found (#7773) 2018-06-21 18:59:52 +02:00
José Valim 8cc98c253e Avoid capture operator warnings 2018-05-04 19:50:49 +02:00
José Valim fd4dc4474a Process variable versioning on Elixir pass 2018-01-20 19:42:08 +01:00
José Valim aad66f22bc Move all remaining behaviour usage warnings to Elixir 2017-10-22 00:59:11 +02:00
Alexis Brodeur 18f723541c Perform some behaviour lint checks in Elixir (#6841) 2017-10-21 23:35:15 +02:00
José Valim 88017b2916 Prefix variables with V when emitting Erlang code
This guarantees decompiling Elixir code to Erlang results
in runnable code and improves Elixir's interoperability
with tools such as the Erlang debugger.
2017-09-15 12:03:39 +02:00
José Valim 5c418ed1ae Silence behaviour warnings on bootstrapping 2017-08-22 13:22:26 +02:00
José Valim f68a483f45 Ensure elixir_erl:debug_info/4 does not require elixir running (#6401) 2017-07-29 17:27:05 +02:00
Andrea Leopardi 32799635f8 Remove a couple TODOs now that we no longer support Erlang 18 (#6260) 2017-06-25 22:25:48 +02:00
José Valim 5889718983 Use the new debug_info option on OTP 20 2017-05-08 19:59:57 +02:00
José Valim 05d12e40da Move beam chunk logic back to elixir_erl 2017-05-08 15:26:43 +02:00
José Valim 8ae84b186d Remove Erlang warnings on Mix suite 2017-05-08 15:26:43 +02:00
José Valim 010007eff9 Use new extra_chunks option when possible 2017-05-08 15:26:43 +02:00
José Valim 7f8214ebfd Remove warnings on OTP 20 2017-05-07 10:28:08 +02:00
Andrea Leopardi 6f8abf3dc7 Replace compile_error/4 with form_error/4 in elixir_erl_compiler (#5925) 2017-03-25 17:02:59 +01:00
Aleksei Magusev 2d228d0a65 Remove unnecessary clause for "unsafe_var" handling
Since c94c2d8807 it is not needed.
2017-02-25 19:12:49 +01:00
José Valim ac5a0cf9ec Add elixir_erl_compiler 2017-02-23 13:15:26 +01:00