diff options
author | Björn Gustavsson <[email protected]> | 2016-09-02 14:13:18 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-09-02 14:13:18 +0200 |
commit | 61b53af84200b52a5b91c4266e91ebc6ba0173ee (patch) | |
tree | 2d28327d41a41375a9258fa64d99bc3bd8d9c518 /lib/compiler/src/compile.erl | |
parent | 49381b90620e88bda2d3f3edce25c8e841ded9c1 (diff) | |
parent | 6ba91ac62a8cffd9ea274ce8b9023abbcb8d9b67 (diff) | |
download | otp-61b53af84200b52a5b91c4266e91ebc6ba0173ee.tar.gz otp-61b53af84200b52a5b91c4266e91ebc6ba0173ee.tar.bz2 otp-61b53af84200b52a5b91c4266e91ebc6ba0173ee.zip |
Merge branch 'bjorn/eliminate-sys_pre_expand/OTP-13856'
* 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
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r-- | lib/compiler/src/compile.erl | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index e951a25e04..16621d9b43 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -646,13 +646,13 @@ standard_passes() -> {iff,'dabstr',{listing,"abstr"}}, {iff,debug_info,?pass(save_abstract_code)}, - ?pass(expand_module), + ?pass(expand_records), {iff,'dexp',{listing,"expand"}}, {iff,'E',{src_listing,"E"}}, {iff,'to_exp',{done,"E"}}, %% Conversion to Core Erlang. - {pass,v3_core}, + ?pass(core), {iff,'dcore',{listing,"core"}}, {iff,'to_core0',{done,"core"}} | core_passes()]. @@ -1227,13 +1227,17 @@ makedep_output(#compile{code=Code,options=Opts,ofile=Ofile}=St) -> {error,St#compile{errors=St#compile.errors++[Err]}} end. -%% expand_module(State) -> State' -%% Do the common preprocessing of the input forms. +expand_records(#compile{code=Code0,options=Opts}=St0) -> + Code = erl_expand_records:module(Code0, Opts), + {ok,St0#compile{code=Code}}. -expand_module(#compile{code=Code,options=Opts0}=St0) -> - {Mod,Exp,Forms,Opts1} = sys_pre_expand:module(Code, Opts0), +core(#compile{code=Forms,options=Opts0}=St) -> + Opts1 = lists:flatten([C || {attribute,_,compile,C} <- Forms] ++ Opts0), Opts = expand_opts(Opts1), - {ok,St0#compile{module=Mod,options=Opts,code={Mod,Exp,Forms}}}. + {ok,Core,Ws} = v3_core:module(Forms, Opts), + Mod = cerl:concrete(cerl:module_name(Core)), + {ok,St#compile{module=Mod,code=Core,options=Opts, + warnings=St#compile.warnings++Ws}}. core_fold_module_after_inlining(#compile{code=Code0,options=Opts}=St) -> %% Inlining may produce code that generates spurious warnings. @@ -1808,7 +1812,6 @@ pre_load() -> erl_scan, sys_core_dsetel, sys_core_fold, - sys_pre_expand, v3_codegen, v3_core, v3_kernel, |