[erlang-questions] Core erlang definition

José Valim jose.valim@REDACTED
Sat Apr 22 09:56:33 CEST 2017


Here is the list of passes starting with the Erlang AST:

https://github.com/erlang/otp/blob/52744948f4bbe85dee428cefdf9d205665a57b18/lib/compiler/src/compile.erl#L656

The passes that emit files based on the command line flags are in the
format {iff, to_pp, {done, "P"}}, such as this one:

https://github.com/erlang/otp/blob/52744948f4bbe85dee428cefdf9d205665a57b18/lib/compiler/src/compile.erl#L668

The pass that converts to core is in the same function. You can see that it
has an option to emit -to_core0 via the command line. So that would be the
format closest to your question:

https://github.com/erlang/otp/blob/52744948f4bbe85dee428cefdf9d205665a57b18/lib/compiler/src/compile.erl#L679-L681

The format emitted by to_core is the one emitted after optimizations,
inlining, etc:

https://github.com/erlang/otp/blob/52744948f4bbe85dee428cefdf9d205665a57b18/lib/compiler/src/compile.erl#L699

You may continue following the passes to see what happens for the other
formats as well. :)


*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D

On Sat, Apr 22, 2017 at 9:23 AM, Xavier Noria <fxn@REDACTED> wrote:

> Does the Erlang compiler go from the Erlang AST to Core Erlang source code
> as printed by +to_core? Or does it just manipulate the structure to convert
> it directly into Core Erlang AST?
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170422/387a164c/attachment.htm>


More information about the erlang-questions mailing list