55% % Compiler backend to Erlang.
66
77-module (elixir_erl ).
8- -export ([elixir_to_erl /1 , elixir_to_erl /2 , definition_to_anonymous /5 , compile /1 , consolidate /4 ,
8+ -export ([elixir_to_erl /1 , elixir_to_erl /2 , definition_to_anonymous /5 , compile /2 , consolidate /4 ,
99 get_ann /1 , debug_info /4 , scope /2 , checker_version /0 , format_error /1 ]).
1010-include (" elixir.hrl" ).
1111-define (typespecs , 'Elixir.Kernel.Typespec' ).
@@ -142,7 +142,7 @@ consolidate(Map, Checker, TypeSpecs, DocsChunk) ->
142142
143143% % Dynamic compilation hook, used in regular compiler
144144
145- compile (#{module := Module , anno := Anno } = BaseMap ) ->
145+ compile (#{module := Module , anno := Anno } = BaseMap , Signatures ) ->
146146 Map =
147147 case elixir_erl_compiler :env_compiler_options () of
148148 [] -> BaseMap ;
@@ -164,7 +164,7 @@ compile(#{module := Module, anno := Anno} = BaseMap) ->
164164
165165 ChunkOpts = chunk_opts (Map ),
166166 DocsChunk = docs_chunk (Map , Set , Module , Anno , Def , Defmacro , Types , Callbacks , ChunkOpts ),
167- CheckerChunk = checker_chunk (Map , Def , ChunkOpts ),
167+ CheckerChunk = checker_chunk (Map , Def , Signatures , ChunkOpts ),
168168 load_form (Map , Prefix , Forms , TypeSpecs , DocsChunk ++ CheckerChunk ).
169169
170170chunk_opts (Map ) ->
@@ -519,10 +519,8 @@ load_form(#{file := File, compile_opts := Opts} = Map, Prefix, Forms, Specs, Chu
519519 Binary .
520520
521521debug_opts (Map , Specs , Opts ) ->
522- % % Signatures are moved to ExCk, no need to duplicate in chunks
523- Keys = [signatures ],
524522 case take_debug_opts (Opts ) of
525- {true , Rest } -> [{debug_info , {? MODULE , {elixir_v1 , maps : without ( Keys , Map ) , Specs }}} | Rest ];
523+ {true , Rest } -> [{debug_info , {? MODULE , {elixir_v1 , Map , Specs }}} | Rest ];
526524 {false , Rest } -> [{debug_info , {? MODULE , none }} | Rest ]
527525 end .
528526
@@ -649,9 +647,8 @@ checker_chunk(nil, _ChunkOpts) ->
649647checker_chunk (Contents , ChunkOpts ) ->
650648 [{<<" ExCk" >>, term_to_binary ({checker_version (), Contents }, ChunkOpts )}].
651649
652- checker_chunk (Map , Def , ChunkOpts ) ->
653- #{deprecated := Deprecated , defines_behaviour := DefinesBehaviour ,
654- signatures := Signatures , attributes := Attributes } = Map ,
650+ checker_chunk (Map , Def , Signatures , ChunkOpts ) ->
651+ #{deprecated := Deprecated , defines_behaviour := DefinesBehaviour , attributes := Attributes } = Map ,
655652 DeprecatedMap = maps :from_list (Deprecated ),
656653
657654 Exports =
0 commit comments