Commit Graph
171 Commits
Author SHA1 Message Date
Fernando Tapia Rico fc6bf59462 Add List.Chars to bootstrap modules
If there is a compile error, Kernel.ParallelCompiler raises
`** (UndefinedFunctionError) function List.Chars.to_charlist/1 is
undefined (module List.Chars is not available)`.
2020-07-16 13:20:38 +02:00
José Valim 4fea9cc942 Recompile Kernel before bootstrapping stdlib (#10002)
Before this patch, we could have slightly different
AST while compiling modules in parallel, depending
if modules were recompiled or not. Now we always
recompile Kernel before compiling the whole stdlib.

We used this opportunity to simplify bootstrap by
breaking it two steps. The first step is the minimal
necessary to compile Kernel itself. The second step
contains the whole compiler.

Closes #10000.
2020-04-30 01:38:04 +02:00
Michał Łępicki 7094e9754c Fix dialyzer errors caused by erl_anno:anno type being opaque (#9961) 2020-04-25 20:29:56 +02:00
Eric Meadows-Jönsson 0f85b397da Add checking of patterns in body (#9828) 2020-02-20 16:46:06 +01:00
Wojtek Mach 8364149953 Add :column to Code.string_to_quoted*/2 2020-01-12 15:41:36 +01:00
José Valim 2b05b8dcf3 Use version metadata in Erlang pass 2019-11-16 02:45:55 +01:00
Eric Meadows-Jönsson 095a3cc3bd Move unification to Infer module 2019-11-13 16:42:25 +01:00
Eric Meadows-Jönsson 45f29d226f Split Infer into Expr and Pattern modules 2019-11-13 16:42:25 +01:00
José Valim afa860ab4a Remove unecessary Erlang macro 2019-11-01 19:19:54 +01:00
José Valim 1e583993a9 Bootstrap typespec before code 2019-10-29 20:42:24 +01:00
Glauber Campinho 7dd86ec1f7 Execute callbacks on :elixir_compiler after all warnings are emitted (#9447)
Currently the callbacks on :elixir_compiler are called before the warnings of unused aliases and imports are emitted, causing the messages to not consumed during the compilation. This commit changes `:elixir_lexical.run/2` to `:elixir_lexical.run/3` splitting the callback in two, one during the execution to evaluate the forms and another to be called after all the warnings are emitted.

Fixes #9440
2019-10-26 10:58:28 +02:00
Eric Meadows-Jönsson c6da1cfaa8 Run checker on Code.require_file/1 (#9393)
Closes #9362.
2019-10-10 23:11:10 +02:00
Eric Meadows-Jönsson 9f334a73ca Move map.ex to bootstrap (#9389) 2019-10-08 14:39:05 +02:00
Eric Meadows-Jönsson 807e205b75 Split Module.Types and add unit tests (#9303) 2019-08-20 11:46:13 -07:00
Eric Meadows-Jönsson c5d5e7f462 Add inference of function head to find function clauses that will never match (#9270) 2019-08-08 14:02:27 +02:00
José Valim b08593b9d1 Add compiler tracing (#9247)
This feature allows IDEs and other tools wanting to
perform source code analysis to do so reliably without
a need to reimplement Elixir's compiler expansion and
without relying on Elixir's private APIs.

This commit also adds :parser_options to compiler
options, which allows developers to combine both options
to retrieve more accurate information, such as columns.
2019-08-02 13:35:12 +02:00
José Valim cbc6029fec Store each compiler option directly in elixir_config, closes #9208 2019-07-18 17:13:10 +02:00
Eric Meadows-Jönsson f418ed247c Add ExCk chunk (#9203) 2019-07-09 21:23:38 +02:00
Eric Meadows-Jönsson 9b6ec7bae7 Move unreachable function check from xref to group pass (#9168) 2019-06-28 10:25:49 +02:00
José Valim 59fcce0b92 Unify error handling and compiler deadlock checking (#9009) 2019-05-02 16:27:13 +02:00
José Valim 914e32a741 Pass lexical_tracker on each_file callback 2019-03-14 23:22:34 +01:00
José Valim 159e9655d5 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
Michał Muskała ffb931a5ac Fix all compiler warnings (#7992) 2018-07-27 16:42:24 +02:00
José Valim d27062c8ec Add Code.purge_compiler_modules/0
Closes #7047
2018-06-20 20:51:05 +02:00
José Valim e28931fdaa Pass tracker destination forward to dynamicly defined modules 2018-05-02 12:18:50 +02:00
José Valim 219c6cc867 Move unused_vars check to Elixir land
This gives us better control over when and how unused variables are printed.

As a result, we are able to emit unused variable warnings in situations
we could not before. This also opens up the way for us to remove a
dependency on erl_lint and track types information, which allows us to
speed up compilation times about 5% and allow us to emit more performant
code in some situations.
2018-01-20 19:45:48 +01:00
José Valim 239db307a2 Merge match_vars and prematch_vars 2018-01-20 19:42:08 +01:00
José Valim f99bb7c0e5 Process variable versioning on Elixir pass 2018-01-20 19:42:08 +01:00
José Valim f518f20372 Revert "Attempt to soft_purge modules, closes #7047"
Soft purging modules was badfun/badarg errors when
invoking left over anonymous functions.
2018-01-05 17:22:20 +01:00
José Valim 6915de35a6 Attempt to soft_purge modules, closes #7047 2017-11-21 13:57:52 -02:00
José Valim 73ab6b8ead Do not pass :in_memory to load_binary
Erlang's typespecs define only cover_compiled and preloaded
as valid atoms and uses an empty list for generated code.
So we should follow Erlang's rules until we can officially
relax them.
2017-10-14 23:19:32 +02:00
Ivan Kozik 75150ec7eb Fix more typos and spelling errors (#6530) 2017-09-01 10:20:53 +02:00
José Valim 0b0ab9f8ef Add Code.Identifier to hold shared identifier logic throughout Elixir 2017-08-22 13:22:26 +02:00
José Valim 579f93bcc7 Ensure elixir_erl:debug_info/4 does not require elixir running (#6401) 2017-07-29 17:27:05 +02:00
José Valim 8c1ed8de53 Use the new debug_info option on OTP 20 2017-05-08 19:59:57 +02:00
José Valim e90b103d06 Use noenv_forms in code evaluation 2017-02-23 14:35:47 +01:00
José Valim 102a8a3fa8 Add elixir_erl_compiler 2017-02-23 13:15:26 +01:00
José Valim 412d5f5661 Start refactoring on elixir_compiler 2017-02-23 13:15:26 +01:00
Aleksei Magusev a729847db6 Rename m/2 helper macro to key/2 in the main header file 2017-02-19 21:56:05 +01:00
José Valim ff8dd1af7f More module renaming and organizing 2017-02-19 21:20:43 +01:00
José Valim 40fe02acc0 Serialize lookups to avoid race in tests 2016-11-03 13:45:33 +01:00
José Valim 25ca5c825a Disable relative paths when loading mix.exs, closes #4465 2016-06-12 18:55:00 +02:00
José Valim abec905009 Use a more explicit pdict key 2016-06-04 16:47:00 +02:00
eksperimental 4ceb41e71b Formmating: Add white space around vertical bar (#4507) 2016-04-25 00:55:49 +02:00
José Valim 92b803b835 Support disabling autoload after compilation
Useful for delaying loading of modules that may depend
on NIFs until necessary.
2016-01-25 00:11:52 +01:00
José Valim e65b01b870 Do not include debug_info in metadata String modules 2016-01-08 10:11:07 +01:00
José Valim ba79d29aa5 Warn on conditional vars
Note a field named safe_by_default has been added so we don't
warn on variables defined inside EXPR in "case EXPR, do: ...".

The proper solution would be to convert && and || into special
forms and they would be free of the warning. However,
safe_by_default is a welcome temporary solution until we see
how the warning will fare on actual applications.
2015-11-16 23:56:33 +01:00
José Valim 599e7bb89c Remove wrapper export_vars function 2015-11-16 17:59:22 +01:00
José Valim 3fa9a642d5 Use new module location 2015-11-16 17:47:00 +01:00
José Valim 35fbf0716a Move code server and compiler away from ord* 2015-10-19 12:19:15 +02:00