summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2019-10-16 13:34:47 +0200
committerBjörn Gustavsson <bjorn@erlang.org>2019-10-16 13:34:47 +0200
commitf5eec07529983a75c71690230f27c12fad8383a1 (patch)
treeaca8147b2ee3caca8f098133af63e506d3ff7d51 /lib
parentdecf0027edbab91b0c7dc2f26ed3184bb47f2cbb (diff)
parent70c605f0e2be97bc81878f626ee586a16e7ba093 (diff)
downloaderlang-f5eec07529983a75c71690230f27c12fad8383a1.tar.gz
Merge branch 'maint'
* maint: Always run the core_lint pass when compiling from Core Erlang
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/src/compile.erl14
-rw-r--r--lib/compiler/test/core_SUITE_data/fun_letrec_effect.core2
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 5e0ea9247e..ce45153561 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -601,7 +601,7 @@ passes_1([]) ->
{".erl",[?pass(parse_module)|standard_passes()]}.
pass(from_core) ->
- {".core",[?pass(parse_core)|core_passes()]};
+ {".core",[?pass(parse_core)|core_passes(mandatory_core_lint)]};
pass(from_asm) ->
{".S",[?pass(beam_consult_asm)|asm_passes()]};
pass(from_beam) ->
@@ -799,11 +799,17 @@ standard_passes() ->
?pass(core),
{iff,'dcore',{listing,"core"}},
{iff,'to_core0',{done,"core"}}
- | core_passes()].
+ | core_passes(optional_core_lint)].
-core_passes() ->
+core_passes(LintOpt) ->
%% Optimization and transforms of Core Erlang code.
- [{iff,clint0,?pass(core_lint_module)},
+ CoreLint = case LintOpt of
+ mandatory_core_lint ->
+ ?pass(core_lint_module);
+ optional_core_lint ->
+ {iff,clint0,?pass(core_lint_module)}
+ end,
+ [CoreLint,
{delay,
[{unless,no_copt,
[{core_old_inliner,fun test_old_inliner/1,fun core_old_inliner/2},
diff --git a/lib/compiler/test/core_SUITE_data/fun_letrec_effect.core b/lib/compiler/test/core_SUITE_data/fun_letrec_effect.core
index ab6f5b7940..b58077bf02 100644
--- a/lib/compiler/test/core_SUITE_data/fun_letrec_effect.core
+++ b/lib/compiler/test/core_SUITE_data/fun_letrec_effect.core
@@ -1,4 +1,4 @@
-module 'fun_letrec_effect' ['fun_letrec_effect'/0, 'ok'/0, 'wat'/0]
+module 'fun_letrec_effect' ['fun_letrec_effect'/0, 'wat'/0]
attributes []
'fun_letrec_effect'/0 =